Class MultipleInputStreamTask<OUT>
- java.lang.Object
-
- org.apache.flink.streaming.runtime.tasks.StreamTask<OUT,MultipleInputStreamOperator<OUT>>
-
- org.apache.flink.streaming.runtime.tasks.MultipleInputStreamTask<OUT>
-
- All Implemented Interfaces:
CheckpointableTask
,CoordinatedTask
,TaskInvokable
,AsyncExceptionHandler
,ContainingTaskDetails
@Internal public class MultipleInputStreamTask<OUT> extends StreamTask<OUT,MultipleInputStreamOperator<OUT>>
AStreamTask
for executing aMultipleInputStreamOperator
and supporting theMultipleInputStreamOperator
to select input for reading.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.streaming.runtime.tasks.StreamTask
StreamTask.CanEmitBatchOfRecordsChecker
-
-
Field Summary
-
Fields inherited from class org.apache.flink.streaming.runtime.tasks.StreamTask
checkpointStorage, configuration, inputProcessor, LOG, mailboxProcessor, mainOperator, operatorChain, recordWriter, stateBackend, systemTimerService, timerService, TRIGGER_THREAD_GROUP
-
-
Constructor Summary
Constructors Constructor Description MultipleInputStreamTask(Environment env)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abortCheckpointOnBarrier(long checkpointId, CheckpointException cause)
Aborts a checkpoint as the result of receiving possibly some checkpoint barriers, but at least oneCancelCheckpointMarker
.protected void
advanceToEndOfEventTime()
Emits theMAX_WATERMARK
so that all registered timers are fired.protected void
createInputProcessor(List<IndexedInputGate>[] inputGates, StreamConfig.InputConfig[] inputs, WatermarkGauge[] inputWatermarkGauges, Function<Integer,StreamPartitioner<?>> gatePartitioners)
StreamTask.CanEmitBatchOfRecordsChecker
getCanEmitBatchOfRecords()
protected Optional<CheckpointBarrierHandler>
getCheckpointBarrierHandler()
Acquires the optionalCheckpointBarrierHandler
associated with this stream task.void
init()
CompletableFuture<Boolean>
triggerCheckpointAsync(CheckpointMetaData metadata, CheckpointOptions options)
This method is called to trigger a checkpoint, asynchronously by the checkpoint coordinator.void
triggerCheckpointOnBarrier(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions, CheckpointMetricsBuilder checkpointMetrics)
This method is called when a checkpoint is triggered as a result of receiving checkpoint barriers on all input streams.-
Methods inherited from class org.apache.flink.streaming.runtime.tasks.StreamTask
afterInvoke, cancel, cancelTask, cleanUp, cleanUpInternal, createRecordWriterDelegate, createStreamTaskStateInitializer, declineCheckpoint, dispatchOperatorEvent, endData, finalize, getAsyncCheckpointStartDelayNanos, getAsyncOperationsThreadPool, getCancelables, getCheckpointStorage, getCompletionFuture, getConfiguration, getEnvironment, getMailboxExecutorFactory, getName, getProcessingTimeServiceFactory, handleAsyncException, hasMail, invoke, isCanceled, isFailing, isMailboxLoopRunning, isRunning, isUsingNonBlockingInput, maybeInterruptOnCancel, notifyCheckpointAbortAsync, notifyCheckpointCompleteAsync, notifyCheckpointSubsumedAsync, notifyEndOfData, processInput, restore, runMailboxLoop, runMailboxStep, runSingleMailboxLoop, setSynchronousSavepoint, setupNumRecordsInCounter, toString
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.flink.streaming.runtime.tasks.ContainingTaskDetails
getExecutionConfig, getIndexInSubtaskGroup, getJobConfiguration, getUserCodeClassLoader
-
-
-
-
Constructor Detail
-
MultipleInputStreamTask
public MultipleInputStreamTask(Environment env) throws Exception
- Throws:
Exception
-
-
Method Detail
-
init
public void init() throws Exception
- Specified by:
init
in classStreamTask<OUT,MultipleInputStreamOperator<OUT>>
- Throws:
Exception
-
createInputProcessor
protected void createInputProcessor(List<IndexedInputGate>[] inputGates, StreamConfig.InputConfig[] inputs, WatermarkGauge[] inputWatermarkGauges, Function<Integer,StreamPartitioner<?>> gatePartitioners)
-
getCheckpointBarrierHandler
protected Optional<CheckpointBarrierHandler> getCheckpointBarrierHandler()
Description copied from class:StreamTask
Acquires the optionalCheckpointBarrierHandler
associated with this stream task. TheCheckpointBarrierHandler
should exist if the task has data inputs and requires to align the barriers.- Overrides:
getCheckpointBarrierHandler
in classStreamTask<OUT,MultipleInputStreamOperator<OUT>>
-
triggerCheckpointAsync
public CompletableFuture<Boolean> triggerCheckpointAsync(CheckpointMetaData metadata, CheckpointOptions options)
Description copied from interface:CheckpointableTask
This method is called to trigger a checkpoint, asynchronously by the checkpoint coordinator.This method is called for tasks that start the checkpoints by injecting the initial barriers, i.e., the source tasks. In contrast, checkpoints on downstream operators, which are the result of receiving checkpoint barriers, invoke the
CheckpointableTask.triggerCheckpointOnBarrier(CheckpointMetaData, CheckpointOptions, CheckpointMetricsBuilder)
method.- Specified by:
triggerCheckpointAsync
in interfaceCheckpointableTask
- Overrides:
triggerCheckpointAsync
in classStreamTask<OUT,MultipleInputStreamOperator<OUT>>
- Parameters:
metadata
- Meta data for about this checkpointoptions
- Options for performing this checkpoint- Returns:
- future with value of
false
if the checkpoint was not carried out,true
otherwise
-
getCanEmitBatchOfRecords
public StreamTask.CanEmitBatchOfRecordsChecker getCanEmitBatchOfRecords()
- Overrides:
getCanEmitBatchOfRecords
in classStreamTask<OUT,MultipleInputStreamOperator<OUT>>
-
triggerCheckpointOnBarrier
public void triggerCheckpointOnBarrier(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions, CheckpointMetricsBuilder checkpointMetrics) throws IOException
Description copied from interface:CheckpointableTask
This method is called when a checkpoint is triggered as a result of receiving checkpoint barriers on all input streams.- Specified by:
triggerCheckpointOnBarrier
in interfaceCheckpointableTask
- Overrides:
triggerCheckpointOnBarrier
in classStreamTask<OUT,MultipleInputStreamOperator<OUT>>
- Parameters:
checkpointMetaData
- Meta data for about this checkpointcheckpointOptions
- Options for performing this checkpointcheckpointMetrics
- Metrics about this checkpoint- Throws:
IOException
- Exceptions thrown as the result of triggering a checkpoint are forwarded.
-
abortCheckpointOnBarrier
public void abortCheckpointOnBarrier(long checkpointId, CheckpointException cause) throws IOException
Description copied from interface:CheckpointableTask
Aborts a checkpoint as the result of receiving possibly some checkpoint barriers, but at least oneCancelCheckpointMarker
.This requires implementing tasks to forward a
CancelCheckpointMarker
to their outputs.- Specified by:
abortCheckpointOnBarrier
in interfaceCheckpointableTask
- Overrides:
abortCheckpointOnBarrier
in classStreamTask<OUT,MultipleInputStreamOperator<OUT>>
- Parameters:
checkpointId
- The ID of the checkpoint to be aborted.cause
- The reason why the checkpoint was aborted during alignment- Throws:
IOException
-
advanceToEndOfEventTime
protected void advanceToEndOfEventTime() throws Exception
Description copied from class:StreamTask
Emits theMAX_WATERMARK
so that all registered timers are fired.This is used by the source task when the job is
TERMINATED
. In the case, we want all the timers registered throughout the pipeline to fire and the related state (e.g. windows) to be flushed.For tasks other than the source task, this method does nothing.
- Overrides:
advanceToEndOfEventTime
in classStreamTask<OUT,MultipleInputStreamOperator<OUT>>
- Throws:
Exception
-
-