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 ByteArrayInputStreamWithPos |
bais
Reusable InputStream used to holding the execution results to be deserialized.
|
protected DataInputViewStreamWrapper |
baisWrapper
InputStream Wrapper.
|
protected ByteArrayOutputStreamWithPos |
baos
Reusable OutputStream used to holding the serialized input elements.
|
protected DataOutputViewStreamWrapper |
baosWrapper
OutputStream Wrapper.
|
protected LinkedList<IN> |
forwardedInputQueue
The queue holding the input elements for which the execution results have not been received.
|
protected RowType |
inputType
The input logical type.
|
protected RowType |
outputType
The output logical type.
|
protected int[] |
userDefinedFunctionInputOffsets
The offsets of user-defined function inputs.
|
protected RowType |
userDefinedFunctionInputType
The user-defined function input logical type.
|
protected RowType |
userDefinedFunctionOutputType
The user-defined function output logical type.
|
elementCount, maxBundleSize, pythonFunctionRunner
chainingStrategy, latencyStats, LOG, metrics, output, processingTimeService
Constructor and Description |
---|
AbstractStatelessFunctionOperator(Configuration config,
RowType inputType,
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()
This method is called immediately before any elements are processed, it should contain the
operator's initialization logic, e.g.
|
void |
processElement(StreamRecord<IN> element)
Processes one element that arrived on this input of the
MultipleInputStreamOperator . |
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
getCurrentKey, setCurrentKey
processLatencyMarker, processWatermark
protected final RowType inputType
protected final RowType outputType
protected final int[] userDefinedFunctionInputOffsets
protected transient RowType userDefinedFunctionInputType
protected transient RowType userDefinedFunctionOutputType
protected transient LinkedList<IN> forwardedInputQueue
protected transient ByteArrayInputStreamWithPos bais
protected transient DataInputViewStreamWrapper baisWrapper
protected transient ByteArrayOutputStreamWithPos baos
protected transient DataOutputViewStreamWrapper baosWrapper
public AbstractStatelessFunctionOperator(Configuration config, RowType inputType, RowType outputType, int[] userDefinedFunctionInputOffsets)
public void open() throws Exception
AbstractStreamOperator
The default implementation does nothing.
open
in interface StreamOperator<OUT>
open
in class AbstractPythonFunctionOperator<OUT>
Exception
- An exception in this method causes the operator to fail.public void processElement(StreamRecord<IN> element) throws Exception
Input
MultipleInputStreamOperator
.
This method is guaranteed to not be called concurrently with other methods of the operator.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–2022 The Apache Software Foundation. All rights reserved.