@Internal public class EmbeddedPythonKeyedProcessOperator<K,IN,OUT> extends AbstractOneInputEmbeddedPythonFunctionOperator<IN,OUT> implements Triggerable<K,VoidNamespace>
EmbeddedPythonKeyedProcessOperator
is responsible for executing user defined python
KeyedProcessFunction in embedded Python environment. It is also able to handle the timer and
state request from the python stateful user defined function.timestamp
collector, hasSideOutput, outputTypeInfo, sideOutputContext
interpreter
bundleFinishedCallback, config, elementCount, lastFinishBundleTime, maxBundleSize, systemEnvEnabled
chainingStrategy, latencyStats, LOG, metrics, output, processingTimeService
Constructor and Description |
---|
EmbeddedPythonKeyedProcessOperator(Configuration config,
DataStreamPythonFunctionInfo pythonFunctionInfo,
TypeInformation<IN> inputTypeInfo,
TypeInformation<OUT> outputTypeInfo) |
Modifier and Type | Method and Description |
---|---|
<T> AbstractEmbeddedDataStreamPythonFunctionOperator<T> |
copy(DataStreamPythonFunctionInfo pythonFunctionInfo,
TypeInformation<T> outputTypeInfo)
Make a copy of the DataStreamPythonFunctionOperator with the given pythonFunctionInfo and
outputTypeInfo.
|
List<FlinkFnApi.UserDefinedDataStreamFunction> |
createUserDefinedFunctionsProto()
Gets the proto representation of the Python user-defined functions to be executed.
|
Object |
getFunctionContext()
Gets The function context.
|
Object |
getTimerContext()
Gets The Timer context.
|
void |
onEventTime(InternalTimer<K,VoidNamespace> timer)
Invoked when an event-time timer fires.
|
void |
onProcessingTime(InternalTimer<K,VoidNamespace> timer)
Invoked when a processing-time timer fires.
|
void |
open()
This method is called immediately before any elements are processed, it should contain the
operator's initialization logic, e.g. state initialization.
|
endInput, openPythonInterpreter, processElement
addSideOutputTags, getJobParameters, getProducedType, getPythonFunctionInfo, getSideOutputTags, setNumPartitions
close, createPythonEnvironmentManager, invokeFinishBundle
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
setKeyContextElement
close, finish, getMetricGroup, getOperatorID, initializeState, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotState
notifyCheckpointAborted, notifyCheckpointComplete
getCurrentKey, setCurrentKey
processLatencyMarker, processWatermark, processWatermarkStatus
hasKeyContext
public EmbeddedPythonKeyedProcessOperator(Configuration config, DataStreamPythonFunctionInfo pythonFunctionInfo, TypeInformation<IN> inputTypeInfo, TypeInformation<OUT> outputTypeInfo)
public void open() throws Exception
AbstractStreamOperator
The default implementation does nothing.
open
in interface StreamOperator<OUT>
open
in class AbstractOneInputEmbeddedPythonFunctionOperator<IN,OUT>
Exception
- An exception in this method causes the operator to fail.public List<FlinkFnApi.UserDefinedDataStreamFunction> createUserDefinedFunctionsProto()
AbstractOneInputEmbeddedPythonFunctionOperator
createUserDefinedFunctionsProto
in class AbstractOneInputEmbeddedPythonFunctionOperator<IN,OUT>
public void onEventTime(InternalTimer<K,VoidNamespace> timer) throws Exception
Triggerable
onEventTime
in interface Triggerable<K,VoidNamespace>
Exception
public void onProcessingTime(InternalTimer<K,VoidNamespace> timer) throws Exception
Triggerable
onProcessingTime
in interface Triggerable<K,VoidNamespace>
Exception
public Object getFunctionContext()
AbstractOneInputEmbeddedPythonFunctionOperator
getFunctionContext
in class AbstractOneInputEmbeddedPythonFunctionOperator<IN,OUT>
public Object getTimerContext()
AbstractOneInputEmbeddedPythonFunctionOperator
getTimerContext
in class AbstractOneInputEmbeddedPythonFunctionOperator<IN,OUT>
public <T> AbstractEmbeddedDataStreamPythonFunctionOperator<T> copy(DataStreamPythonFunctionInfo pythonFunctionInfo, TypeInformation<T> outputTypeInfo)
DataStreamPythonFunctionOperator
copy
in interface DataStreamPythonFunctionOperator<OUT>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.