@Internal public class EmbeddedPythonKeyedCoProcessOperator<K,IN1,IN2,OUT> extends AbstractTwoInputEmbeddedPythonFunctionOperator<IN1,IN2,OUT> implements Triggerable<K,VoidNamespace>
EmbeddedPythonKeyedCoProcessOperator
is responsible for executing user defined python
KeyedCoProcessFunction 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 |
---|
EmbeddedPythonKeyedCoProcessOperator(Configuration config,
DataStreamPythonFunctionInfo pythonFunctionInfo,
TypeInformation<IN1> inputTypeInfo1,
TypeInformation<IN2> inputTypeInfo2,
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.
|
close, endInput, openPythonInterpreter, processElement1, processElement2
addSideOutputTags, getJobParameters, getProducedType, getPythonFunctionInfo, getSideOutputTags, setNumPartitions
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
processLatencyMarker1, processLatencyMarker2, processWatermark1, processWatermark2, processWatermarkStatus1, processWatermarkStatus2
finish, getMetricGroup, getOperatorID, initializeState, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotState
notifyCheckpointAborted, notifyCheckpointComplete
getCurrentKey, setCurrentKey
hasKeyContext
public EmbeddedPythonKeyedCoProcessOperator(Configuration config, DataStreamPythonFunctionInfo pythonFunctionInfo, TypeInformation<IN1> inputTypeInfo1, TypeInformation<IN2> inputTypeInfo2, TypeInformation<OUT> outputTypeInfo)
public void open() throws Exception
AbstractStreamOperator
The default implementation does nothing.
open
in interface StreamOperator<OUT>
open
in class AbstractTwoInputEmbeddedPythonFunctionOperator<IN1,IN2,OUT>
Exception
- An exception in this method causes the operator to fail.public List<FlinkFnApi.UserDefinedDataStreamFunction> createUserDefinedFunctionsProto()
AbstractTwoInputEmbeddedPythonFunctionOperator
createUserDefinedFunctionsProto
in class AbstractTwoInputEmbeddedPythonFunctionOperator<IN1,IN2,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()
AbstractTwoInputEmbeddedPythonFunctionOperator
getFunctionContext
in class AbstractTwoInputEmbeddedPythonFunctionOperator<IN1,IN2,OUT>
public Object getTimerContext()
AbstractTwoInputEmbeddedPythonFunctionOperator
getTimerContext
in class AbstractTwoInputEmbeddedPythonFunctionOperator<IN1,IN2,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.