Class SourceOperatorStreamTask<T>
java.lang.Object
org.apache.flink.streaming.runtime.tasks.StreamTask<T,SourceOperator<T,?>>
org.apache.flink.streaming.runtime.tasks.SourceOperatorStreamTask<T>
- All Implemented Interfaces:
CheckpointableTask,CoordinatedTask,TaskInvokable,AsyncExceptionHandler,ContainingTaskDetails
A subclass of
StreamTask for executing the SourceOperator.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classImplementation ofPushingAsyncDataInput.DataOutputthat wraps a specificOutput.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 -
Method Summary
Modifier and TypeMethodDescriptionprotected voidEmits theMAX_WATERMARKso that all registered timers are fired.protected voiddeclineCheckpoint(long checkpointId) voidinit()notifyCheckpointAbortAsync(long checkpointId, long latestCompletedCheckpointId) Invoked when a checkpoint has been aborted, i.e., when the checkpoint coordinator has received a decline message from one task and try to abort the targeted checkpoint by notification.notifyCheckpointSubsumedAsync(long checkpointId) Invoked when a checkpoint has been subsumed, i.e., when the checkpoint coordinator has confirmed one checkpoint has been finished, and try to remove the first previous checkpoint.triggerCheckpointAsync(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions) This method is called to trigger a checkpoint, asynchronously by the checkpoint coordinator.Methods inherited from class org.apache.flink.streaming.runtime.tasks.StreamTask
abortCheckpointOnBarrier, afterInvoke, cancel, cancelTask, cleanUp, cleanUpInternal, createRecordWriterDelegate, createStreamTaskStateInitializer, dispatchOperatorEvent, endData, finalize, getAsyncCheckpointStartDelayNanos, getAsyncOperationsThreadPool, getCancelables, getCanEmitBatchOfRecords, getCheckpointBarrierHandler, getCheckpointStorage, getCompletionFuture, getConfiguration, getEnvironment, getMailboxExecutorFactory, getName, getProcessingTimeServiceFactory, handleAsyncException, hasMail, invoke, isCanceled, isFailing, isMailboxLoopRunning, isRunning, isUsingNonBlockingInput, maybeInterruptOnCancel, notifyCheckpointCompleteAsync, notifyEndOfData, processInput, restore, runMailboxLoop, runMailboxStep, runSingleMailboxLoop, setSynchronousSavepoint, setupNumRecordsInCounter, toString, triggerCheckpointOnBarrierMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.flink.streaming.runtime.tasks.ContainingTaskDetails
getExecutionConfig, getIndexInSubtaskGroup, getJobConfiguration, getUserCodeClassLoader
-
Constructor Details
-
SourceOperatorStreamTask
- Throws:
Exception
-
-
Method Details
-
init
- Specified by:
initin classStreamTask<T,SourceOperator<T, ?>> - Throws:
Exception
-
triggerCheckpointAsync
public CompletableFuture<Boolean> triggerCheckpointAsync(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions) 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<T,SourceOperator<T, ?>> - Parameters:
checkpointMetaData- Meta data for about this checkpointcheckpointOptions- Options for performing this checkpoint- Returns:
- future with value of
falseif the checkpoint was not carried out,trueotherwise
-
advanceToEndOfEventTime
protected void advanceToEndOfEventTime()Description 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<T,SourceOperator<T, ?>>
-
declineCheckpoint
protected void declineCheckpoint(long checkpointId) - Overrides:
declineCheckpointin classStreamTask<T,SourceOperator<T, ?>>
-
notifyCheckpointAbortAsync
Description copied from interface:CheckpointableTaskInvoked when a checkpoint has been aborted, i.e., when the checkpoint coordinator has received a decline message from one task and try to abort the targeted checkpoint by notification.- Specified by:
notifyCheckpointAbortAsyncin interfaceCheckpointableTask- Overrides:
notifyCheckpointAbortAsyncin classStreamTask<T,SourceOperator<T, ?>> - Parameters:
checkpointId- The ID of the checkpoint that is aborted.latestCompletedCheckpointId- The ID of the latest completed checkpoint.- Returns:
- future that completes when the notification has been processed by the task.
-
notifyCheckpointSubsumedAsync
Description copied from interface:CheckpointableTaskInvoked when a checkpoint has been subsumed, i.e., when the checkpoint coordinator has confirmed one checkpoint has been finished, and try to remove the first previous checkpoint.- Specified by:
notifyCheckpointSubsumedAsyncin interfaceCheckpointableTask- Overrides:
notifyCheckpointSubsumedAsyncin classStreamTask<T,SourceOperator<T, ?>> - Parameters:
checkpointId- The ID of the checkpoint that is subsumed.- Returns:
- future that completes when the notification has been processed by the task.
-