Class AbstractPythonFunctionOperator<OUT>
java.lang.Object
org.apache.flink.streaming.api.operators.AbstractStreamOperator<OUT>
org.apache.flink.streaming.api.operators.python.AbstractPythonFunctionOperator<OUT>
- All Implemented Interfaces:
Serializable,org.apache.flink.api.common.state.CheckpointListener,org.apache.flink.streaming.api.operators.KeyContext,org.apache.flink.streaming.api.operators.KeyContextHandler,org.apache.flink.streaming.api.operators.StreamOperator<OUT>,org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.CheckpointedStreamOperator,org.apache.flink.streaming.api.operators.YieldingOperator<OUT>
- Direct Known Subclasses:
AbstractEmbeddedPythonFunctionOperator,AbstractExternalPythonFunctionOperator,DelegateOperatorTransformation.DelegateOperator
@Internal
public abstract class AbstractPythonFunctionOperator<OUT>
extends org.apache.flink.streaming.api.operators.AbstractStreamOperator<OUT>
Base class for all stream operators to execute Python functions.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected RunnableCallback to be executed after the current bundle was finished.protected final org.apache.flink.configuration.Configurationprotected intNumber of processed elements in the current bundle.protected longTime that the last bundle was finished.protected intMax number of elements to include in a bundle.protected booleanFields inherited from class org.apache.flink.streaming.api.operators.AbstractStreamOperator
combinedWatermark, lastRecordAttributes1, lastRecordAttributes2, latencyStats, LOG, metrics, output, processingTimeService, stateHandler, stateKeySelector1, stateKeySelector2, timeServiceManager -
Constructor Summary
ConstructorsConstructorDescriptionAbstractPythonFunctionOperator(org.apache.flink.configuration.Configuration config) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidChecks whether to invoke finishBundle by elements count.voidclose()protected abstract PythonEnvironmentManagerprotected voidvoidfinish()org.apache.flink.configuration.ConfigurationReturns theConfiguration.protected FlinkMetricContainerprotected abstract voidbooleanReturns whether the bundle is finished.voidopen()voidprepareSnapshotPreBarrier(long checkpointId) voidprocessWatermark(org.apache.flink.streaming.api.watermark.Watermark mark) voidsetCurrentKey(Object key) Methods inherited from class org.apache.flink.streaming.api.operators.AbstractStreamOperator
beforeInitializeStateHandler, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getStateKeySelector1, getStateKeySelector2, getTimeServiceManager, getUserCodeClassloader, hasKeyContext1, hasKeyContext2, initializeState, initializeState, isAsyncStateProcessingEnabled, isUsingCustomRawKeyedState, notifyCheckpointAborted, notifyCheckpointComplete, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processRecordAttributes, processRecordAttributes1, processRecordAttributes2, processWatermark, processWatermark1, processWatermark1, processWatermark2, processWatermark2, processWatermarkStatus, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, reportOrForwardLatencyMarker, setKeyContextElement1, setKeyContextElement2, setMailboxExecutor, setProcessingTimeService, setup, snapshotState, snapshotState, useSplittableTimersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.streaming.api.operators.KeyContextHandler
hasKeyContextMethods inherited from interface org.apache.flink.streaming.api.operators.StreamOperator
getOperatorAttributes
-
Field Details
-
config
protected final org.apache.flink.configuration.Configuration config -
systemEnvEnabled
protected transient boolean systemEnvEnabled -
maxBundleSize
protected transient int maxBundleSizeMax number of elements to include in a bundle. -
elementCount
protected transient int elementCountNumber of processed elements in the current bundle. -
lastFinishBundleTime
protected transient long lastFinishBundleTimeTime that the last bundle was finished. -
bundleFinishedCallback
Callback to be executed after the current bundle was finished.
-
-
Constructor Details
-
AbstractPythonFunctionOperator
public AbstractPythonFunctionOperator(org.apache.flink.configuration.Configuration config)
-
-
Method Details
-
open
-
finish
-
close
-
prepareSnapshotPreBarrier
-
processWatermark
public void processWatermark(org.apache.flink.streaming.api.watermark.Watermark mark) throws Exception -
setCurrentKey
- Specified by:
setCurrentKeyin interfaceorg.apache.flink.streaming.api.operators.KeyContext- Overrides:
setCurrentKeyin classorg.apache.flink.streaming.api.operators.AbstractStreamOperator<OUT>
-
isBundleFinished
public boolean isBundleFinished()Returns whether the bundle is finished. -
getConfiguration
public org.apache.flink.configuration.Configuration getConfiguration()Returns theConfiguration. -
invokeFinishBundle
- Throws:
Exception
-
createPythonEnvironmentManager
-
drainUnregisteredTimers
protected void drainUnregisteredTimers() -
checkInvokeFinishBundleByCount
Checks whether to invoke finishBundle by elements count. Called in processElement.- Throws:
Exception
-
getFlinkMetricContainer
-