OUT - Type of the output elements of this source.SRC - Type of the source function for the stream source operatorOP - Type of the stream source operator@Internal public class SourceStreamTask<OUT,SRC extends SourceFunction<OUT>,OP extends StreamSource<OUT,SRC>> extends StreamTask<OUT,OP>
StreamTask for executing a StreamSource.
One important aspect of this is that the checkpointing and the emission of elements must never
occur at the same time. The execution must be serial. This is achieved by having the contract
with the SourceFunction that it must only modify its state or emit elements in a
synchronized block that locks on the lock Object. Also, the modification of the state and the
emission of elements must happen in the same block of code that is protected by the synchronized
block.
checkpointStorage, configuration, inputProcessor, LOG, mailboxProcessor, mainOperator, operatorChain, stateBackend, systemTimerService, timerService, TRIGGER_THREAD_GROUP| Constructor and Description |
|---|
SourceStreamTask(org.apache.flink.runtime.execution.Environment env) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
advanceToEndOfEventTime()
Emits the
MAX_WATERMARK so that all registered timers are fired. |
protected void |
cancelTask() |
protected void |
cleanup() |
protected void |
cleanUpInvoke() |
protected void |
declineCheckpoint(long checkpointId) |
protected void |
finishTask()
Instructs the task to go through its normal termination routine, i.e.
|
protected CompletableFuture<Void> |
getCompletionFuture() |
protected void |
init() |
protected void |
processInput(MailboxDefaultAction.Controller controller)
This method implements the default action of the task (e.g.
|
Future<Boolean> |
triggerCheckpointAsync(org.apache.flink.runtime.checkpoint.CheckpointMetaData checkpointMetaData,
org.apache.flink.runtime.checkpoint.CheckpointOptions checkpointOptions) |
abortCheckpointOnBarrier, afterInvoke, cancel, createRecordWriterDelegate, createStreamTaskStateInitializer, dispatchOperatorEvent, finalize, getAsyncCheckpointStartDelayNanos, getAsyncOperationsThreadPool, getCancelables, getCheckpointStorage, getConfiguration, getMailboxExecutorFactory, getName, getProcessingTimeServiceFactory, getStreamStatusMaintainer, handleAsyncException, invoke, isCanceled, isFailing, isMailboxLoopRunning, isRunning, isUsingNonBlockingInput, notifyCheckpointAbortAsync, notifyCheckpointCompleteAsync, restore, runMailboxLoop, runMailboxStep, setupNumRecordsInCounter, toString, triggerCheckpointOnBarrierprotected void init()
init in class StreamTask<OUT,OP extends StreamSource<OUT,SRC>>protected void advanceToEndOfEventTime()
throws Exception
StreamTaskMAX_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.
advanceToEndOfEventTime in class StreamTask<OUT,OP extends StreamSource<OUT,SRC>>Exceptionprotected void cleanup()
cleanup in class StreamTask<OUT,OP extends StreamSource<OUT,SRC>>protected void processInput(MailboxDefaultAction.Controller controller) throws Exception
StreamTaskprocessInput in class StreamTask<OUT,OP extends StreamSource<OUT,SRC>>controller - controller object for collaborative interaction between the action and the
stream task.Exception - on any problems in the action.protected void cleanUpInvoke()
throws Exception
cleanUpInvoke in class StreamTask<OUT,OP extends StreamSource<OUT,SRC>>Exceptionprotected void cancelTask()
cancelTask in class StreamTask<OUT,OP extends StreamSource<OUT,SRC>>protected void finishTask()
StreamTaskStreamOperator.close() and StreamOperator.dispose() on its operators.
This is used by the source task to get out of the run-loop when the job is stopped with a savepoint.
For tasks other than the source task, this method does nothing.
finishTask in class StreamTask<OUT,OP extends StreamSource<OUT,SRC>>protected CompletableFuture<Void> getCompletionFuture()
getCompletionFuture in class StreamTask<OUT,OP extends StreamSource<OUT,SRC>>public Future<Boolean> triggerCheckpointAsync(org.apache.flink.runtime.checkpoint.CheckpointMetaData checkpointMetaData, org.apache.flink.runtime.checkpoint.CheckpointOptions checkpointOptions)
triggerCheckpointAsync in class StreamTask<OUT,OP extends StreamSource<OUT,SRC>>protected void declineCheckpoint(long checkpointId)
declineCheckpoint in class StreamTask<OUT,OP extends StreamSource<OUT,SRC>>Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.