@Internal public abstract class AbstractExternalPythonFunctionOperator<OUT> extends AbstractPythonFunctionOperator<OUT>
Modifier and Type | Field and Description |
---|---|
protected PythonFunctionRunner |
pythonFunctionRunner
The
PythonFunctionRunner which is responsible for Python user-defined function
execution. |
bundleFinishedCallback, config, elementCount, lastFinishBundleTime, maxBundleSize, systemEnvEnabled
chainingStrategy, latencyStats, LOG, metrics, output, processingTimeService
Constructor and Description |
---|
AbstractExternalPythonFunctionOperator(Configuration config) |
Modifier and Type | Method and Description |
---|---|
void |
close()
This method is called at the very end of the operator's life, both in the case of a
successful completion of the operation, and in the case of a failure and canceling.
|
protected ProcessPythonEnvironmentManager |
createPythonEnvironmentManager() |
abstract PythonFunctionRunner |
createPythonFunctionRunner()
Creates the
PythonFunctionRunner which is responsible for Python user-defined
function execution. |
abstract void |
emitResult(Tuple3<String,byte[],Integer> resultTuple)
Sends the execution result to the downstream operator.
|
protected void |
emitResults() |
abstract PythonEnv |
getPythonEnv()
Returns the
PythonEnv used to create PythonEnvironmentManager.. |
protected void |
invokeFinishBundle() |
void |
open()
This method is called immediately before any elements are processed, it should contain the
operator's initialization logic, e.g. state initialization.
|
checkInvokeFinishBundleByCount, finish, getConfiguration, getFlinkMetricContainer, isBundleFinished, prepareSnapshotPreBarrier, processWatermark, setCurrentKey
getChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getTimeServiceManager, getUserCodeClassloader, hasKeyContext1, hasKeyContext2, initializeState, initializeState, isUsingCustomRawKeyedState, notifyCheckpointAborted, notifyCheckpointComplete, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processWatermark1, processWatermark2, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, reportOrForwardLatencyMarker, setChainingStrategy, setKeyContextElement1, setKeyContextElement2, setProcessingTimeService, setup, snapshotState, snapshotState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
hasKeyContext
protected transient PythonFunctionRunner pythonFunctionRunner
PythonFunctionRunner
which is responsible for Python user-defined function
execution.public AbstractExternalPythonFunctionOperator(Configuration config)
public void open() throws Exception
AbstractStreamOperator
The default implementation does nothing.
open
in interface StreamOperator<OUT>
open
in class AbstractPythonFunctionOperator<OUT>
Exception
- An exception in this method causes the operator to fail.public void close() throws Exception
StreamOperator
This method is expected to make a thorough effort to release all resources that the operator has acquired.
NOTE:It can not emit any records! If you need to emit records at the end of
processing, do so in the StreamOperator.finish()
method.
close
in interface StreamOperator<OUT>
close
in class AbstractPythonFunctionOperator<OUT>
Exception
protected void invokeFinishBundle() throws Exception
invokeFinishBundle
in class AbstractPythonFunctionOperator<OUT>
Exception
protected ProcessPythonEnvironmentManager createPythonEnvironmentManager()
createPythonEnvironmentManager
in class AbstractPythonFunctionOperator<OUT>
public abstract PythonEnv getPythonEnv()
PythonEnv
used to create PythonEnvironmentManager..public abstract void emitResult(Tuple3<String,byte[],Integer> resultTuple) throws Exception
Exception
public abstract PythonFunctionRunner createPythonFunctionRunner() throws Exception
PythonFunctionRunner
which is responsible for Python user-defined
function execution.Exception
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.