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 operatorSourceFunction
API, which is due to be
removed. Use the new Source
API instead.@Deprecated @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.
StreamTask.CanEmitBatchOfRecordsChecker
checkpointStorage, configuration, inputProcessor, LOG, mailboxProcessor, mainOperator, operatorChain, recordWriter, stateBackend, systemTimerService, timerService, TRIGGER_THREAD_GROUP
Constructor and Description |
---|
SourceStreamTask(Environment env)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected void |
advanceToEndOfEventTime()
Deprecated.
Emits the
MAX_WATERMARK so that all registered timers are fired. |
protected void |
cancelTask()
Deprecated.
|
protected void |
cleanUpInternal()
Deprecated.
|
protected void |
declineCheckpoint(long checkpointId)
Deprecated.
|
protected CompletableFuture<Void> |
getCompletionFuture()
Deprecated.
|
protected void |
init()
Deprecated.
|
void |
maybeInterruptOnCancel(Thread toInterrupt,
String taskName,
Long timeout)
Deprecated.
Checks whether the task should be interrupted during cancellation and if so, execute the
specified
Runnable interruptAction . |
protected void |
processInput(MailboxDefaultAction.Controller controller)
Deprecated.
This method implements the default action of the task (e.g. processing one event from the
input).
|
CompletableFuture<Boolean> |
triggerCheckpointAsync(CheckpointMetaData checkpointMetaData,
CheckpointOptions checkpointOptions)
Deprecated.
This method is called to trigger a checkpoint, asynchronously by the checkpoint coordinator.
|
abortCheckpointOnBarrier, afterInvoke, cancel, cleanUp, createRecordWriterDelegate, createStreamTaskStateInitializer, dispatchOperatorEvent, endData, finalize, getAsyncCheckpointStartDelayNanos, getAsyncOperationsThreadPool, getCancelables, getCanEmitBatchOfRecords, getCheckpointBarrierHandler, getCheckpointStorage, getConfiguration, getEnvironment, getMailboxExecutorFactory, getName, getProcessingTimeServiceFactory, handleAsyncException, hasMail, invoke, isCanceled, isFailing, isMailboxLoopRunning, isRunning, isUsingNonBlockingInput, notifyCheckpointAbortAsync, notifyCheckpointCompleteAsync, notifyCheckpointSubsumedAsync, notifyEndOfData, restore, runMailboxLoop, runMailboxStep, runSingleMailboxLoop, setSynchronousSavepoint, setupNumRecordsInCounter, toString, triggerCheckpointOnBarrier
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getExecutionConfig, getIndexInSubtaskGroup, getJobConfiguration, getUserCodeClassLoader
public SourceStreamTask(Environment env) throws Exception
Exception
protected void init()
init
in class 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
in class StreamTask<OUT,OP extends StreamSource<OUT,SRC>>
Exception
protected void cleanUpInternal()
cleanUpInternal
in class StreamTask<OUT,OP extends StreamSource<OUT,SRC>>
protected void processInput(MailboxDefaultAction.Controller controller) throws Exception
StreamTask
processInput
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 cancelTask()
cancelTask
in class StreamTask<OUT,OP extends StreamSource<OUT,SRC>>
public void maybeInterruptOnCancel(Thread toInterrupt, @Nullable String taskName, @Nullable Long timeout)
TaskInvokable
Runnable interruptAction
.maybeInterruptOnCancel
in interface TaskInvokable
maybeInterruptOnCancel
in class StreamTask<OUT,OP extends StreamSource<OUT,SRC>>
taskName
- optional taskName to log stack tracetimeout
- optional timeout to log stack traceprotected CompletableFuture<Void> getCompletionFuture()
getCompletionFuture
in class StreamTask<OUT,OP extends StreamSource<OUT,SRC>>
public CompletableFuture<Boolean> triggerCheckpointAsync(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions)
CheckpointableTask
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.
triggerCheckpointAsync
in interface CheckpointableTask
triggerCheckpointAsync
in class StreamTask<OUT,OP extends StreamSource<OUT,SRC>>
checkpointMetaData
- Meta data for about this checkpointcheckpointOptions
- Options for performing this checkpointfalse
if the checkpoint was not carried out, true
otherwiseprotected void declineCheckpoint(long checkpointId)
declineCheckpoint
in class StreamTask<OUT,OP extends StreamSource<OUT,SRC>>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.