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.StreamOperator<OUT>,org.apache.flink.streaming.api.operators.StreamOperatorStateHandler.CheckpointedStreamOperator,org.apache.flink.streaming.api.operators.YieldingOperator<OUT>
- 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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.flink.core.memory.ByteArrayInputStreamWithPosReusable InputStream used to holding the execution results to be deserialized.protected org.apache.flink.core.memory.DataInputViewStreamWrapperInputStream Wrapper.protected org.apache.flink.core.memory.ByteArrayOutputStreamWithPosReusable OutputStream used to holding the serialized input elements.protected org.apache.flink.core.memory.DataOutputViewStreamWrapperOutputStream Wrapper.protected LinkedList<IN>The queue holding the input elements for which the execution results have not been received.protected final org.apache.flink.table.types.logical.RowTypeThe input logical type.protected final org.apache.flink.table.types.logical.RowTypeThe user-defined function input logical type.protected final org.apache.flink.table.types.logical.RowTypeThe user-defined function output logical type.Fields inherited from class org.apache.flink.streaming.api.operators.python.process.AbstractExternalPythonFunctionOperator
pythonFunctionRunnerFields inherited from class org.apache.flink.streaming.api.operators.python.AbstractPythonFunctionOperator
bundleFinishedCallback, config, elementCount, lastFinishBundleTime, maxBundleSize, systemEnvEnabledFields inherited from class org.apache.flink.streaming.api.operators.AbstractStreamOperator
combinedWatermark, lastRecordAttributes1, lastRecordAttributes2, latencyStats, LOG, metrics, output, processingTimeService, stateHandler, stateKeySelector1, stateKeySelector2, timeServiceManager -
Constructor Summary
ConstructorsConstructorDescriptionAbstractStatelessFunctionOperator(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
Modifier and TypeMethodDescriptionabstract 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) Creates thePythonFunctionRunnerwhich is responsible for Python user-defined function execution.abstract FlinkFnApi.UserDefinedFunctionsGets the proto representation of the Python user-defined functions to be executed.abstract UDFINgetFunctionInput(IN element) abstract Stringvoidopen()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
endInputMethods inherited from class org.apache.flink.streaming.api.operators.python.process.AbstractExternalPythonFunctionOperator
close, createPythonEnvironmentManager, drainUnregisteredTimers, emitResult, emitResults, getPythonEnv, invokeFinishBundleMethods inherited from class org.apache.flink.streaming.api.operators.python.AbstractPythonFunctionOperator
checkInvokeFinishBundleByCount, finish, getConfiguration, getFlinkMetricContainer, isBundleFinished, prepareSnapshotPreBarrier, processWatermark, setCurrentKeyMethods inherited from class org.apache.flink.streaming.api.operators.AbstractStreamOperator
beforeInitializeStateHandler, getContainingTask, getCurrentKey, getExecutionConfig, getInternalTimerService, getKeyedStateBackend, getKeyedStateStore, getMetricGroup, getOperatorConfig, getOperatorID, getOperatorName, getOperatorStateBackend, getOrCreateKeyedState, getPartitionedState, getPartitionedState, getProcessingTimeService, getRuntimeContext, getStateKeySelector1, getStateKeySelector2, getTimeServiceManager, getUserCodeClassloader, hasKeyContext1, hasKeyContext2, initializeState, initializeState, isAsyncStateProcessingEnabled, isUsingCustomRawKeyedState, notifyCheckpointAborted, notifyCheckpointComplete, processLatencyMarker, processLatencyMarker1, processLatencyMarker2, processRecordAttributes, processRecordAttributes1, processRecordAttributes2, processWatermark, processWatermark1, processWatermark1, processWatermark2, processWatermark2, processWatermarkStatus, processWatermarkStatus, processWatermarkStatus1, processWatermarkStatus2, reportOrForwardLatencyMarker, setKeyContextElement1, setKeyContextElement2, setMailboxExecutor, setProcessingTimeService, setup, snapshotState, snapshotState, useSplittableTimersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.flink.api.common.state.CheckpointListener
notifyCheckpointAborted, notifyCheckpointCompleteMethods inherited from interface org.apache.flink.streaming.api.operators.Input
processLatencyMarker, processRecordAttributes, processWatermark, processWatermark, processWatermarkStatusMethods inherited from interface org.apache.flink.streaming.api.operators.KeyContext
getCurrentKey, setCurrentKeyMethods inherited from interface org.apache.flink.streaming.api.operators.KeyContextHandler
hasKeyContextMethods inherited from interface org.apache.flink.streaming.api.operators.OneInputStreamOperator
setKeyContextElementMethods inherited from interface org.apache.flink.streaming.api.operators.StreamOperator
close, finish, getMetricGroup, getOperatorAttributes, getOperatorID, initializeState, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotState
-
Field Details
-
inputType
protected final org.apache.flink.table.types.logical.RowType inputTypeThe input logical type. -
udfInputType
protected final org.apache.flink.table.types.logical.RowType udfInputTypeThe user-defined function input logical type. -
udfOutputType
protected final org.apache.flink.table.types.logical.RowType udfOutputTypeThe user-defined function output logical type. -
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 baisReusable InputStream used to holding the execution results to be deserialized. -
baisWrapper
protected transient org.apache.flink.core.memory.DataInputViewStreamWrapper baisWrapperInputStream Wrapper. -
baos
protected transient org.apache.flink.core.memory.ByteArrayOutputStreamWithPos baosReusable OutputStream used to holding the serialized input elements. -
baosWrapper
protected transient org.apache.flink.core.memory.DataOutputViewStreamWrapper baosWrapperOutputStream Wrapper.
-
-
Constructor Details
-
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 Details
-
open
- 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
Description copied from class:AbstractExternalPythonFunctionOperatorCreates thePythonFunctionRunnerwhich is responsible for Python user-defined function execution.- Specified by:
createPythonFunctionRunnerin classAbstractExternalPythonFunctionOperator<OUT>- Throws:
IOException
-
bufferInput
Buffers the specified input, it will be used to construct the operator result together with the user-defined function execution result.- Throws:
Exception
-
getFunctionInput
-
createUserDefinedFunctionsProto
Gets the proto representation of the Python user-defined functions to be executed. -
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) -
processElementInternal
- Throws:
Exception
-