@Internal public class PythonKeyedProcessOperator<OUT> extends AbstractOneInputPythonFunctionOperator<org.apache.flink.types.Row,OUT> implements org.apache.flink.api.java.typeutils.ResultTypeQueryable<OUT>, org.apache.flink.streaming.api.operators.Triggerable<org.apache.flink.types.Row,org.apache.flink.runtime.state.VoidNamespace>
PythonKeyedProcessOperator 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.elementCount, maxBundleSize, pythonFunctionRunner| 构造器和说明 |
|---|
PythonKeyedProcessOperator(org.apache.flink.configuration.Configuration config,
org.apache.flink.api.java.typeutils.RowTypeInfo inputTypeInfo,
org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outputTypeInfo,
DataStreamPythonFunctionInfo pythonFunctionInfo) |
| 限定符和类型 | 方法和说明 |
|---|---|
PythonFunctionRunner |
createPythonFunctionRunner()
Creates the
PythonFunctionRunner which is responsible for Python user-defined
function execution. |
void |
emitResult(org.apache.flink.api.java.tuple.Tuple2<byte[],Integer> resultTuple)
Sends the execution result to the downstream operator.
|
org.apache.flink.api.common.typeinfo.TypeInformation<OUT> |
getProducedType() |
org.apache.flink.table.functions.python.PythonEnv |
getPythonEnv()
Returns the
PythonEnv used to create PythonEnvironmentManager.. |
void |
onEventTime(org.apache.flink.streaming.api.operators.InternalTimer<org.apache.flink.types.Row,org.apache.flink.runtime.state.VoidNamespace> timer) |
void |
onProcessingTime(org.apache.flink.streaming.api.operators.InternalTimer<org.apache.flink.types.Row,org.apache.flink.runtime.state.VoidNamespace> timer) |
void |
open() |
void |
processElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<org.apache.flink.types.Row> element) |
endInputcheckInvokeFinishBundleByCount, close, createPythonEnvironmentManager, dispose, emitResults, getConfig, getFlinkMetricContainer, getPythonConfig, invokeFinishBundle, isBundleFinished, prepareSnapshotPreBarrier, processWatermark, setPythonConfiggetChainingStrategy, 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, setCurrentKey, setKeyContextElement1, setKeyContextElement2, setProcessingTimeService, setup, snapshotState, snapshotStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, dispose, getMetricGroup, getOperatorID, initializeState, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotStatepublic PythonKeyedProcessOperator(org.apache.flink.configuration.Configuration config,
org.apache.flink.api.java.typeutils.RowTypeInfo inputTypeInfo,
org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outputTypeInfo,
DataStreamPythonFunctionInfo pythonFunctionInfo)
public void open()
throws Exception
open 在接口中 org.apache.flink.streaming.api.operators.StreamOperator<OUT>open 在类中 AbstractPythonFunctionOperator<OUT>Exceptionpublic org.apache.flink.api.common.typeinfo.TypeInformation<OUT> getProducedType()
getProducedType 在接口中 org.apache.flink.api.java.typeutils.ResultTypeQueryable<OUT>public void onEventTime(org.apache.flink.streaming.api.operators.InternalTimer<org.apache.flink.types.Row,org.apache.flink.runtime.state.VoidNamespace> timer)
throws Exception
onEventTime 在接口中 org.apache.flink.streaming.api.operators.Triggerable<org.apache.flink.types.Row,org.apache.flink.runtime.state.VoidNamespace>Exceptionpublic void onProcessingTime(org.apache.flink.streaming.api.operators.InternalTimer<org.apache.flink.types.Row,org.apache.flink.runtime.state.VoidNamespace> timer)
throws Exception
onProcessingTime 在接口中 org.apache.flink.streaming.api.operators.Triggerable<org.apache.flink.types.Row,org.apache.flink.runtime.state.VoidNamespace>Exceptionpublic PythonFunctionRunner createPythonFunctionRunner() throws Exception
AbstractPythonFunctionOperatorPythonFunctionRunner which is responsible for Python user-defined
function execution.createPythonFunctionRunner 在类中 AbstractPythonFunctionOperator<OUT>Exceptionpublic org.apache.flink.table.functions.python.PythonEnv getPythonEnv()
AbstractPythonFunctionOperatorPythonEnv used to create PythonEnvironmentManager..getPythonEnv 在类中 AbstractPythonFunctionOperator<OUT>public void emitResult(org.apache.flink.api.java.tuple.Tuple2<byte[],Integer> resultTuple) throws Exception
AbstractPythonFunctionOperatoremitResult 在类中 AbstractPythonFunctionOperator<OUT>ExceptionCopyright © 2014–2021 The Apache Software Foundation. All rights reserved.