Class RetractableTopNFunction
java.lang.Object
org.apache.flink.api.common.functions.AbstractRichFunction
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>
org.apache.flink.table.runtime.operators.rank.AbstractTopNFunction
org.apache.flink.table.runtime.operators.rank.AbstractSyncStateTopNFunction
org.apache.flink.table.runtime.operators.rank.RetractableTopNFunction
- All Implemented Interfaces:
Serializable,org.apache.flink.api.common.functions.Function,org.apache.flink.api.common.functions.RichFunction
A TopN function could handle updating stream.
Input stream can contain any change kind: INSERT, DELETE, UPDATE_BEFORE and UPDATE_AFTER.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.flink.table.runtime.operators.rank.AbstractTopNFunction
AbstractTopNFunction.AbstractTopNHelperNested classes/interfaces inherited from class org.apache.flink.streaming.api.functions.KeyedProcessFunction
org.apache.flink.streaming.api.functions.KeyedProcessFunction.Context, org.apache.flink.streaming.api.functions.KeyedProcessFunction.OnTimerContext -
Field Summary
Fields inherited from class org.apache.flink.table.runtime.operators.rank.AbstractSyncStateTopNFunction
rankEndFields inherited from class org.apache.flink.table.runtime.operators.rank.AbstractTopNFunction
constantRankEnd, hitCount, inputRowType, invalidCounter, isConstantRankEnd, keyContext, outputRankNumber, rankEndFetcher, rankStart, requestCount, sortKeyComparator, sortKeySelector, ttlConfig -
Constructor Summary
ConstructorsConstructorDescriptionRetractableTopNFunction(org.apache.flink.api.common.state.StateTtlConfig ttlConfig, InternalTypeInfo<org.apache.flink.table.data.RowData> inputRowType, ComparableRecordComparator comparableRecordComparator, RowDataKeySelector sortKeySelector, RankType rankType, RankRange rankRange, GeneratedRecordEqualiser generatedEqualiser, boolean generateUpdateBefore, boolean outputRankNumber) -
Method Summary
Modifier and TypeMethodDescriptionvoidopen(org.apache.flink.api.common.functions.OpenContext openContext) voidprocessElement(org.apache.flink.table.data.RowData input, 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>.org.apache.flink.streaming.api.functions.KeyedProcessFunction.Context ctx, org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out) Methods inherited from class org.apache.flink.table.runtime.operators.rank.AbstractSyncStateTopNFunction
collectDelete, collectInsert, collectUpdateAfter, collectUpdateBefore, initRankEnd, isInRankEnd, isInRankRangeMethods inherited from class org.apache.flink.table.runtime.operators.rank.AbstractTopNFunction
checkSortKeyInBufferRange, collectDelete, collectDelete, collectInsert, collectInsert, collectUpdateAfter, collectUpdateAfter, collectUpdateBefore, collectUpdateBefore, getDefaultTopNSize, hasOffset, isInRankRange, registerMetric, registerMetric, setKeyContextMethods inherited from class org.apache.flink.streaming.api.functions.KeyedProcessFunction
onTimerMethods inherited from class org.apache.flink.api.common.functions.AbstractRichFunction
close, getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
-
Constructor Details
-
RetractableTopNFunction
public RetractableTopNFunction(org.apache.flink.api.common.state.StateTtlConfig ttlConfig, InternalTypeInfo<org.apache.flink.table.data.RowData> inputRowType, ComparableRecordComparator comparableRecordComparator, RowDataKeySelector sortKeySelector, RankType rankType, RankRange rankRange, GeneratedRecordEqualiser generatedEqualiser, boolean generateUpdateBefore, boolean outputRankNumber)
-
-
Method Details
-
open
- Specified by:
openin interfaceorg.apache.flink.api.common.functions.RichFunction- Overrides:
openin classAbstractSyncStateTopNFunction- Throws:
Exception
-
processElement
public void processElement(org.apache.flink.table.data.RowData input, org.apache.flink.streaming.api.functions.KeyedProcessFunction<org.apache.flink.table.data.RowData, org.apache.flink.table.data.RowData, throws Exceptionorg.apache.flink.table.data.RowData>.org.apache.flink.streaming.api.functions.KeyedProcessFunction.Context ctx, org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out) - Specified by:
processElementin classorg.apache.flink.streaming.api.functions.KeyedProcessFunction<org.apache.flink.table.data.RowData,org.apache.flink.table.data.RowData, org.apache.flink.table.data.RowData> - Throws:
Exception
-