public class MergeMatchIterator<T1,T2,O> extends Object implements JoinTaskIterator<T1,T2,O>
JoinTaskIterator that realizes the
matching through a sort-merge join strategy.| Constructor and Description |
|---|
MergeMatchIterator(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) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Aborts the matching process.
|
boolean |
callWithNextKey(FlatJoinFunction<T1,T2,O> matchFunction,
Collector<O> collector)
Calls the
JoinFunction#match() method for all two key-value pairs that share the same key and come
from different inputs. |
void |
close()
General-purpose close method.
|
void |
open()
General-purpose open method.
|
public MergeMatchIterator(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
MemoryAllocationExceptionpublic void open()
throws IOException
JoinTaskIteratoropen in interface JoinTaskIterator<T1,T2,O>IOException - Thrown, if an I/O error occurred while preparing the data. An example is a failing
external sort.public void close()
JoinTaskIteratorclose in interface JoinTaskIterator<T1,T2,O>public void abort()
JoinTaskIteratorabort in interface JoinTaskIterator<T1,T2,O>public boolean callWithNextKey(FlatJoinFunction<T1,T2,O> matchFunction, Collector<O> collector) throws Exception
JoinFunction#match() method for all two key-value pairs that share the same key and come
from different inputs. The output of the match() method is forwarded.
This method first zig-zags between the two sorted inputs in order to find a common key, and then calls the match stub with the cross product of the values.
callWithNextKey in interface JoinTaskIterator<T1,T2,O>matchFunction - The match stub containing the match function which is called with the keys.collector - The collector to pass the match function.Exception - Forwards all exceptions from the user code and the I/O system.org.apache.flink.runtime.operators.util.JoinTaskIterator#callWithNextKey()Copyright © 2014 The Apache Software Foundation. All rights reserved.