public class PythonKeyedCoProcessOperator<OUT> extends TwoInputPythonFunctionOperator<org.apache.flink.types.Row,org.apache.flink.types.Row,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>
bais, baisWrapper, baos, baosWrapper, collector, reuseRow
elementCount, maxBundleSize, pythonFunctionRunner
Constructor and Description |
---|
PythonKeyedCoProcessOperator(org.apache.flink.configuration.Configuration config,
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> inputTypeInfo1,
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> inputTypeInfo2,
org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outputTypeInfo,
DataStreamPythonFunctionInfo pythonFunctionInfo) |
Modifier and Type | Method and Description |
---|---|
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.
|
Object |
getCurrentKey() |
org.apache.flink.api.common.typeinfo.TypeInformation<OUT> |
getProducedType() |
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 |
processElement1(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<org.apache.flink.types.Row> element) |
void |
processElement2(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.
|
getCoderUrn, getJobOptions, getPythonEnv, getPythonFunctionInfo, getRunnerInputTypeInfo, getRunnerInputTypeSerializer, getRunnerOutputTypeInfo, getRunnerOutputTypeSerializer
endInput
checkInvokeFinishBundleByCount, close, createPythonEnvironmentManager, dispose, emitResults, getConfig, getFlinkMetricContainer, getPythonConfig, invokeFinishBundle, isBundleFinished, prepareSnapshotPreBarrier, processWatermark, setPythonConfig
getChainingStrategy, getContainingTask, 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, setKeyContextElement1, setKeyContextElement2, setProcessingTimeService, setup, snapshotState, snapshotState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
processLatencyMarker1, processLatencyMarker2, processWatermark1, processWatermark2
public PythonKeyedCoProcessOperator(org.apache.flink.configuration.Configuration config, org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> inputTypeInfo1, org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> inputTypeInfo2, org.apache.flink.api.common.typeinfo.TypeInformation<OUT> outputTypeInfo, DataStreamPythonFunctionInfo pythonFunctionInfo)
public PythonFunctionRunner createPythonFunctionRunner() throws Exception
AbstractPythonFunctionOperator
PythonFunctionRunner
which is responsible for Python user-defined
function execution.createPythonFunctionRunner
in class TwoInputPythonFunctionOperator<org.apache.flink.types.Row,org.apache.flink.types.Row,org.apache.flink.types.Row,OUT>
Exception
public void open() throws Exception
open
in interface org.apache.flink.streaming.api.operators.StreamOperator<OUT>
open
in class TwoInputPythonFunctionOperator<org.apache.flink.types.Row,org.apache.flink.types.Row,org.apache.flink.types.Row,OUT>
Exception
public void processElement1(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<org.apache.flink.types.Row> element) throws Exception
processElement1
in interface org.apache.flink.streaming.api.operators.TwoInputStreamOperator<org.apache.flink.types.Row,org.apache.flink.types.Row,OUT>
processElement1
in class TwoInputPythonFunctionOperator<org.apache.flink.types.Row,org.apache.flink.types.Row,org.apache.flink.types.Row,OUT>
Exception
public void processElement2(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<org.apache.flink.types.Row> element) throws Exception
processElement2
in interface org.apache.flink.streaming.api.operators.TwoInputStreamOperator<org.apache.flink.types.Row,org.apache.flink.types.Row,OUT>
processElement2
in class TwoInputPythonFunctionOperator<org.apache.flink.types.Row,org.apache.flink.types.Row,org.apache.flink.types.Row,OUT>
Exception
public void emitResult(org.apache.flink.api.java.tuple.Tuple2<byte[],Integer> resultTuple) throws Exception
AbstractPythonFunctionOperator
emitResult
in class AbstractPythonFunctionOperator<OUT>
Exception
public org.apache.flink.api.common.typeinfo.TypeInformation<OUT> getProducedType()
getProducedType
in interface 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
in interface org.apache.flink.streaming.api.operators.Triggerable<org.apache.flink.types.Row,org.apache.flink.runtime.state.VoidNamespace>
Exception
public void onProcessingTime(org.apache.flink.streaming.api.operators.InternalTimer<org.apache.flink.types.Row,org.apache.flink.runtime.state.VoidNamespace> timer) throws Exception
onProcessingTime
in interface org.apache.flink.streaming.api.operators.Triggerable<org.apache.flink.types.Row,org.apache.flink.runtime.state.VoidNamespace>
Exception
public void setCurrentKey(Object key)
setCurrentKey
in interface org.apache.flink.streaming.api.operators.KeyContext
setCurrentKey
in class AbstractPythonFunctionOperator<OUT>
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.