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
构造器和说明 |
---|
SourceStreamTask(org.apache.flink.runtime.execution.Environment env) |
限定符和类型 | 方法和说明 |
---|---|
protected void |
advanceToEndOfEventTime()
Emits the
MAX_WATERMARK so that all registered timers are fired. |
protected void |
cancelTask() |
protected void |
cleanUpInternal() |
protected void |
declineCheckpoint(long checkpointId) |
protected void |
finishTask()
Instructs the task to go through its normal termination routine, i.e. exit the run-loop and
call
StreamOperator.finish() and StreamOperator.close() on its operators. |
protected CompletableFuture<Void> |
getCompletionFuture() |
protected void |
init() |
protected void |
processInput(MailboxDefaultAction.Controller controller)
This method implements the default action of the task (e.g. processing one event from the
input).
|
CompletableFuture<Boolean> |
triggerCheckpointAsync(org.apache.flink.runtime.checkpoint.CheckpointMetaData checkpointMetaData,
org.apache.flink.runtime.checkpoint.CheckpointOptions checkpointOptions) |
abortCheckpointOnBarrier, afterInvoke, assertTriggeringCheckpointExceptions, cancel, cleanUp, createRecordWriterDelegate, createStreamTaskStateInitializer, dispatchOperatorEvent, endData, finalize, getAsyncCheckpointStartDelayNanos, getAsyncOperationsThreadPool, getCancelables, getCheckpointBarrierHandler, getCheckpointStorage, getConfiguration, getEnvironment, getMailboxExecutorFactory, getName, getProcessingTimeServiceFactory, handleAsyncException, invoke, isCanceled, isFailing, isMailboxLoopRunning, isRunning, isUsingNonBlockingInput, maybeInterruptOnCancel, notifyCheckpointAbortAsync, notifyCheckpointCompleteAsync, restore, runMailboxLoop, runMailboxStep, setSynchronousSavepoint, setupNumRecordsInCounter, toString, triggerCheckpointOnBarrier
getExecutionConfig, getIndexInSubtaskGroup, getJobConfiguration, getUserCodeClassLoader
protected void init()
init
在类中 StreamTask<OUT,OP extends StreamSource<OUT,SRC>>
protected void advanceToEndOfEventTime() throws Exception
StreamTask
MAX_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
在类中 StreamTask<OUT,OP extends StreamSource<OUT,SRC>>
Exception
protected void cleanUpInternal()
cleanUpInternal
在类中 StreamTask<OUT,OP extends StreamSource<OUT,SRC>>
protected void processInput(MailboxDefaultAction.Controller controller) throws Exception
StreamTask
processInput
在类中 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 cancelTask()
cancelTask
在类中 StreamTask<OUT,OP extends StreamSource<OUT,SRC>>
protected void finishTask()
StreamTask
StreamOperator.finish()
and StreamOperator.close()
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
在类中 StreamTask<OUT,OP extends StreamSource<OUT,SRC>>
protected CompletableFuture<Void> getCompletionFuture()
getCompletionFuture
在类中 StreamTask<OUT,OP extends StreamSource<OUT,SRC>>
public CompletableFuture<Boolean> triggerCheckpointAsync(org.apache.flink.runtime.checkpoint.CheckpointMetaData checkpointMetaData, org.apache.flink.runtime.checkpoint.CheckpointOptions checkpointOptions)
triggerCheckpointAsync
在接口中 org.apache.flink.runtime.jobgraph.tasks.CheckpointableTask
triggerCheckpointAsync
在类中 StreamTask<OUT,OP extends StreamSource<OUT,SRC>>
protected void declineCheckpoint(long checkpointId)
declineCheckpoint
在类中 StreamTask<OUT,OP extends StreamSource<OUT,SRC>>
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.