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.| 限定符和类型 | 类和说明 |
|---|---|
static interface |
OperatorChain.WatermarkGaugeExposingOutput<T>
An
Output that measures the last emitted watermark with a WatermarkGauge. |
| 构造器和说明 |
|---|
OperatorChain(StreamTask<OUT,OP> containingTask,
org.apache.flink.runtime.io.network.api.writer.RecordWriterDelegate<org.apache.flink.runtime.plugable.SerializationDelegate<StreamRecord<OUT>>> recordWriterDelegate) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
broadcastEvent(org.apache.flink.runtime.event.AbstractEvent event) |
void |
broadcastEvent(org.apache.flink.runtime.event.AbstractEvent event,
boolean isPriorityEvent) |
protected void |
closeOperators(StreamTaskActionExecutor actionExecutor)
Closes all operators in a chain effect way.
|
void |
dispatchOperatorEvent(org.apache.flink.runtime.jobgraph.OperatorID operator,
org.apache.flink.util.SerializedValue<org.apache.flink.runtime.operators.coordination.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() |
org.apache.flink.runtime.operators.coordination.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, org.apache.flink.runtime.io.network.api.writer.RecordWriterDelegate<org.apache.flink.runtime.plugable.SerializationDelegate<StreamRecord<OUT>>> recordWriterDelegate)
public StreamStatus getStreamStatus()
StreamStatusProvidergetStreamStatus 在接口中 StreamStatusProviderpublic org.apache.flink.runtime.operators.coordination.OperatorEventDispatcher getOperatorEventDispatcher()
public void dispatchOperatorEvent(org.apache.flink.runtime.jobgraph.OperatorID operator,
org.apache.flink.util.SerializedValue<org.apache.flink.runtime.operators.coordination.OperatorEvent> event)
throws org.apache.flink.util.FlinkException
org.apache.flink.util.FlinkExceptionpublic void toggleStreamStatus(StreamStatus status)
StreamStatusMaintainertoggleStreamStatus 在接口中 StreamStatusMaintainerstatus - the new status to toggle topublic void broadcastEvent(org.apache.flink.runtime.event.AbstractEvent event)
throws IOException
IOExceptionpublic void broadcastEvent(org.apache.flink.runtime.event.AbstractEvent event,
boolean isPriorityEvent)
throws IOException
IOExceptionpublic void prepareSnapshotPreBarrier(long checkpointId)
throws Exception
Exceptionpublic void endHeadOperatorInput(int inputId)
throws Exception
inputId).inputId - the input ID starts from 1 which indicates the first input.Exceptionprotected void initializeStateAndOpenOperators(StreamTaskStateInitializer streamTaskStateInitializer) throws Exception
StreamOperator.close() which happens head to tail (see closeOperators(StreamTaskActionExecutor)).Exceptionprotected void closeOperators(StreamTaskActionExecutor actionExecutor) throws Exception
StreamOperator.open() which happens tail to head
(see initializeStateAndOpenOperators(StreamTaskStateInitializer)).Exceptionpublic 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.