public class PythonStreamGroupAggregateOperator extends AbstractOneInputPythonFunctionOperator<org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData> implements org.apache.flink.streaming.api.operators.Triggerable<org.apache.flink.table.data.RowData,org.apache.flink.runtime.state.VoidNamespace>, org.apache.flink.table.runtime.functions.CleanupState
| 限定符和类型 | 字段和说明 |
|---|---|
protected static String |
FLINK_AGGREGATE_FUNCTION_SCHEMA_CODER_URN |
protected org.apache.flink.table.types.logical.RowType |
inputType
The input logical type.
|
protected static byte |
NORMAL_RECORD |
protected org.apache.flink.table.types.logical.RowType |
outputType
The output logical type.
|
protected static String |
STREAM_GROUP_AGGREGATE_URN |
protected org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> |
udfInputTypeSerializer
The TypeSerializer for udf input elements.
|
protected org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> |
udfOutputTypeSerializer
The TypeSerializer for udf execution results.
|
protected org.apache.flink.table.types.logical.RowType |
userDefinedFunctionInputType
The user-defined function input logical type.
|
elementCount, maxBundleSize, pythonFunctionRunner| 构造器和说明 |
|---|
PythonStreamGroupAggregateOperator(org.apache.flink.configuration.Configuration config,
org.apache.flink.table.types.logical.RowType inputType,
org.apache.flink.table.types.logical.RowType outputType,
org.apache.flink.table.functions.python.PythonAggregateFunctionInfo[] aggregateFunctions,
org.apache.flink.table.planner.typeutils.DataViewUtils.DataViewSpec[][] dataViewSpecs,
int[] grouping,
int indexOfCountStar,
boolean countStarInserted,
boolean generateUpdateBefore,
long minRetentionTime,
long maxRetentionTime) |
| 限定符和类型 | 方法和说明 |
|---|---|
PythonFunctionRunner |
createPythonFunctionRunner()
Creates the
PythonFunctionRunner which is responsible for Python user-defined
function execution. |
void |
emitResult(org.apache.flink.api.java.tuple.Tuple2<byte[],Integer> resultTuple)
Sends the execution result to the downstream operator.
|
Object |
getCurrentKey() |
protected org.apache.flink.api.common.typeutils.TypeSerializer |
getKeySerializer() |
protected org.apache.flink.table.types.logical.RowType |
getKeyType() |
org.apache.flink.table.functions.python.PythonEnv |
getPythonEnv()
Returns the
PythonEnv used to create PythonEnvironmentManager.. |
FlinkFnApi.UserDefinedAggregateFunctions |
getUserDefinedFunctionsProto()
Gets the proto representation of the Python user-defined aggregate functions to be executed.
|
void |
onEventTime(org.apache.flink.streaming.api.operators.InternalTimer<org.apache.flink.table.data.RowData,org.apache.flink.runtime.state.VoidNamespace> timer)
Invoked when an event-time timer fires.
|
void |
onProcessingTime(org.apache.flink.streaming.api.operators.InternalTimer<org.apache.flink.table.data.RowData,org.apache.flink.runtime.state.VoidNamespace> timer)
Invoked when a processing-time timer fires.
|
void |
open() |
void |
processElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<org.apache.flink.table.data.RowData> element) |
void |
setCurrentKey(Object key)
As the beam state gRPC service will access the KeyedStateBackend in parallel with this
operator, we must override this method to prevent changing the current key of the
KeyedStateBackend while the beam service is handling requests.
|
endInputcheckInvokeFinishBundleByCount, close, createPythonEnvironmentManager, dispose, emitResults, getConfig, getFlinkMetricContainer, getPythonConfig, invokeFinishBundle, isBundleFinished, prepareSnapshotPreBarrier, processWatermark, setPythonConfiggetChainingStrategy, getContainingTask, 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, snapshotStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, dispose, getMetricGroup, getOperatorID, initializeState, prepareSnapshotPreBarrier, setKeyContextElement1, setKeyContextElement2, snapshotState@VisibleForTesting protected static final String FLINK_AGGREGATE_FUNCTION_SCHEMA_CODER_URN
@VisibleForTesting protected static final String STREAM_GROUP_AGGREGATE_URN
@VisibleForTesting protected static final byte NORMAL_RECORD
protected final org.apache.flink.table.types.logical.RowType inputType
protected final org.apache.flink.table.types.logical.RowType outputType
protected transient org.apache.flink.table.types.logical.RowType userDefinedFunctionInputType
protected transient org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> udfOutputTypeSerializer
protected transient org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> udfInputTypeSerializer
public PythonStreamGroupAggregateOperator(org.apache.flink.configuration.Configuration config,
org.apache.flink.table.types.logical.RowType inputType,
org.apache.flink.table.types.logical.RowType outputType,
org.apache.flink.table.functions.python.PythonAggregateFunctionInfo[] aggregateFunctions,
org.apache.flink.table.planner.typeutils.DataViewUtils.DataViewSpec[][] dataViewSpecs,
int[] grouping,
int indexOfCountStar,
boolean countStarInserted,
boolean generateUpdateBefore,
long minRetentionTime,
long maxRetentionTime)
public void setCurrentKey(Object key)
setCurrentKey 在接口中 org.apache.flink.streaming.api.operators.KeyContextsetCurrentKey 在类中 org.apache.flink.streaming.api.operators.AbstractStreamOperator<org.apache.flink.table.data.RowData>public Object getCurrentKey()
getCurrentKey 在接口中 org.apache.flink.streaming.api.operators.KeyContextgetCurrentKey 在类中 org.apache.flink.streaming.api.operators.AbstractStreamOperator<org.apache.flink.table.data.RowData>public void open()
throws Exception
open 在接口中 org.apache.flink.streaming.api.operators.StreamOperator<org.apache.flink.table.data.RowData>open 在类中 AbstractPythonFunctionOperator<org.apache.flink.table.data.RowData>Exceptionpublic PythonFunctionRunner createPythonFunctionRunner() throws Exception
AbstractPythonFunctionOperatorPythonFunctionRunner which is responsible for Python user-defined
function execution.createPythonFunctionRunner 在类中 AbstractPythonFunctionOperator<org.apache.flink.table.data.RowData>Exceptionpublic void processElement(org.apache.flink.streaming.runtime.streamrecord.StreamRecord<org.apache.flink.table.data.RowData> element)
throws Exception
processElement 在接口中 org.apache.flink.streaming.api.operators.Input<org.apache.flink.table.data.RowData>Exceptionpublic void emitResult(org.apache.flink.api.java.tuple.Tuple2<byte[],Integer> resultTuple) throws Exception
AbstractPythonFunctionOperatoremitResult 在类中 AbstractPythonFunctionOperator<org.apache.flink.table.data.RowData>Exceptionpublic void onEventTime(org.apache.flink.streaming.api.operators.InternalTimer<org.apache.flink.table.data.RowData,org.apache.flink.runtime.state.VoidNamespace> timer)
onEventTime 在接口中 org.apache.flink.streaming.api.operators.Triggerable<org.apache.flink.table.data.RowData,org.apache.flink.runtime.state.VoidNamespace>public void onProcessingTime(org.apache.flink.streaming.api.operators.InternalTimer<org.apache.flink.table.data.RowData,org.apache.flink.runtime.state.VoidNamespace> timer)
throws Exception
onProcessingTime 在接口中 org.apache.flink.streaming.api.operators.Triggerable<org.apache.flink.table.data.RowData,org.apache.flink.runtime.state.VoidNamespace>Exceptionpublic org.apache.flink.table.functions.python.PythonEnv getPythonEnv()
AbstractPythonFunctionOperatorPythonEnv used to create PythonEnvironmentManager..getPythonEnv 在类中 AbstractPythonFunctionOperator<org.apache.flink.table.data.RowData>@VisibleForTesting protected org.apache.flink.api.common.typeutils.TypeSerializer getKeySerializer()
protected org.apache.flink.table.types.logical.RowType getKeyType()
public FlinkFnApi.UserDefinedAggregateFunctions getUserDefinedFunctionsProto()
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.