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>>
AStreamTaskfor executing aMultipleInputStreamOperatorand supporting theMultipleInputStreamOperatorto 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 voidabortCheckpointOnBarrier(long checkpointId, CheckpointException cause)Aborts a checkpoint as the result of receiving possibly some checkpoint barriers, but at least oneCancelCheckpointMarker.protected voidadvanceToEndOfEventTime()Emits theMAX_WATERMARKso that all registered timers are fired.protected voidcreateInputProcessor(List<IndexedInputGate>[] inputGates, StreamConfig.InputConfig[] inputs, WatermarkGauge[] inputWatermarkGauges, Function<Integer,StreamPartitioner<?>> gatePartitioners)StreamTask.CanEmitBatchOfRecordsCheckergetCanEmitBatchOfRecords()protected Optional<CheckpointBarrierHandler>getCheckpointBarrierHandler()Acquires the optionalCheckpointBarrierHandlerassociated with this stream task.voidinit()CompletableFuture<Boolean>triggerCheckpointAsync(CheckpointMetaData metadata, CheckpointOptions options)This method is called to trigger a checkpoint, asynchronously by the checkpoint coordinator.voidtriggerCheckpointOnBarrier(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:
initin 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:StreamTaskAcquires the optionalCheckpointBarrierHandlerassociated with this stream task. TheCheckpointBarrierHandlershould exist if the task has data inputs and requires to align the barriers.- Overrides:
getCheckpointBarrierHandlerin classStreamTask<OUT,MultipleInputStreamOperator<OUT>>
-
triggerCheckpointAsync
public CompletableFuture<Boolean> triggerCheckpointAsync(CheckpointMetaData metadata, CheckpointOptions options)
Description copied from interface:CheckpointableTaskThis 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:
triggerCheckpointAsyncin interfaceCheckpointableTask- Overrides:
triggerCheckpointAsyncin classStreamTask<OUT,MultipleInputStreamOperator<OUT>>- Parameters:
metadata- Meta data for about this checkpointoptions- Options for performing this checkpoint- Returns:
- future with value of
falseif the checkpoint was not carried out,trueotherwise
-
getCanEmitBatchOfRecords
public StreamTask.CanEmitBatchOfRecordsChecker getCanEmitBatchOfRecords()
- Overrides:
getCanEmitBatchOfRecordsin classStreamTask<OUT,MultipleInputStreamOperator<OUT>>
-
triggerCheckpointOnBarrier
public void triggerCheckpointOnBarrier(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions, CheckpointMetricsBuilder checkpointMetrics) throws IOException
Description copied from interface:CheckpointableTaskThis method is called when a checkpoint is triggered as a result of receiving checkpoint barriers on all input streams.- Specified by:
triggerCheckpointOnBarrierin interfaceCheckpointableTask- Overrides:
triggerCheckpointOnBarrierin 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 IOExceptionDescription copied from interface:CheckpointableTaskAborts a checkpoint as the result of receiving possibly some checkpoint barriers, but at least oneCancelCheckpointMarker.This requires implementing tasks to forward a
CancelCheckpointMarkerto their outputs.- Specified by:
abortCheckpointOnBarrierin interfaceCheckpointableTask- Overrides:
abortCheckpointOnBarrierin 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 ExceptionDescription copied from class:StreamTaskEmits theMAX_WATERMARKso 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:
advanceToEndOfEventTimein classStreamTask<OUT,MultipleInputStreamOperator<OUT>>- Throws:
Exception
-
-