@Internal
public abstract class AbstractPythonStatelessFunctionFlatMap
extends org.apache.flink.api.common.functions.RichFlatMapFunction<org.apache.flink.types.Row,org.apache.flink.types.Row>
implements org.apache.flink.api.java.typeutils.ResultTypeQueryable<org.apache.flink.types.Row>
RichFlatMapFunction
used to invoke Python stateless functions for
the old planner.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 LinkedBlockingQueue<org.apache.flink.types.Row> |
forwardedInputQueue
The queue holding the input elements for which the execution results have not been received.
|
protected org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.types.Row> |
forwardedInputSerializer
The type serializer for the forwarded fields.
|
protected org.apache.flink.table.types.logical.RowType |
inputType
The input logical type.
|
protected Map<String,String> |
jobOptions
The options used to configure the Python worker process.
|
protected org.apache.flink.table.types.logical.RowType |
outputType
The output logical type.
|
protected PythonFunctionRunner |
pythonFunctionRunner
The
PythonFunctionRunner which is responsible for Python user-defined function
execution. |
protected org.apache.flink.util.Collector<org.apache.flink.types.Row> |
resultCollector
The collector used to collect records.
|
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.
|
Constructor and Description |
---|
AbstractPythonStatelessFunctionFlatMap(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(org.apache.flink.types.Row input) |
protected void |
checkInvokeFinishBundleByCount()
Checks whether to invoke finishBundle by elements count.
|
void |
close() |
protected PythonEnvironmentManager |
createPythonEnvironmentManager() |
abstract void |
emitResult(org.apache.flink.api.java.tuple.Tuple2<byte[],Integer> resultTuple) |
void |
flatMap(org.apache.flink.types.Row value,
org.apache.flink.util.Collector<org.apache.flink.types.Row> out) |
protected FlinkMetricContainer |
getFlinkMetricContainer() |
abstract int |
getForwardedFieldsCount() |
protected org.apache.flink.types.Row |
getFunctionInput(org.apache.flink.types.Row element) |
abstract String |
getFunctionUrn() |
abstract String |
getInputOutputCoderUrn() |
org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> |
getProducedType() |
protected PythonConfig |
getPythonConfig() |
abstract org.apache.flink.table.functions.python.PythonEnv |
getPythonEnv()
Returns the
PythonEnv used to create PythonEnvironmentManager.. |
abstract FlinkFnApi.UserDefinedFunctions |
getUserDefinedFunctionsProto()
Gets the proto representation of the Python user-defined functions to be executed.
|
protected void |
invokeFinishBundle() |
void |
open(org.apache.flink.configuration.Configuration parameters) |
abstract void |
processElementInternal(org.apache.flink.types.Row value) |
protected final org.apache.flink.table.types.logical.RowType inputType
protected final org.apache.flink.table.types.logical.RowType outputType
protected final Map<String,String> jobOptions
protected transient org.apache.flink.table.types.logical.RowType userDefinedFunctionInputType
protected transient org.apache.flink.table.types.logical.RowType userDefinedFunctionOutputType
protected transient LinkedBlockingQueue<org.apache.flink.types.Row> forwardedInputQueue
protected transient org.apache.flink.util.Collector<org.apache.flink.types.Row> resultCollector
protected transient PythonFunctionRunner pythonFunctionRunner
PythonFunctionRunner
which is responsible for Python user-defined function
execution.protected transient org.apache.flink.core.memory.ByteArrayInputStreamWithPos bais
protected transient org.apache.flink.core.memory.DataInputViewStreamWrapper baisWrapper
protected transient org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.types.Row> forwardedInputSerializer
protected transient org.apache.flink.core.memory.ByteArrayOutputStreamWithPos baos
public AbstractPythonStatelessFunctionFlatMap(org.apache.flink.configuration.Configuration config, org.apache.flink.table.types.logical.RowType inputType, org.apache.flink.table.types.logical.RowType outputType, int[] userDefinedFunctionInputOffsets)
protected PythonConfig getPythonConfig()
public void open(org.apache.flink.configuration.Configuration parameters) throws Exception
open
in interface org.apache.flink.api.common.functions.RichFunction
open
in class org.apache.flink.api.common.functions.AbstractRichFunction
Exception
public void flatMap(org.apache.flink.types.Row value, org.apache.flink.util.Collector<org.apache.flink.types.Row> out) throws Exception
flatMap
in interface org.apache.flink.api.common.functions.FlatMapFunction<org.apache.flink.types.Row,org.apache.flink.types.Row>
flatMap
in class org.apache.flink.api.common.functions.RichFlatMapFunction<org.apache.flink.types.Row,org.apache.flink.types.Row>
Exception
public org.apache.flink.api.common.typeinfo.TypeInformation<org.apache.flink.types.Row> getProducedType()
getProducedType
in interface org.apache.flink.api.java.typeutils.ResultTypeQueryable<org.apache.flink.types.Row>
public void close() throws Exception
close
in interface org.apache.flink.api.common.functions.RichFunction
close
in class org.apache.flink.api.common.functions.AbstractRichFunction
Exception
public abstract org.apache.flink.table.functions.python.PythonEnv getPythonEnv()
PythonEnv
used to create PythonEnvironmentManager..public abstract void bufferInput(org.apache.flink.types.Row input)
public abstract void emitResult(org.apache.flink.api.java.tuple.Tuple2<byte[],Integer> resultTuple) throws Exception
Exception
public abstract int getForwardedFieldsCount()
public abstract FlinkFnApi.UserDefinedFunctions getUserDefinedFunctionsProto()
public abstract String getInputOutputCoderUrn()
public abstract String getFunctionUrn()
public abstract void processElementInternal(org.apache.flink.types.Row value) throws Exception
Exception
protected void checkInvokeFinishBundleByCount() throws Exception
Exception
protected PythonEnvironmentManager createPythonEnvironmentManager() throws IOException
IOException
protected FlinkMetricContainer getFlinkMetricContainer()
protected org.apache.flink.types.Row getFunctionInput(org.apache.flink.types.Row element)
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.