Class SourceStreamTask<OUT,SRC extends SourceFunction<OUT>,OP extends StreamSource<OUT,SRC>>
- java.lang.Object
-
- org.apache.flink.streaming.runtime.tasks.StreamTask<OUT,OP>
-
- org.apache.flink.streaming.runtime.tasks.SourceStreamTask<OUT,SRC,OP>
-
- Type Parameters:
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
- All Implemented Interfaces:
CheckpointableTask,CoordinatedTask,TaskInvokable,AsyncExceptionHandler,ContainingTaskDetails
@Deprecated @Internal public class SourceStreamTask<OUT,SRC extends SourceFunction<OUT>,OP extends StreamSource<OUT,SRC>> extends StreamTask<OUT,OP>
Deprecated.This class is based on theSourceFunctionAPI, which is due to be removed. Use the newSourceAPI instead.StreamTaskfor executing aStreamSource.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
SourceFunctionthat 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.
-
-
Nested Class Summary
-
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 Constructor Description SourceStreamTask(Environment env)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidadvanceToEndOfEventTime()Deprecated.Emits theMAX_WATERMARKso that all registered timers are fired.protected voidcancelTask()Deprecated.protected voidcleanUpInternal()Deprecated.protected voiddeclineCheckpoint(long checkpointId)Deprecated.protected CompletableFuture<Void>getCompletionFuture()Deprecated.protected voidinit()Deprecated.voidmaybeInterruptOnCancel(Thread toInterrupt, String taskName, Long timeout)Deprecated.Checks whether the task should be interrupted during cancellation and if so, execute the specifiedRunnable interruptAction.protected voidprocessInput(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.-
Methods inherited from class org.apache.flink.streaming.runtime.tasks.StreamTask
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
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.flink.streaming.runtime.tasks.ContainingTaskDetails
getExecutionConfig, getIndexInSubtaskGroup, getJobConfiguration, getUserCodeClassLoader
-
-
-
-
Constructor Detail
-
SourceStreamTask
public SourceStreamTask(Environment env) throws Exception
Deprecated.- Throws:
Exception
-
-
Method Detail
-
init
protected void init()
Deprecated.- Specified by:
initin classStreamTask<OUT,OP extends StreamSource<OUT,SRC>>
-
advanceToEndOfEventTime
protected void advanceToEndOfEventTime() throws ExceptionDeprecated.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<OUT,OP extends StreamSource<OUT,SRC>>- Throws:
Exception
-
cleanUpInternal
protected void cleanUpInternal()
Deprecated.- Overrides:
cleanUpInternalin classStreamTask<OUT,OP extends StreamSource<OUT,SRC>>
-
processInput
protected void processInput(MailboxDefaultAction.Controller controller) throws Exception
Deprecated.Description copied from class:StreamTaskThis method implements the default action of the task (e.g. processing one event from the input). Implementations should (in general) be non-blocking.- Overrides:
processInputin classStreamTask<OUT,OP extends StreamSource<OUT,SRC>>- Parameters:
controller- controller object for collaborative interaction between the action and the stream task.- Throws:
Exception- on any problems in the action.
-
cancelTask
protected void cancelTask()
Deprecated.- Overrides:
cancelTaskin classStreamTask<OUT,OP extends StreamSource<OUT,SRC>>
-
maybeInterruptOnCancel
public void maybeInterruptOnCancel(Thread toInterrupt, @Nullable String taskName, @Nullable Long timeout)
Deprecated.Description copied from interface:TaskInvokableChecks whether the task should be interrupted during cancellation and if so, execute the specifiedRunnable interruptAction.- Specified by:
maybeInterruptOnCancelin interfaceTaskInvokable- Overrides:
maybeInterruptOnCancelin classStreamTask<OUT,OP extends StreamSource<OUT,SRC>>taskName- optional taskName to log stack tracetimeout- optional timeout to log stack trace
-
getCompletionFuture
protected CompletableFuture<Void> getCompletionFuture()
Deprecated.- Overrides:
getCompletionFuturein classStreamTask<OUT,OP extends StreamSource<OUT,SRC>>
-
triggerCheckpointAsync
public CompletableFuture<Boolean> triggerCheckpointAsync(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions)
Deprecated.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<OUT,OP extends StreamSource<OUT,SRC>>- 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
-
declineCheckpoint
protected void declineCheckpoint(long checkpointId)
Deprecated.- Overrides:
declineCheckpointin classStreamTask<OUT,OP extends StreamSource<OUT,SRC>>
-
-