Class AbstractStatelessFunctionOperator<IN,OUT,UDFIN>
- java.lang.Object
-
- org.apache.flink.streaming.api.operators.AbstractStreamOperator<OUT>
-
- org.apache.flink.streaming.api.operators.python.AbstractPythonFunctionOperator<OUT>
-
- org.apache.flink.streaming.api.operators.python.process.AbstractExternalPythonFunctionOperator<OUT>
-
- org.apache.flink.table.runtime.operators.python.AbstractOneInputPythonFunctionOperator<IN,OUT>
-
- org.apache.flink.table.runtime.operators.python.AbstractStatelessFunctionOperator<IN,OUT,UDFIN>
-
- Type Parameters:
IN- Type of the input elements.OUT- Type of the output elements.UDFIN- Type of the UDF input type.
- All Implemented Interfaces:
Serializable,org.apache.flink.api.common.state.CheckpointListener,org.apache.flink.streaming.api.operators.BoundedOneInput,org.apache.flink.streaming.api.operators.Input<IN>,org.apache.flink.streaming.api.operators.KeyContext,org.apache.flink.streaming.api.operators.KeyContextHandler,org.apache.flink.streaming.api.operators.OneInputStreamOperator<IN,OUT>,org.apache.flink.streaming.api.operators.SetupableStreamOperator<OUT>,org.apache.flink.streaming.api.operators.StreamOperator<OUT>,org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.CheckpointedStreamOperator
- Direct Known Subclasses:
AbstractArrowPythonAggregateFunctionOperator,AbstractPythonScalarFunctionOperator,PythonTableFunctionOperator
@Internal public abstract class AbstractStatelessFunctionOperator<IN,OUT,UDFIN> extends AbstractOneInputPythonFunctionOperator<IN,OUT>
Base class for all stream operators to execute Python Stateless Functions.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.flink.core.memory.ByteArrayInputStreamWithPosbaisReusable InputStream used to holding the execution results to be deserialized.protected org.apache.flink.core.memory.DataInputViewStreamWrapperbaisWrapperInputStream Wrapper.protected org.apache.flink.core.memory.ByteArrayOutputStreamWithPosbaosReusable OutputStream used to holding the serialized input elements.protected org.apache.flink.core.memory.DataOutputViewStreamWrapperbaosWrapperOutputStream Wrapper.protected LinkedList<IN>forwardedInputQueueThe queue holding the input elements for which the execution results have not been received.protected org.apache.flink.table.types.logical.RowTypeinputTypeThe input logical type.protected org.apache.flink.table.types.logical.RowTypeudfInputTypeThe user-defined function input logical type.protected org.apache.flink.table.types.logical.RowTypeudfOutputTypeThe user-defined function output logical type.-
Fields inherited from class org.apache.flink.streaming.api.operators.python.process.AbstractExternalPythonFunctionOperator
pythonFunctionRunner
-
Fields inherited from class org.apache.flink.streaming.api.operators.python.AbstractPythonFunctionOperator
bundleFinishedCallback, config, elementCount, lastFinishBundleTime, maxBundleSize, systemEnvEnabled
-
-
Constructor Summary
Constructors Constructor Description AbstractStatelessFunctionOperator(org.apache.flink.configuration.Configuration config, org.apache.flink.table.types.logical.RowType inputType, org.apache.flink.table.types.logical.RowType udfInputType, org.apache.flink.table.types.logical.RowType udfOutputType)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidbufferInput(IN input)Buffers the specified input, it will be used to construct the operator result together with the user-defined function execution result.abstract FlinkFnApi.CoderInfoDescriptorcreateInputCoderInfoDescriptor(org.apache.flink.table.types.logical.RowType runnerInputType)abstract FlinkFnApi.CoderInfoDescriptorcreateOutputCoderInfoDescriptor(org.apache.flink.table.types.logical.RowType runnerOutType)PythonFunctionRunnercreatePythonFunctionRunner()Creates thePythonFunctionRunnerwhich is responsible for Python user-defined function execution.abstract FlinkFnApi.UserDefinedFunctionscreateUserDefinedFunctionsProto()Gets the proto representation of the Python user-defined functions to be executed.abstract UDFINgetFunctionInput(IN element)abstract StringgetFunctionUrn()voidopen()voidprocessElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IN> element)abstract voidprocessElementInternal(IN value)-
Methods inherited from class org.apache.flink.table.runtime.operators.python.AbstractOneInputPythonFunctionOperator
endInput
-
Methods inherited from class org.apache.flink.streaming.api.operators.python.process.AbstractExternalPythonFunctionOperator
close, createPythonEnvironmentManager, emitResult, emitResults, getPythonEnv, invokeFinishBundle
-
Methods inherited from class org.apache.flink.streaming.api.operators.python.AbstractPythonFunctionOperator
checkInvokeFinishBundleByCount, finish, getConfiguration, getFlinkMetricContainer, isBundleFinished, prepareSnapshotPreBarrier, processWatermark, setCurrentKey
-
Methods inherited from class org.apache.flink.streaming.api.operators.AbstractStreamOperator
getChainingStrategy, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getTimeServiceManager, getUserCodeClassloader, hasKeyContext1, hasKeyContext2, initializeState, initializeState, isUsingCustomRawKeyedState, notifyCheckpointAborted, notifyCheckpointComplete, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processRecordAttributes, processRecordAttributes1, processRecordAttributes2, processWatermark1, processWatermark2, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, reportOrForwardLatencyMarker, setChainingStrategy, setKeyContextElement1, setKeyContextElement2, setProcessingTimeService, setup, snapshotState, snapshotState
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.flink.api.common.state.CheckpointListener
notifyCheckpointAborted, notifyCheckpointComplete
-
Methods inherited from interface org.apache.flink.streaming.api.operators.Input
processLatencyMarker, processRecordAttributes, processWatermark, processWatermarkStatus
-
Methods inherited from interface org.apache.flink.streaming.api.operators.KeyContext
getCurrentKey, setCurrentKey
-
Methods inherited from interface org.apache.flink.streaming.api.operators.KeyContextHandler
hasKeyContext
-
-
-
-
Field Detail
-
inputType
protected final org.apache.flink.table.types.logical.RowType inputType
The input logical type.
-
udfInputType
protected final org.apache.flink.table.types.logical.RowType udfInputType
The user-defined function input logical type.
-
udfOutputType
protected final org.apache.flink.table.types.logical.RowType udfOutputType
The user-defined function output logical type.
-
forwardedInputQueue
protected transient LinkedList<IN> forwardedInputQueue
The queue holding the input elements for which the execution results have not been received.
-
bais
protected transient org.apache.flink.core.memory.ByteArrayInputStreamWithPos bais
Reusable InputStream used to holding the execution results to be deserialized.
-
baisWrapper
protected transient org.apache.flink.core.memory.DataInputViewStreamWrapper baisWrapper
InputStream Wrapper.
-
baos
protected transient org.apache.flink.core.memory.ByteArrayOutputStreamWithPos baos
Reusable OutputStream used to holding the serialized input elements.
-
baosWrapper
protected transient org.apache.flink.core.memory.DataOutputViewStreamWrapper baosWrapper
OutputStream Wrapper.
-
-
Constructor Detail
-
AbstractStatelessFunctionOperator
public AbstractStatelessFunctionOperator(org.apache.flink.configuration.Configuration config, org.apache.flink.table.types.logical.RowType inputType, org.apache.flink.table.types.logical.RowType udfInputType, org.apache.flink.table.types.logical.RowType udfOutputType)
-
-
Method Detail
-
open
public void open() throws Exception- Specified by:
openin interfaceorg.apache.flink.streaming.api.operators.StreamOperator<IN>- Overrides:
openin classAbstractExternalPythonFunctionOperator<OUT>- Throws:
Exception
-
processElement
public void processElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<IN> element) throws Exception
- Throws:
Exception
-
createPythonFunctionRunner
public PythonFunctionRunner createPythonFunctionRunner() throws IOException
Description copied from class:AbstractExternalPythonFunctionOperatorCreates thePythonFunctionRunnerwhich is responsible for Python user-defined function execution.- Specified by:
createPythonFunctionRunnerin classAbstractExternalPythonFunctionOperator<OUT>- Throws:
IOException
-
bufferInput
public abstract void bufferInput(IN input) throws Exception
Buffers the specified input, it will be used to construct the operator result together with the user-defined function execution result.- Throws:
Exception
-
createUserDefinedFunctionsProto
public abstract FlinkFnApi.UserDefinedFunctions createUserDefinedFunctionsProto()
Gets the proto representation of the Python user-defined functions to be executed.
-
getFunctionUrn
public abstract String getFunctionUrn()
-
createInputCoderInfoDescriptor
public abstract FlinkFnApi.CoderInfoDescriptor createInputCoderInfoDescriptor(org.apache.flink.table.types.logical.RowType runnerInputType)
-
createOutputCoderInfoDescriptor
public abstract FlinkFnApi.CoderInfoDescriptor createOutputCoderInfoDescriptor(org.apache.flink.table.types.logical.RowType runnerOutType)
-
-