IN
- Type of the input elements.OUT
- Type of the output elements.UDFIN
- Type of the UDF input type.@Internal public abstract class AbstractStatelessFunctionOperator<IN,OUT,UDFIN> extends AbstractOneInputPythonFunctionOperator<IN,OUT>
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 LinkedList<IN> |
forwardedInputQueue
The queue holding the input elements for which the execution results have not been received.
|
protected org.apache.flink.table.types.logical.RowType |
inputType
The input logical type.
|
protected org.apache.flink.table.types.logical.RowType |
outputType
The output logical type.
|
protected int[] |
userDefinedFunctionInputOffsets
The offsets of user-defined function inputs.
|
protected org.apache.flink.table.types.logical.RowType |
userDefinedFunctionInputType
The user-defined function input logical type.
|
protected org.apache.flink.table.types.logical.RowType |
userDefinedFunctionOutputType
The user-defined function output logical type.
|
elementCount, maxBundleSize, pythonFunctionRunner
Constructor and Description |
---|
AbstractStatelessFunctionOperator(org.apache.flink.configuration.Configuration config,
org.apache.flink.table.types.logical.RowType inputType,
org.apache.flink.table.types.logical.RowType outputType,
int[] userDefinedFunctionInputOffsets) |
Modifier and Type | Method and Description |
---|---|
abstract void |
bufferInput(IN input)
Buffers the specified input, it will be used to construct the operator result together with
the user-defined function execution result.
|
PythonFunctionRunner |
createPythonFunctionRunner()
Creates the
PythonFunctionRunner which is responsible for Python user-defined
function execution. |
abstract UDFIN |
getFunctionInput(IN element) |
abstract String |
getFunctionUrn() |
abstract String |
getInputOutputCoderUrn() |
abstract FlinkFnApi.UserDefinedFunctions |
getUserDefinedFunctionsProto()
Gets the proto representation of the Python user-defined functions to be executed.
|
void |
open() |
void |
processElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IN> element) |
abstract void |
processElementInternal(IN value) |
endInput
checkInvokeFinishBundleByCount, close, createPythonEnvironmentManager, dispose, emitResult, emitResults, getConfig, getFlinkMetricContainer, getPythonConfig, getPythonEnv, invokeFinishBundle, isBundleFinished, prepareSnapshotPreBarrier, processWatermark, setCurrentKey, setPythonConfig
getChainingStrategy, 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, snapshotState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setKeyContextElement
close, dispose, getMetricGroup, getOperatorID, initializeState, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotState
notifyCheckpointAborted, notifyCheckpointComplete
protected final org.apache.flink.table.types.logical.RowType inputType
protected final org.apache.flink.table.types.logical.RowType outputType
protected final int[] userDefinedFunctionInputOffsets
protected transient org.apache.flink.table.types.logical.RowType userDefinedFunctionInputType
protected transient org.apache.flink.table.types.logical.RowType userDefinedFunctionOutputType
protected transient LinkedList<IN> forwardedInputQueue
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
public AbstractStatelessFunctionOperator(org.apache.flink.configuration.Configuration config, org.apache.flink.table.types.logical.RowType inputType, org.apache.flink.table.types.logical.RowType outputType, int[] userDefinedFunctionInputOffsets)
public void open() throws Exception
open
in interface org.apache.flink.streaming.api.operators.StreamOperator<OUT>
open
in class AbstractPythonFunctionOperator<OUT>
Exception
public void processElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IN> element) throws Exception
Exception
public PythonFunctionRunner createPythonFunctionRunner() throws IOException
AbstractPythonFunctionOperator
PythonFunctionRunner
which is responsible for Python user-defined
function execution.createPythonFunctionRunner
in class AbstractPythonFunctionOperator<OUT>
IOException
public abstract void bufferInput(IN input) throws Exception
Exception
public abstract FlinkFnApi.UserDefinedFunctions getUserDefinedFunctionsProto()
public abstract String getInputOutputCoderUrn()
public abstract String getFunctionUrn()
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.