public class FastTop1Function extends AbstractTopNFunction implements org.apache.flink.streaming.api.checkpoint.CheckpointedFunction
AppendOnlyTopNFunction and UpdatableTopNFunction when only Top-1 is desired. This function can handle updating stream
because the RankProcessStrategy is inferred as UpdateFastStrategy, i.e., 1) the upsert key of
input steam contains partition key; 2) the sort field is updated monotonely under the upsert key.hitCount, inputRowType, keyContext, outputRankNumber, rankEnd, requestCount, sortKeyComparator, sortKeySelector, ttlConfig| Constructor and Description |
|---|
FastTop1Function(org.apache.flink.api.common.state.StateTtlConfig ttlConfig,
InternalTypeInfo<org.apache.flink.table.data.RowData> inputRowType,
GeneratedRecordComparator generatedSortKeyComparator,
RowDataKeySelector sortKeySelector,
RankType rankType,
RankRange rankRange,
boolean generateUpdateBefore,
boolean outputRankNumber,
long cacheSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
initializeState(org.apache.flink.runtime.state.FunctionInitializationContext context) |
void |
open(org.apache.flink.api.common.functions.OpenContext openContext) |
void |
processElement(org.apache.flink.table.data.RowData input,
org.apache.flink.streaming.api.functions.KeyedProcessFunction.Context ctx,
org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out) |
void |
snapshotState(org.apache.flink.runtime.state.FunctionSnapshotContext context) |
checkSortKeyInBufferRange, collectDelete, collectDelete, collectInsert, collectInsert, collectUpdateAfter, collectUpdateAfter, collectUpdateBefore, collectUpdateBefore, getDefaultTopNSize, hasOffset, initRankEnd, isInRankEnd, isInRankRange, registerMetric, setKeyContextpublic FastTop1Function(org.apache.flink.api.common.state.StateTtlConfig ttlConfig,
InternalTypeInfo<org.apache.flink.table.data.RowData> inputRowType,
GeneratedRecordComparator generatedSortKeyComparator,
RowDataKeySelector sortKeySelector,
RankType rankType,
RankRange rankRange,
boolean generateUpdateBefore,
boolean outputRankNumber,
long cacheSize)
public void open(org.apache.flink.api.common.functions.OpenContext openContext)
throws Exception
open in interface org.apache.flink.api.common.functions.RichFunctionopen in class AbstractTopNFunctionExceptionpublic void processElement(org.apache.flink.table.data.RowData input,
org.apache.flink.streaming.api.functions.KeyedProcessFunction.Context ctx,
org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out)
throws Exception
processElement in class org.apache.flink.streaming.api.functions.KeyedProcessFunction<org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData>Exceptionpublic void snapshotState(org.apache.flink.runtime.state.FunctionSnapshotContext context)
throws Exception
snapshotState in interface org.apache.flink.streaming.api.checkpoint.CheckpointedFunctionExceptionCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.