@Internal public abstract class OneInputPythonFunctionOperator<IN,OUT,UDFIN,UDFOUT> extends AbstractOneInputPythonFunctionOperator<IN,OUT>
OneInputPythonFunctionOperator is responsible for launching beam runner which will start
a python harness to execute user defined python function.
The operator will buffer the timestamp of input elements in a queue, and set into the produced output element.
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.flink.core.memory.ByteArrayInputStreamWithPos |
bais
Reusable InputStream used to holding the execution results to be deserialized.
|
protected org.apache.flink.core.memory.DataInputViewStreamWrapper |
baisWrapper
InputStream Wrapper.
|
protected org.apache.flink.core.memory.ByteArrayOutputStreamWithPos |
baos
Reusable OutputStream used to holding the serialized input elements.
|
protected org.apache.flink.core.memory.DataOutputViewStreamWrapper |
baosWrapper
OutputStream Wrapper.
|
protected org.apache.flink.streaming.api.operators.TimestampedCollector<OUT> |
collector |
protected static String |
DATA_STREAM_STATELESS_FUNCTION_URN |
protected Map<String,String> |
jobOptions
The options used to configure the Python worker process.
|
elementCount, maxBundleSize, pythonFunctionRunner| Constructor and Description |
|---|
OneInputPythonFunctionOperator(org.apache.flink.configuration.Configuration config,
org.apache.flink.api.common.typeinfo.TypeInformation<UDFIN> runnerInputTypeInfo,
org.apache.flink.api.common.typeinfo.TypeInformation<UDFOUT> runnerOutputTypeInfo,
DataStreamPythonFunctionInfo pythonFunctionInfo) |
| Modifier and Type | Method and Description |
|---|---|
PythonFunctionRunner |
createPythonFunctionRunner()
Creates the
PythonFunctionRunner which is responsible for Python user-defined
function execution. |
abstract String |
getCoderUrn() |
String |
getFunctionUrn() |
Map<String,String> |
getInternalParameters() |
org.apache.flink.table.functions.python.PythonEnv |
getPythonEnv()
Returns the
PythonEnv used to create PythonEnvironmentManager.. |
void |
open() |
void |
processElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IN> element) |
endInputcheckInvokeFinishBundleByCount, close, createPythonEnvironmentManager, dispose, emitResult, emitResults, getConfig, getFlinkMetricContainer, getPythonConfig, invokeFinishBundle, isBundleFinished, prepareSnapshotPreBarrier, processWatermark, setCurrentKey, 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, setKeyContextElement1, setKeyContextElement2, setProcessingTimeService, setup, snapshotState, snapshotStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetKeyContextElementclose, dispose, getMetricGroup, getOperatorID, initializeState, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotStatenotifyCheckpointAborted, notifyCheckpointCompleteprotected static final String DATA_STREAM_STATELESS_FUNCTION_URN
protected final Map<String,String> jobOptions
protected transient org.apache.flink.core.memory.ByteArrayInputStreamWithPos bais
protected transient org.apache.flink.core.memory.DataInputViewStreamWrapper baisWrapper
protected transient org.apache.flink.core.memory.ByteArrayOutputStreamWithPos baos
protected transient org.apache.flink.core.memory.DataOutputViewStreamWrapper baosWrapper
protected transient org.apache.flink.streaming.api.operators.TimestampedCollector<OUT> collector
public OneInputPythonFunctionOperator(org.apache.flink.configuration.Configuration config,
org.apache.flink.api.common.typeinfo.TypeInformation<UDFIN> runnerInputTypeInfo,
org.apache.flink.api.common.typeinfo.TypeInformation<UDFOUT> runnerOutputTypeInfo,
DataStreamPythonFunctionInfo pythonFunctionInfo)
public void open()
throws Exception
open in interface org.apache.flink.streaming.api.operators.StreamOperator<OUT>open in class AbstractPythonFunctionOperator<OUT>Exceptionpublic PythonFunctionRunner createPythonFunctionRunner() throws Exception
AbstractPythonFunctionOperatorPythonFunctionRunner which is responsible for Python user-defined
function execution.createPythonFunctionRunner in class AbstractPythonFunctionOperator<OUT>Exceptionpublic org.apache.flink.table.functions.python.PythonEnv getPythonEnv()
AbstractPythonFunctionOperatorPythonEnv used to create PythonEnvironmentManager..getPythonEnv in class AbstractPythonFunctionOperator<OUT>public void processElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IN> element) throws Exception
Exceptionpublic String getFunctionUrn()
public abstract String getCoderUrn()
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.