public final class MultiInputSortingDataInput<IN,K> extends Object implements StreamTaskInput<IN>
MultiInputSortingDataInput have finished sorting as well.
Moreover it will report it is available or approximately available if it has some records pending only if the
head of the CommonContext#getQueueOfHeads() belongs to the input. That way there is only
ever one input that reports it is available.
The sorter uses binary comparison of keys, which are extracted and serialized when received
from the chained input. Moreover the timestamps of incoming records are used for secondary
ordering. For the comparison it uses either FixedLengthByteKeyComparator if the length of
the serialized key is constant, or VariableLengthByteKeyComparator otherwise.
Watermarks, watermark statuses, nor latency markers are propagated downstream as they do not make sense with buffered records. The input emits the largest watermark seen after all records.
| 限定符和类型 | 类和说明 |
|---|---|
static class |
MultiInputSortingDataInput.SelectableSortingInputs
A wrapper that combines sorting
inputs with a InputSelectable
that should be used to choose which input to consume next from. |
PushingAsyncDataInput.DataOutput<T>UNSPECIFIED| 限定符和类型 | 方法和说明 |
|---|---|
void |
close() |
DataInputStatus |
emitNext(PushingAsyncDataInput.DataOutput<IN> output)
Pushes the next element to the output from current data input, and returns the input status
to indicate whether there are more available data in current input.
|
CompletableFuture<?> |
getAvailableFuture() |
int |
getInputIndex()
Returns the input index of this input.
|
CompletableFuture<Void> |
prepareSnapshot(org.apache.flink.runtime.checkpoint.channel.ChannelStateWriter channelStateWriter,
long checkpointId)
Prepares to spill the in-flight input buffers as checkpoint snapshot.
|
static <K> MultiInputSortingDataInput.SelectableSortingInputs |
wrapInputs(org.apache.flink.runtime.jobgraph.tasks.TaskInvokable containingTask,
StreamTaskInput<Object>[] sortingInputs,
org.apache.flink.api.java.functions.KeySelector<Object,K>[] keySelectors,
org.apache.flink.api.common.typeutils.TypeSerializer<Object>[] inputSerializers,
org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer,
StreamTaskInput<Object>[] passThroughInputs,
org.apache.flink.runtime.memory.MemoryManager memoryManager,
org.apache.flink.runtime.io.disk.iomanager.IOManager ioManager,
boolean objectReuse,
double managedMemoryFraction,
org.apache.flink.configuration.Configuration jobConfiguration,
org.apache.flink.api.common.ExecutionConfig executionConfig) |
public static <K> MultiInputSortingDataInput.SelectableSortingInputs wrapInputs(org.apache.flink.runtime.jobgraph.tasks.TaskInvokable containingTask, StreamTaskInput<Object>[] sortingInputs, org.apache.flink.api.java.functions.KeySelector<Object,K>[] keySelectors, org.apache.flink.api.common.typeutils.TypeSerializer<Object>[] inputSerializers, org.apache.flink.api.common.typeutils.TypeSerializer<K> keySerializer, StreamTaskInput<Object>[] passThroughInputs, org.apache.flink.runtime.memory.MemoryManager memoryManager, org.apache.flink.runtime.io.disk.iomanager.IOManager ioManager, boolean objectReuse, double managedMemoryFraction, org.apache.flink.configuration.Configuration jobConfiguration, org.apache.flink.api.common.ExecutionConfig executionConfig)
public int getInputIndex()
StreamTaskInputgetInputIndex 在接口中 StreamTaskInput<IN>public CompletableFuture<Void> prepareSnapshot(org.apache.flink.runtime.checkpoint.channel.ChannelStateWriter channelStateWriter, long checkpointId)
StreamTaskInputprepareSnapshot 在接口中 StreamTaskInput<IN>public void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionpublic DataInputStatus emitNext(PushingAsyncDataInput.DataOutput<IN> output) throws Exception
PushingAsyncDataInputThis method should be non blocking.
emitNext 在接口中 PushingAsyncDataInput<IN>Exceptionpublic CompletableFuture<?> getAvailableFuture()
getAvailableFuture 在接口中 org.apache.flink.runtime.io.AvailabilityProviderCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.