@Internal public class ExternalPythonKeyedProcessOperator<OUT> extends AbstractExternalOneInputPythonFunctionOperator<org.apache.flink.types.Row,OUT> implements org.apache.flink.streaming.api.operators.Triggerable<org.apache.flink.types.Row,Object>
ExternalPythonKeyedProcessOperator is responsible for launching beam runner which will
start a python harness to execute user defined python function. It is also able to handle the
timer and state request from the python stateful user defined function.baos, baosWrapperpythonFunctionRunnerbundleFinishedCallback, config, elementCount, lastFinishBundleTime, maxBundleSize, systemEnvEnabled| 构造器和说明 |
|---|
ExternalPythonKeyedProcessOperator(org.apache.flink.configuration.Configuration config,
DataStreamPythonFunctionInfo pythonFunctionInfo,
org.apache.flink.api.java.typeutils.RowTypeInfo inputTypeInfo,
org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outputTypeInfo) |
ExternalPythonKeyedProcessOperator(org.apache.flink.configuration.Configuration config,
DataStreamPythonFunctionInfo pythonFunctionInfo,
org.apache.flink.api.java.typeutils.RowTypeInfo inputTypeInfo,
org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outputTypeInfo,
org.apache.flink.api.common.typeutils.TypeSerializer namespaceSerializer) |
| 限定符和类型 | 方法和说明 |
|---|---|
<T> AbstractExternalDataStreamPythonFunctionOperator<T> |
copy(DataStreamPythonFunctionInfo pythonFunctionInfo,
org.apache.flink.api.common.typeinfo.TypeInformation<T> outputTypeInfo)
Make a copy of the DataStreamPythonFunctionOperator with the given pythonFunctionInfo and
outputTypeInfo.
|
PythonFunctionRunner |
createPythonFunctionRunner()
Creates the
PythonFunctionRunner which is responsible for Python user-defined
function execution. |
Object |
getCurrentKey() |
void |
onEventTime(org.apache.flink.streaming.api.operators.InternalTimer<org.apache.flink.types.Row,Object> timer) |
void |
onProcessingTime(org.apache.flink.streaming.api.operators.InternalTimer<org.apache.flink.types.Row,Object> timer) |
void |
open() |
void |
processElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<org.apache.flink.types.Row> element) |
void |
setCurrentKey(Object key)
As the beam state gRPC service will access the KeyedStateBackend in parallel with this
operator, we must override this method to prevent changing the current key of the
KeyedStateBackend while the beam service is handling requests.
|
createInputCoderInfoDescriptor, createOutputCoderInfoDescriptor, emitResult, endInput, getInputTypeInfo, processElementaddSideOutputTags, createSideOutputCoderDescriptors, getInternalParameters, getOutputTagById, getProducedType, getPythonEnv, getPythonFunctionInfo, getSideOutputTags, getSideOutputTypeSerializerById, setNumPartitionsclose, createPythonEnvironmentManager, emitResults, invokeFinishBundlecheckInvokeFinishBundleByCount, finish, getConfiguration, getFlinkMetricContainer, isBundleFinished, prepareSnapshotPreBarrier, processWatermarkgetChainingStrategy, getContainingTask, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getStateKeySelector1, getStateKeySelector2, getTimeServiceManager, getUserCodeClassloader, hasKeyContext1, hasKeyContext2, initializeState, initializeState, isUsingCustomRawKeyedState, notifyCheckpointAborted, notifyCheckpointComplete, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processRecordAttributes, processRecordAttributes1, processRecordAttributes2, processWatermark1, processWatermark2, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, reportOrForwardLatencyMarker, setChainingStrategy, setKeyContextElement1, setKeyContextElement2, setMailboxExecutor, setProcessingTimeService, setup, snapshotState, snapshotState, useSplittableTimersclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, finish, getMetricGroup, getOperatorAttributes, getOperatorID, initializeState, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotStatenotifyCheckpointAborted, notifyCheckpointCompletepublic ExternalPythonKeyedProcessOperator(org.apache.flink.configuration.Configuration config,
DataStreamPythonFunctionInfo pythonFunctionInfo,
org.apache.flink.api.java.typeutils.RowTypeInfo inputTypeInfo,
org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outputTypeInfo)
public ExternalPythonKeyedProcessOperator(org.apache.flink.configuration.Configuration config,
DataStreamPythonFunctionInfo pythonFunctionInfo,
org.apache.flink.api.java.typeutils.RowTypeInfo inputTypeInfo,
org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outputTypeInfo,
org.apache.flink.api.common.typeutils.TypeSerializer namespaceSerializer)
public void open()
throws Exception
open 在接口中 org.apache.flink.streaming.api.operators.StreamOperator<OUT>open 在类中 AbstractExternalOneInputPythonFunctionOperator<org.apache.flink.types.Row,OUT>Exceptionpublic void onEventTime(org.apache.flink.streaming.api.operators.InternalTimer<org.apache.flink.types.Row,Object> timer) throws Exception
public void onProcessingTime(org.apache.flink.streaming.api.operators.InternalTimer<org.apache.flink.types.Row,Object> timer) throws Exception
public PythonFunctionRunner createPythonFunctionRunner() throws Exception
PythonFunctionRunner which is responsible for Python user-defined
function execution.public void processElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<org.apache.flink.types.Row> element)
throws Exception
processElement 在接口中 org.apache.flink.streaming.api.operators.Input<org.apache.flink.types.Row>Exceptionpublic void setCurrentKey(Object key)
setCurrentKey 在接口中 org.apache.flink.streaming.api.operators.KeyContextsetCurrentKey 在类中 AbstractPythonFunctionOperator<OUT>public Object getCurrentKey()
getCurrentKey 在接口中 org.apache.flink.streaming.api.operators.KeyContextgetCurrentKey 在类中 org.apache.flink.streaming.api.operators.AbstractStreamOperator<OUT>public <T> AbstractExternalDataStreamPythonFunctionOperator<T> copy(DataStreamPythonFunctionInfo pythonFunctionInfo, org.apache.flink.api.common.typeinfo.TypeInformation<T> outputTypeInfo)
DataStreamPythonFunctionOperatorcopy 在接口中 DataStreamPythonFunctionOperator<OUT>Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.