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 theSourceFunction
API, which is due to be removed. Use the newSource
API instead.StreamTask
for 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
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.
-
-
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 void
advanceToEndOfEventTime()
Deprecated.Emits theMAX_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 specifiedRunnable 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.-
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:
init
in classStreamTask<OUT,OP extends StreamSource<OUT,SRC>>
-
advanceToEndOfEventTime
protected void advanceToEndOfEventTime() throws Exception
Deprecated.Description copied from class:StreamTask
Emits theMAX_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.
- Overrides:
advanceToEndOfEventTime
in classStreamTask<OUT,OP extends StreamSource<OUT,SRC>>
- Throws:
Exception
-
cleanUpInternal
protected void cleanUpInternal()
Deprecated.- Overrides:
cleanUpInternal
in classStreamTask<OUT,OP extends StreamSource<OUT,SRC>>
-
processInput
protected void processInput(MailboxDefaultAction.Controller controller) throws Exception
Deprecated.Description copied from class:StreamTask
This method implements the default action of the task (e.g. processing one event from the input). Implementations should (in general) be non-blocking.- Overrides:
processInput
in 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:
cancelTask
in classStreamTask<OUT,OP extends StreamSource<OUT,SRC>>
-
maybeInterruptOnCancel
public void maybeInterruptOnCancel(Thread toInterrupt, @Nullable String taskName, @Nullable Long timeout)
Deprecated.Description copied from interface:TaskInvokable
Checks whether the task should be interrupted during cancellation and if so, execute the specifiedRunnable interruptAction
.- Specified by:
maybeInterruptOnCancel
in interfaceTaskInvokable
- Overrides:
maybeInterruptOnCancel
in 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:
getCompletionFuture
in classStreamTask<OUT,OP extends StreamSource<OUT,SRC>>
-
triggerCheckpointAsync
public CompletableFuture<Boolean> triggerCheckpointAsync(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions)
Deprecated.Description copied from interface:CheckpointableTask
This 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:
triggerCheckpointAsync
in interfaceCheckpointableTask
- Overrides:
triggerCheckpointAsync
in 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
false
if the checkpoint was not carried out,true
otherwise
-
declineCheckpoint
protected void declineCheckpoint(long checkpointId)
Deprecated.- Overrides:
declineCheckpoint
in classStreamTask<OUT,OP extends StreamSource<OUT,SRC>>
-
-