Class FinishedOperatorChain<OUT,OP extends StreamOperator<OUT>>
- java.lang.Object
-
- org.apache.flink.streaming.runtime.tasks.OperatorChain<OUT,OP>
-
- org.apache.flink.streaming.runtime.tasks.FinishedOperatorChain<OUT,OP>
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,BoundedMultiInput
@Internal public class FinishedOperatorChain<OUT,OP extends StreamOperator<OUT>> extends OperatorChain<OUT,OP>
TheOperatorChain
that is used for restoring tasks that areTaskStateManager.isTaskDeployedAsFinished()
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.streaming.runtime.tasks.OperatorChain
OperatorChain.ChainedSource
-
-
Field Summary
-
Fields inherited from class org.apache.flink.streaming.runtime.tasks.OperatorChain
chainedSources, closer, finishedOnRestoreInput, firstOperatorWrapper, isClosed, mainOperatorOutput, mainOperatorWrapper, numOperators, operatorEventDispatcher, streamOutputs, tailOperatorWrapper
-
-
Constructor Summary
Constructors Constructor Description FinishedOperatorChain(StreamTask<OUT,OP> containingTask, RecordWriterDelegate<SerializationDelegate<StreamRecord<OUT>>> recordWriterDelegate)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispatchOperatorEvent(OperatorID operator, SerializedValue<OperatorEvent> event)
void
endInput(int inputId)
Ends the main operator input specified byinputId
).void
finishOperators(StreamTaskActionExecutor actionExecutor, StopMode stopMode)
Closes all operators in a chain effect way.WatermarkGaugeExposingOutput<StreamRecord<OUT>>
getMainOperatorOutput()
void
initializeStateAndOpenOperators(StreamTaskStateInitializer streamTaskStateInitializer)
Initialize state and open all operators in the chain from tail to heads, contrary toStreamOperator.close()
which happens heads to tail (seeOperatorChain.finishOperators(StreamTaskActionExecutor, StopMode)
).boolean
isClosed()
boolean
isTaskDeployedAsFinished()
void
notifyCheckpointAborted(long checkpointId)
void
notifyCheckpointComplete(long checkpointId)
void
notifyCheckpointSubsumed(long checkpointId)
void
prepareSnapshotPreBarrier(long checkpointId)
void
snapshotState(Map<OperatorID,OperatorSnapshotFutures> operatorSnapshotsInProgress, CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions, Supplier<Boolean> isRunning, ChannelStateWriter.ChannelStateWriteResult channelStateWriteResult, CheckpointStreamFactory storage)
-
Methods inherited from class org.apache.flink.streaming.runtime.tasks.OperatorChain
abortCheckpoint, alignedBarrierTimeout, broadcastEvent, broadcastEvent, close, closeAllOperators, flushOutputs, getAllOperators, getAllOperators, getChainedSource, getChainedSourceOutputs, getFinishedOnRestoreInputOrDefault, getMainOperator, getNumberOfOperators, getOperatorEventDispatcher, getSourceTaskInput, getSourceTaskInputs, getStreamOutputs, getTailOperator, sendAcknowledgeCheckpointEvent, snapshotChannelStates
-
-
-
-
Constructor Detail
-
FinishedOperatorChain
public FinishedOperatorChain(StreamTask<OUT,OP> containingTask, RecordWriterDelegate<SerializationDelegate<StreamRecord<OUT>>> recordWriterDelegate)
-
-
Method Detail
-
isTaskDeployedAsFinished
public boolean isTaskDeployedAsFinished()
- Specified by:
isTaskDeployedAsFinished
in classOperatorChain<OUT,OP extends StreamOperator<OUT>>
-
getMainOperatorOutput
public WatermarkGaugeExposingOutput<StreamRecord<OUT>> getMainOperatorOutput()
- Overrides:
getMainOperatorOutput
in classOperatorChain<OUT,OP extends StreamOperator<OUT>>
-
dispatchOperatorEvent
public void dispatchOperatorEvent(OperatorID operator, SerializedValue<OperatorEvent> event)
- Specified by:
dispatchOperatorEvent
in classOperatorChain<OUT,OP extends StreamOperator<OUT>>
-
prepareSnapshotPreBarrier
public void prepareSnapshotPreBarrier(long checkpointId)
- Specified by:
prepareSnapshotPreBarrier
in classOperatorChain<OUT,OP extends StreamOperator<OUT>>
-
endInput
public void endInput(int inputId) throws Exception
Description copied from class:OperatorChain
Ends the main operator input specified byinputId
).- Specified by:
endInput
in interfaceBoundedMultiInput
- Specified by:
endInput
in classOperatorChain<OUT,OP extends StreamOperator<OUT>>
- Parameters:
inputId
- the input ID starts from 1 which indicates the first input.- Throws:
Exception
-
initializeStateAndOpenOperators
public void initializeStateAndOpenOperators(StreamTaskStateInitializer streamTaskStateInitializer)
Description copied from class:OperatorChain
Initialize state and open all operators in the chain from tail to heads, contrary toStreamOperator.close()
which happens heads to tail (seeOperatorChain.finishOperators(StreamTaskActionExecutor, StopMode)
).- Specified by:
initializeStateAndOpenOperators
in classOperatorChain<OUT,OP extends StreamOperator<OUT>>
-
finishOperators
public void finishOperators(StreamTaskActionExecutor actionExecutor, StopMode stopMode) throws Exception
Description copied from class:OperatorChain
Closes all operators in a chain effect way. Closing happens from heads to tail operator in the chain, contrary toStreamOperator.open()
which happens tail to heads (seeOperatorChain.initializeStateAndOpenOperators(StreamTaskStateInitializer)
).- Specified by:
finishOperators
in classOperatorChain<OUT,OP extends StreamOperator<OUT>>
- Throws:
Exception
-
notifyCheckpointComplete
public void notifyCheckpointComplete(long checkpointId) throws Exception
- Specified by:
notifyCheckpointComplete
in classOperatorChain<OUT,OP extends StreamOperator<OUT>>
- Throws:
Exception
-
notifyCheckpointAborted
public void notifyCheckpointAborted(long checkpointId) throws Exception
- Specified by:
notifyCheckpointAborted
in classOperatorChain<OUT,OP extends StreamOperator<OUT>>
- Throws:
Exception
-
notifyCheckpointSubsumed
public void notifyCheckpointSubsumed(long checkpointId) throws Exception
- Specified by:
notifyCheckpointSubsumed
in classOperatorChain<OUT,OP extends StreamOperator<OUT>>
- Throws:
Exception
-
isClosed
public boolean isClosed()
- Overrides:
isClosed
in classOperatorChain<OUT,OP extends StreamOperator<OUT>>
-
snapshotState
public void snapshotState(Map<OperatorID,OperatorSnapshotFutures> operatorSnapshotsInProgress, CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions, Supplier<Boolean> isRunning, ChannelStateWriter.ChannelStateWriteResult channelStateWriteResult, CheckpointStreamFactory storage) throws Exception
- Specified by:
snapshotState
in classOperatorChain<OUT,OP extends StreamOperator<OUT>>
- Throws:
Exception
-
-