OUT- Type of the output elements of this source.
SRC- Type of the source function for the stream source operator
OP- Type of the stream source operator
@Internal public class SourceStreamTask<OUT,SRC extends SourceFunction<OUT>,OP extends StreamSource<OUT,SRC>> extends StreamTask<OUT,OP>
StreamTaskfor executing a
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 StreamFunction 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.
|Modifier and Type||Method and Description|
This method is called to trigger a checkpoint, asynchronously by the checkpoint coordinator.
abortCheckpointOnBarrier, cancel, createCheckpointExceptionHandlerFactory, createStreamRecordWriters, createStreamTaskStateInitializer, finalize, getAccumulatorMap, getAsyncOperationsThreadPool, getCancelables, getCheckpointLock, getCheckpointStorage, getConfiguration, getName, getProcessingTimeService, getStreamStatusMaintainer, handleAsyncException, invoke, isCanceled, isRunning, notifyCheckpointComplete, toString, triggerCheckpointOnBarrier
getCurrentNumberOfSubtasks, getEnvironment, getExecutionConfig, getIndexInSubtaskGroup, getJobConfiguration, getTaskConfiguration, getUserCodeClassLoader
public SourceStreamTask(Environment env)
protected void init()
protected void cleanup()
protected void run() throws Exception
protected void cancelTask() throws Exception
public boolean triggerCheckpoint(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions) throws Exception
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
AbstractInvokable.triggerCheckpointOnBarrier(CheckpointMetaData, CheckpointOptions, CheckpointMetrics)
StreamTask<OUT,OP extends StreamSource<OUT,SRC>>
checkpointMetaData- Meta data for about this checkpoint
checkpointOptions- Options for performing this checkpoint
falseif the checkpoint can not be carried out,
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.