public abstract class AbstractBroadcastWrapperOperator<T,S extends org.apache.flink.streaming.api.operators.StreamOperator<T>> extends Object implements org.apache.flink.streaming.api.operators.StreamOperator<T>, org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.CheckpointedStreamOperator
Modifier and Type | Field and Description |
---|---|
protected String[] |
broadcastStreamNames
variables specific for withBroadcast functionality.
|
protected boolean |
broadcastVariablesReady
whether all broadcast variables of this operator are ready.
|
protected org.apache.flink.streaming.runtime.tasks.StreamTask<?,?> |
containingTask |
protected DataCacheWriter[] |
dataCacheWriters
DataCacheWriter for each input.
|
protected boolean[] |
hasPendingElements
whether each input has pending elements.
|
protected int |
indexOfSubtask
index of this subtask.
|
protected org.apache.flink.api.common.typeinfo.TypeInformation<?>[] |
inTypes
type information of each input.
|
protected boolean[] |
isBlocked
whether each input is blocked.
|
protected org.apache.flink.api.common.operators.MailboxExecutor |
mailboxExecutor |
protected org.apache.flink.metrics.groups.OperatorMetricGroup |
metrics |
protected int |
numInputs
number of the inputs of this operator.
|
protected org.apache.flink.streaming.api.operators.StreamOperatorFactory<T> |
operatorFactory |
protected org.apache.flink.streaming.api.operators.Output<org.apache.flink.streaming.runtime.streamrecord.StreamRecord<T>> |
output |
protected org.apache.flink.streaming.api.operators.StreamOperatorParameters<T> |
parameters |
protected org.apache.flink.streaming.api.operators.StreamOperatorStateHandler |
stateHandler |
protected org.apache.flink.streaming.api.graph.StreamConfig |
streamConfig |
protected org.apache.flink.streaming.api.operators.InternalTimeServiceManager<?> |
timeServiceManager |
protected S |
wrappedOperator |
Modifier and Type | Method and Description |
---|---|
protected boolean |
areBroadcastVariablesReady()
checks whether all of broadcast variables are ready.
|
void |
close() |
protected void |
endInputX(int inputIndex,
org.apache.flink.util.function.ThrowingConsumer<org.apache.flink.streaming.runtime.streamrecord.StreamRecord,Exception> elementConsumer,
org.apache.flink.util.function.ThrowingConsumer<org.apache.flink.streaming.api.watermark.Watermark,Exception> watermarkConsumer)
extracts common processing logic in subclasses' endInput(...).
|
void |
finish() |
Object |
getCurrentKey() |
org.apache.flink.metrics.groups.OperatorMetricGroup |
getMetricGroup() |
org.apache.flink.runtime.jobgraph.OperatorID |
getOperatorID() |
void |
initializeState(org.apache.flink.runtime.state.StateInitializationContext stateInitializationContext) |
void |
initializeState(org.apache.flink.streaming.api.operators.StreamTaskStateInitializer streamTaskStateManager) |
void |
notifyCheckpointAborted(long checkpointId) |
void |
notifyCheckpointComplete(long checkpointId) |
void |
open() |
void |
prepareSnapshotPreBarrier(long checkpointId) |
protected void |
processElementX(org.apache.flink.streaming.runtime.streamrecord.StreamRecord streamRecord,
int inputIndex,
org.apache.flink.util.function.ThrowingConsumer<org.apache.flink.streaming.runtime.streamrecord.StreamRecord,Exception> elementConsumer,
org.apache.flink.util.function.ThrowingConsumer<org.apache.flink.streaming.api.watermark.Watermark,Exception> watermarkConsumer)
extracts common processing logic in subclasses' processing elements.
|
protected void |
processWatermarkX(org.apache.flink.streaming.api.watermark.Watermark watermark,
int inputIndex,
org.apache.flink.util.function.ThrowingConsumer<org.apache.flink.streaming.runtime.streamrecord.StreamRecord,Exception> elementConsumer,
org.apache.flink.util.function.ThrowingConsumer<org.apache.flink.streaming.api.watermark.Watermark,Exception> watermarkConsumer)
extracts common processing logic in subclasses' processing watermarks.
|
void |
setCurrentKey(Object key) |
void |
setKeyContextElement1(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<?> record) |
void |
setKeyContextElement2(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<?> record) |
org.apache.flink.streaming.api.operators.OperatorSnapshotFutures |
snapshotState(long checkpointId,
long timestamp,
org.apache.flink.runtime.checkpoint.CheckpointOptions checkpointOptions,
org.apache.flink.runtime.state.CheckpointStreamFactory storageLocation) |
void |
snapshotState(org.apache.flink.runtime.state.StateSnapshotContext stateSnapshotContext) |
protected final org.apache.flink.streaming.api.operators.StreamOperatorParameters<T> parameters
protected final org.apache.flink.streaming.api.graph.StreamConfig streamConfig
protected final org.apache.flink.streaming.runtime.tasks.StreamTask<?,?> containingTask
protected final org.apache.flink.streaming.api.operators.Output<org.apache.flink.streaming.runtime.streamrecord.StreamRecord<T>> output
protected final org.apache.flink.streaming.api.operators.StreamOperatorFactory<T> operatorFactory
protected final org.apache.flink.metrics.groups.OperatorMetricGroup metrics
protected final S extends org.apache.flink.streaming.api.operators.StreamOperator<T> wrappedOperator
protected transient org.apache.flink.streaming.api.operators.StreamOperatorStateHandler stateHandler
protected transient org.apache.flink.streaming.api.operators.InternalTimeServiceManager<?> timeServiceManager
protected final org.apache.flink.api.common.operators.MailboxExecutor mailboxExecutor
protected final String[] broadcastStreamNames
protected final boolean[] isBlocked
protected final org.apache.flink.api.common.typeinfo.TypeInformation<?>[] inTypes
protected boolean broadcastVariablesReady
protected final transient int indexOfSubtask
protected final int numInputs
protected DataCacheWriter[] dataCacheWriters
protected boolean[] hasPendingElements
protected boolean areBroadcastVariablesReady()
BroadcastContext.isCacheFinished(...)
repeatedly. Finally, it sets broadcast variables for {wrappedOperatorRuntimeContext} if the
broadcast variables are ready.protected void processElementX(org.apache.flink.streaming.runtime.streamrecord.StreamRecord streamRecord, int inputIndex, org.apache.flink.util.function.ThrowingConsumer<org.apache.flink.streaming.runtime.streamrecord.StreamRecord,Exception> elementConsumer, org.apache.flink.util.function.ThrowingConsumer<org.apache.flink.streaming.api.watermark.Watermark,Exception> watermarkConsumer) throws Exception
streamRecord
- the input record.inputIndex
- input id, starts from zero.elementConsumer
- the consumer function of StreamRecord, i.e.,
operator.processElement(...).watermarkConsumer
- the consumer function of WaterMark, i.e.,
operator.processWatermark(...).Exception
- possible exception.protected void processWatermarkX(org.apache.flink.streaming.api.watermark.Watermark watermark, int inputIndex, org.apache.flink.util.function.ThrowingConsumer<org.apache.flink.streaming.runtime.streamrecord.StreamRecord,Exception> elementConsumer, org.apache.flink.util.function.ThrowingConsumer<org.apache.flink.streaming.api.watermark.Watermark,Exception> watermarkConsumer) throws Exception
watermark
- the input watermark.inputIndex
- input id, starts from zero.elementConsumer
- the consumer function of StreamRecord, i.e.,
operator.processElement(...).watermarkConsumer
- the consumer function of WaterMark, i.e.,
operator.processWatermark(...).Exception
- possible exception.protected void endInputX(int inputIndex, org.apache.flink.util.function.ThrowingConsumer<org.apache.flink.streaming.runtime.streamrecord.StreamRecord,Exception> elementConsumer, org.apache.flink.util.function.ThrowingConsumer<org.apache.flink.streaming.api.watermark.Watermark,Exception> watermarkConsumer) throws Exception
inputIndex
- input id, starts from zero.elementConsumer
- the consumer function of StreamRecord, i.e.,
operator.processElement(...).watermarkConsumer
- the consumer function of WaterMark, i.e.,
operator.processWatermark(...).Exception
- possible exception.public void open() throws Exception
public void close() throws Exception
public void finish() throws Exception
public void prepareSnapshotPreBarrier(long checkpointId) throws Exception
public void initializeState(org.apache.flink.streaming.api.operators.StreamTaskStateInitializer streamTaskStateManager) throws Exception
public org.apache.flink.streaming.api.operators.OperatorSnapshotFutures snapshotState(long checkpointId, long timestamp, org.apache.flink.runtime.checkpoint.CheckpointOptions checkpointOptions, org.apache.flink.runtime.state.CheckpointStreamFactory storageLocation) throws Exception
public void initializeState(org.apache.flink.runtime.state.StateInitializationContext stateInitializationContext) throws Exception
initializeState
in interface org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.CheckpointedStreamOperator
Exception
public void snapshotState(org.apache.flink.runtime.state.StateSnapshotContext stateSnapshotContext) throws Exception
snapshotState
in interface org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.CheckpointedStreamOperator
Exception
public void setKeyContextElement1(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<?> record) throws Exception
public void setKeyContextElement2(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<?> record) throws Exception
public org.apache.flink.metrics.groups.OperatorMetricGroup getMetricGroup()
getMetricGroup
in interface org.apache.flink.streaming.api.operators.StreamOperator<T>
public org.apache.flink.runtime.jobgraph.OperatorID getOperatorID()
getOperatorID
in interface org.apache.flink.streaming.api.operators.StreamOperator<T>
public void notifyCheckpointComplete(long checkpointId) throws Exception
notifyCheckpointComplete
in interface org.apache.flink.api.common.state.CheckpointListener
Exception
public void notifyCheckpointAborted(long checkpointId) throws Exception
notifyCheckpointAborted
in interface org.apache.flink.api.common.state.CheckpointListener
Exception
public void setCurrentKey(Object key)
setCurrentKey
in interface org.apache.flink.streaming.api.operators.KeyContext
public Object getCurrentKey()
getCurrentKey
in interface org.apache.flink.streaming.api.operators.KeyContext
Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.