public abstract class AbstractMergeIterator<T1,T2,O> extends Object implements JoinTaskIterator<T1,T2,O>
| Modifier and Type | Field and Description |
|---|---|
protected T2 |
blockHeadCopy |
protected T1 |
copy1 |
protected T2 |
copy2 |
protected KeyGroupedIterator<T1> |
iterator1 |
protected KeyGroupedIterator<T2> |
iterator2 |
protected org.apache.flink.api.common.typeutils.TypePairComparator<T1,T2> |
pairComparator |
protected org.apache.flink.api.common.typeutils.TypeSerializer<T1> |
serializer1 |
protected org.apache.flink.api.common.typeutils.TypeSerializer<T2> |
serializer2 |
protected T1 |
spillHeadCopy |
| Constructor and Description |
|---|
AbstractMergeIterator(org.apache.flink.util.MutableObjectIterator<T1> input1,
org.apache.flink.util.MutableObjectIterator<T2> input2,
org.apache.flink.api.common.typeutils.TypeSerializer<T1> serializer1,
org.apache.flink.api.common.typeutils.TypeComparator<T1> comparator1,
org.apache.flink.api.common.typeutils.TypeSerializer<T2> serializer2,
org.apache.flink.api.common.typeutils.TypeComparator<T2> comparator2,
org.apache.flink.api.common.typeutils.TypePairComparator<T1,T2> pairComparator,
MemoryManager memoryManager,
IOManager ioManager,
int numMemoryPages,
AbstractInvokable parentTask) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort()
Aborts the matching process.
|
abstract boolean |
callWithNextKey(org.apache.flink.api.common.functions.FlatJoinFunction<T1,T2,O> joinFunction,
org.apache.flink.util.Collector<O> collector)
Calls the
JoinFunction#join() method for all two key-value pairs that share the
same key and come from different inputs. |
void |
close()
General-purpose close method.
|
protected abstract <T> T |
createCopy(org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer,
T value,
T reuse)
Copies an instance of the given type, potentially reusing the object passed as the reuse
parameter, which may be null.
|
protected abstract <T> KeyGroupedIterator<T> |
createKeyGroupedIterator(org.apache.flink.util.MutableObjectIterator<T> input,
org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer,
org.apache.flink.api.common.typeutils.TypeComparator<T> comparator) |
protected void |
crossMatchingGroup(Iterator<T1> values1,
Iterator<T2> values2,
org.apache.flink.api.common.functions.FlatJoinFunction<T1,T2,O> joinFunction,
org.apache.flink.util.Collector<O> collector) |
void |
open()
General-purpose open method.
|
protected org.apache.flink.api.common.typeutils.TypePairComparator<T1,T2> pairComparator
protected KeyGroupedIterator<T1> iterator1
protected KeyGroupedIterator<T2> iterator2
protected final org.apache.flink.api.common.typeutils.TypeSerializer<T1> serializer1
protected final org.apache.flink.api.common.typeutils.TypeSerializer<T2> serializer2
protected T1 copy1
protected T1 spillHeadCopy
protected T2 copy2
protected T2 blockHeadCopy
public AbstractMergeIterator(org.apache.flink.util.MutableObjectIterator<T1> input1, org.apache.flink.util.MutableObjectIterator<T2> input2, org.apache.flink.api.common.typeutils.TypeSerializer<T1> serializer1, org.apache.flink.api.common.typeutils.TypeComparator<T1> comparator1, org.apache.flink.api.common.typeutils.TypeSerializer<T2> serializer2, org.apache.flink.api.common.typeutils.TypeComparator<T2> comparator2, org.apache.flink.api.common.typeutils.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 abstract boolean callWithNextKey(org.apache.flink.api.common.functions.FlatJoinFunction<T1,T2,O> joinFunction, org.apache.flink.util.Collector<O> collector) throws Exception
JoinFunction#join() method for all two key-value pairs that share the
same key and come from different inputs. The output of the join() 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.
callWithNextKey in interface JoinTaskIterator<T1,T2,O>joinFunction - 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.JoinTaskIterator.callWithNextKey(org.apache.flink.api.common.functions.FlatJoinFunction,
org.apache.flink.util.Collector)protected void crossMatchingGroup(Iterator<T1> values1, Iterator<T2> values2, org.apache.flink.api.common.functions.FlatJoinFunction<T1,T2,O> joinFunction, org.apache.flink.util.Collector<O> collector) throws Exception
Exceptionprotected abstract <T> KeyGroupedIterator<T> createKeyGroupedIterator(org.apache.flink.util.MutableObjectIterator<T> input, org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer, org.apache.flink.api.common.typeutils.TypeComparator<T> comparator)
protected abstract <T> T createCopy(org.apache.flink.api.common.typeutils.TypeSerializer<T> serializer,
T value,
T reuse)
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.