Class AbstractMergeInnerJoinIterator<T1,T2,O>
- java.lang.Object
-
- org.apache.flink.runtime.operators.sort.AbstractMergeIterator<T1,T2,O>
-
- org.apache.flink.runtime.operators.sort.AbstractMergeInnerJoinIterator<T1,T2,O>
-
- All Implemented Interfaces:
JoinTaskIterator<T1,T2,O>
- Direct Known Subclasses:
NonReusingMergeInnerJoinIterator
,ReusingMergeInnerJoinIterator
public abstract class AbstractMergeInnerJoinIterator<T1,T2,O> extends AbstractMergeIterator<T1,T2,O>
An implementation of theJoinTaskIterator
that realizes the joining through a sort-merge join strategy.
-
-
Field Summary
-
Fields inherited from class org.apache.flink.runtime.operators.sort.AbstractMergeIterator
blockHeadCopy, copy1, copy2, iterator1, iterator2, pairComparator, serializer1, serializer2, spillHeadCopy
-
-
Constructor Summary
Constructors Constructor Description AbstractMergeInnerJoinIterator(MutableObjectIterator<T1> input1, MutableObjectIterator<T2> input2, TypeSerializer<T1> serializer1, TypeComparator<T1> comparator1, TypeSerializer<T2> serializer2, TypeComparator<T2> comparator2, TypePairComparator<T1,T2> pairComparator, MemoryManager memoryManager, IOManager ioManager, int numMemoryPages, AbstractInvokable parentTask)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
callWithNextKey(FlatJoinFunction<T1,T2,O> joinFunction, Collector<O> collector)
Calls theJoinFunction#join()
method for all two key-value pairs that share the same key and come from different inputs.-
Methods inherited from class org.apache.flink.runtime.operators.sort.AbstractMergeIterator
abort, close, createCopy, createKeyGroupedIterator, crossMatchingGroup, open
-
-
-
-
Constructor Detail
-
AbstractMergeInnerJoinIterator
public AbstractMergeInnerJoinIterator(MutableObjectIterator<T1> input1, MutableObjectIterator<T2> input2, TypeSerializer<T1> serializer1, TypeComparator<T1> comparator1, TypeSerializer<T2> serializer2, TypeComparator<T2> comparator2, TypePairComparator<T1,T2> pairComparator, MemoryManager memoryManager, IOManager ioManager, int numMemoryPages, AbstractInvokable parentTask) throws MemoryAllocationException
- Throws:
MemoryAllocationException
-
-
Method Detail
-
callWithNextKey
public boolean callWithNextKey(FlatJoinFunction<T1,T2,O> joinFunction, Collector<O> collector) throws Exception
Calls theJoinFunction#join()
method for all two key-value pairs that share the same key and come from different inputs. The output of thejoin()
method is forwarded.This method first zig-zags between the two sorted inputs in order to find a common key, and then calls the join stub with the cross product of the values.
- Specified by:
callWithNextKey
in interfaceJoinTaskIterator<T1,T2,O>
- Specified by:
callWithNextKey
in classAbstractMergeIterator<T1,T2,O>
- Parameters:
joinFunction
- 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
- Forwards all exceptions from the user code and the I/O system.- See Also:
JoinTaskIterator.callWithNextKey(org.apache.flink.api.common.functions.FlatJoinFunction, org.apache.flink.util.Collector)
-
-