@Internal
public abstract class AbstractPythonFunctionOperator<OUT>
extends org.apache.flink.streaming.api.operators.AbstractStreamOperator<OUT>
| Modifier and Type | Field and Description |
|---|---|
protected int |
elementCount
Number of processed elements in the current bundle.
|
protected int |
maxBundleSize
Max number of elements to include in a bundle.
|
protected PythonFunctionRunner |
pythonFunctionRunner
The
PythonFunctionRunner which is responsible for Python user-defined function
execution. |
| Constructor and Description |
|---|
AbstractPythonFunctionOperator(org.apache.flink.configuration.Configuration config) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkInvokeFinishBundleByCount()
Checks whether to invoke finishBundle by elements count.
|
void |
close() |
protected PythonEnvironmentManager |
createPythonEnvironmentManager() |
abstract PythonFunctionRunner |
createPythonFunctionRunner()
Creates the
PythonFunctionRunner which is responsible for Python user-defined
function execution. |
void |
dispose() |
abstract void |
emitResult(org.apache.flink.api.java.tuple.Tuple2<byte[],Integer> resultTuple)
Sends the execution result to the downstream operator.
|
protected void |
emitResults() |
PythonConfig |
getConfig()
Returns the
PythonConfig. |
protected FlinkMetricContainer |
getFlinkMetricContainer() |
PythonConfig |
getPythonConfig() |
abstract org.apache.flink.table.functions.python.PythonEnv |
getPythonEnv()
Returns the
PythonEnv used to create PythonEnvironmentManager.. |
protected void |
invokeFinishBundle() |
boolean |
isBundleFinished()
Returns whether the bundle is finished.
|
void |
open() |
void |
prepareSnapshotPreBarrier(long checkpointId) |
void |
processWatermark(org.apache.flink.streaming.api.watermark.Watermark mark) |
void |
setCurrentKey(Object key) |
void |
setPythonConfig(PythonConfig pythonConfig)
Reset the
PythonConfig if needed. |
getChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getTimeServiceManager, getUserCodeClassloader, initializeState, initializeState, isUsingCustomRawKeyedState, notifyCheckpointAborted, notifyCheckpointComplete, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processWatermark1, processWatermark2, reportOrForwardLatencyMarker, setChainingStrategy, setKeyContextElement1, setKeyContextElement2, setProcessingTimeService, setup, snapshotState, snapshotStateprotected transient PythonFunctionRunner pythonFunctionRunner
PythonFunctionRunner which is responsible for Python user-defined function
execution.protected transient int maxBundleSize
protected transient int elementCount
public AbstractPythonFunctionOperator(org.apache.flink.configuration.Configuration config)
public PythonConfig getPythonConfig()
public void open()
throws Exception
public void close()
throws Exception
public void dispose()
throws Exception
public void prepareSnapshotPreBarrier(long checkpointId)
throws Exception
public void processWatermark(org.apache.flink.streaming.api.watermark.Watermark mark)
throws Exception
public void setCurrentKey(Object key)
setCurrentKey in interface org.apache.flink.streaming.api.operators.KeyContextsetCurrentKey in class org.apache.flink.streaming.api.operators.AbstractStreamOperator<OUT>public boolean isBundleFinished()
public void setPythonConfig(PythonConfig pythonConfig)
PythonConfig if needed.public PythonConfig getConfig()
PythonConfig.public abstract PythonFunctionRunner createPythonFunctionRunner() throws Exception
PythonFunctionRunner which is responsible for Python user-defined
function execution.Exceptionpublic abstract org.apache.flink.table.functions.python.PythonEnv getPythonEnv()
PythonEnv used to create PythonEnvironmentManager..public abstract void emitResult(org.apache.flink.api.java.tuple.Tuple2<byte[],Integer> resultTuple) throws Exception
Exceptionprotected void checkInvokeFinishBundleByCount()
throws Exception
Exceptionprotected PythonEnvironmentManager createPythonEnvironmentManager() throws IOException
IOExceptionprotected FlinkMetricContainer getFlinkMetricContainer()
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.