Class ReusingBuildFirstHashJoinIterator<V1,V2,O>
- java.lang.Object
-
- org.apache.flink.runtime.operators.hash.HashJoinIteratorBase
-
- org.apache.flink.runtime.operators.hash.ReusingBuildFirstHashJoinIterator<V1,V2,O>
-
- All Implemented Interfaces:
JoinTaskIterator<V1,V2,O>
- Direct Known Subclasses:
ReusingBuildFirstReOpenableHashJoinIterator
public class ReusingBuildFirstHashJoinIterator<V1,V2,O> extends HashJoinIteratorBase implements JoinTaskIterator<V1,V2,O>
An implementation of theJoinTaskIterator
that uses a hybrid-hash-join internally to match the records with equal key. The build side of the hash is the first input of the match.
-
-
Field Summary
Fields Modifier and Type Field Description protected MutableHashTable<V1,V2>
hashJoin
protected TypeSerializer<V2>
probeSideSerializer
-
Constructor Summary
Constructors Constructor Description ReusingBuildFirstHashJoinIterator(MutableObjectIterator<V1> firstInput, MutableObjectIterator<V2> secondInput, TypeSerializer<V1> serializer1, TypeComparator<V1> comparator1, TypeSerializer<V2> serializer2, TypeComparator<V2> comparator2, TypePairComparator<V2,V1> pairComparator, MemoryManager memManager, IOManager ioManager, AbstractInvokable ownerTask, double memoryFraction, boolean probeSideOuterJoin, boolean buildSideOuterJoin, boolean useBitmapFilters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abort()
Aborts the matching process.boolean
callWithNextKey(FlatJoinFunction<V1,V2,O> matchFunction, Collector<O> collector)
Moves the internal pointer to the next key that both inputs share.void
close()
General-purpose close method.void
open()
General-purpose open method.-
Methods inherited from class org.apache.flink.runtime.operators.hash.HashJoinIteratorBase
getHashJoin
-
-
-
-
Field Detail
-
hashJoin
protected final MutableHashTable<V1,V2> hashJoin
-
probeSideSerializer
protected final TypeSerializer<V2> probeSideSerializer
-
-
Constructor Detail
-
ReusingBuildFirstHashJoinIterator
public ReusingBuildFirstHashJoinIterator(MutableObjectIterator<V1> firstInput, MutableObjectIterator<V2> secondInput, TypeSerializer<V1> serializer1, TypeComparator<V1> comparator1, TypeSerializer<V2> serializer2, TypeComparator<V2> comparator2, TypePairComparator<V2,V1> pairComparator, MemoryManager memManager, IOManager ioManager, AbstractInvokable ownerTask, double memoryFraction, boolean probeSideOuterJoin, boolean buildSideOuterJoin, boolean useBitmapFilters) throws MemoryAllocationException
- Throws:
MemoryAllocationException
-
-
Method Detail
-
open
public void open() throws IOException, MemoryAllocationException, InterruptedException
Description copied from interface:JoinTaskIterator
General-purpose open method. Initializes the internal strategy (for example triggers the sorting of the inputs or starts building hash tables).- Specified by:
open
in interfaceJoinTaskIterator<V1,V2,O>
- Throws:
IOException
- Thrown, if an I/O error occurred while preparing the data. An example is a failing external sort.MemoryAllocationException
- Thrown, if the internal strategy could not allocate the memory it needs.InterruptedException
- Thrown, if the thread was interrupted during the initialization process.
-
close
public void close()
Description copied from interface:JoinTaskIterator
General-purpose close method. Works after the principle of best effort. The internal structures are released, but errors that occur on the way are not reported.- Specified by:
close
in interfaceJoinTaskIterator<V1,V2,O>
-
callWithNextKey
public final boolean callWithNextKey(FlatJoinFunction<V1,V2,O> matchFunction, Collector<O> collector) throws Exception
Description copied from interface:JoinTaskIterator
Moves the internal pointer to the next key that both inputs share. It calls the match stub with the cross product of all values that share the same key.- Specified by:
callWithNextKey
in interfaceJoinTaskIterator<V1,V2,O>
- Parameters:
matchFunction
- The match stub containing the match function which is called with the keys.collector
- The collector to pass the match function.- Returns:
- True, if a next key exists, false if no more keys exist.
- Throws:
Exception
- Exceptions from the user code are forwarded.
-
abort
public void abort()
Description copied from interface:JoinTaskIterator
Aborts the matching process. This extra abort method is supplied, because a significant time may pass while calling the match stub with the cross product of all values that share the same key. A call to this abort method signals an interrupt to that procedure.- Specified by:
abort
in interfaceJoinTaskIterator<V1,V2,O>
-
-