OUT
- The type of elements accepted by the chain, i.e., the input type of the chain's head
operator.@Internal public class OperatorChain<OUT,OP extends StreamOperator<OUT>> extends Object implements StreamStatusMaintainer
OperatorChain
contains all operators that are executed as one chain within a single
StreamTask
.Modifier and Type | Class and Description |
---|---|
static interface |
OperatorChain.WatermarkGaugeExposingOutput<T>
An
Output that measures the last emitted watermark with a WatermarkGauge . |
Constructor and Description |
---|
OperatorChain(StreamTask<OUT,OP> containingTask,
RecordWriterDelegate<SerializationDelegate<StreamRecord<OUT>>> recordWriterDelegate) |
Modifier and Type | Method and Description |
---|---|
void |
broadcastEvent(AbstractEvent event) |
void |
broadcastEvent(AbstractEvent event,
boolean isPriorityEvent) |
protected void |
closeOperators(StreamTaskActionExecutor actionExecutor)
Closes all operators in a chain effect way.
|
void |
dispatchOperatorEvent(OperatorID operator,
SerializedValue<OperatorEvent> event) |
void |
endHeadOperatorInput(int inputId)
Ends the head operator input specified by
inputId ). |
void |
flushOutputs()
This method should be called before finishing the record emission, to make sure any data that
is still buffered will be sent.
|
Iterable<StreamOperatorWrapper<?,?>> |
getAllOperators()
Returns an
Iterable which traverses all operators in forward topological order. |
Iterable<StreamOperatorWrapper<?,?>> |
getAllOperators(boolean reverse)
Returns an
Iterable which traverses all operators in forward or reverse topological
order. |
OperatorChain.WatermarkGaugeExposingOutput<StreamRecord<OUT>> |
getChainEntryPoint() |
OP |
getHeadOperator() |
int |
getNumberOfOperators() |
OperatorEventDispatcher |
getOperatorEventDispatcher() |
RecordWriterOutput<?>[] |
getStreamOutputs() |
StreamStatus |
getStreamStatus()
Returns the current stream status.
|
protected void |
initializeStateAndOpenOperators(StreamTaskStateInitializer streamTaskStateInitializer)
Initialize state and open all operators in the chain from tail to head, contrary to
StreamOperator.close() which happens head to tail (see closeOperators(StreamTaskActionExecutor) ). |
void |
prepareSnapshotPreBarrier(long checkpointId) |
void |
releaseOutputs()
This method releases all resources of the record writer output.
|
void |
setIgnoreEndOfInput(boolean ignoreEndOfInput) |
void |
toggleStreamStatus(StreamStatus status)
Toggles the current stream status.
|
public OperatorChain(StreamTask<OUT,OP> containingTask, RecordWriterDelegate<SerializationDelegate<StreamRecord<OUT>>> recordWriterDelegate)
public StreamStatus getStreamStatus()
StreamStatusProvider
getStreamStatus
in interface StreamStatusProvider
public OperatorEventDispatcher getOperatorEventDispatcher()
public void dispatchOperatorEvent(OperatorID operator, SerializedValue<OperatorEvent> event) throws FlinkException
FlinkException
public void toggleStreamStatus(StreamStatus status)
StreamStatusMaintainer
toggleStreamStatus
in interface StreamStatusMaintainer
status
- the new status to toggle topublic void broadcastEvent(AbstractEvent event) throws IOException
IOException
public void broadcastEvent(AbstractEvent event, boolean isPriorityEvent) throws IOException
IOException
public void prepareSnapshotPreBarrier(long checkpointId) throws Exception
Exception
public void endHeadOperatorInput(int inputId) throws Exception
inputId
).inputId
- the input ID starts from 1 which indicates the first input.Exception
protected void initializeStateAndOpenOperators(StreamTaskStateInitializer streamTaskStateInitializer) throws Exception
StreamOperator.close()
which happens head to tail (see closeOperators(StreamTaskActionExecutor)
).Exception
protected void closeOperators(StreamTaskActionExecutor actionExecutor) throws Exception
StreamOperator.open()
which happens tail to head
(see initializeStateAndOpenOperators(StreamTaskStateInitializer)
).Exception
public RecordWriterOutput<?>[] getStreamOutputs()
public Iterable<StreamOperatorWrapper<?,?>> getAllOperators()
Iterable
which traverses all operators in forward topological order.public Iterable<StreamOperatorWrapper<?,?>> getAllOperators(boolean reverse)
Iterable
which traverses all operators in forward or reverse topological
order.public int getNumberOfOperators()
public OperatorChain.WatermarkGaugeExposingOutput<StreamRecord<OUT>> getChainEntryPoint()
public void flushOutputs() throws IOException
IOException
- Thrown, if the buffered data cannot be pushed into the output streams.public void releaseOutputs()
This method should never fail.
public void setIgnoreEndOfInput(boolean ignoreEndOfInput)
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.