Class AbstractSyncStateTopNFunction
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
- All Implemented Interfaces:
Serializable,org.apache.flink.api.common.functions.Function,org.apache.flink.api.common.functions.RichFunction
- Direct Known Subclasses:
AppendOnlyFirstNFunction,AppendOnlyTopNFunction,FastTop1Function,RetractableTopNFunction,UpdatableTopNFunction
Base class for TopN Function with sync state api.
- 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
FieldsFields 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
ConstructorsConstructorDescriptionAbstractSyncStateTopNFunction(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) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcollectDelete(org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out, org.apache.flink.table.data.RowData inputRow, long rank) protected voidcollectInsert(org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out, org.apache.flink.table.data.RowData inputRow, long rank) protected voidcollectUpdateAfter(org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out, org.apache.flink.table.data.RowData inputRow, long rank) protected voidcollectUpdateBefore(org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out, org.apache.flink.table.data.RowData inputRow, long rank) protected longinitRankEnd(org.apache.flink.table.data.RowData row) Initialize rank end.protected booleanisInRankEnd(long rank) protected booleanisInRankRange(long rank) voidopen(org.apache.flink.api.common.functions.OpenContext openContext) Methods 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
onTimer, processElementMethods inherited from class org.apache.flink.api.common.functions.AbstractRichFunction
close, getIterationRuntimeContext, getRuntimeContext, setRuntimeContext
-
Field Details
-
rankEnd
protected long rankEnd
-
-
Constructor Details
-
AbstractSyncStateTopNFunction
public AbstractSyncStateTopNFunction(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)
-
-
Method Details
-
open
- Specified by:
openin interfaceorg.apache.flink.api.common.functions.RichFunction- Overrides:
openin classAbstractTopNFunction- Throws:
Exception
-
initRankEnd
Initialize rank end.- Parameters:
row- input record- Returns:
- rank end
- Throws:
Exception
-
isInRankEnd
protected boolean isInRankEnd(long rank) -
isInRankRange
protected boolean isInRankRange(long rank) -
collectInsert
protected void collectInsert(org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out, org.apache.flink.table.data.RowData inputRow, long rank) -
collectDelete
protected void collectDelete(org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out, org.apache.flink.table.data.RowData inputRow, long rank) -
collectUpdateAfter
protected void collectUpdateAfter(org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out, org.apache.flink.table.data.RowData inputRow, long rank) -
collectUpdateBefore
protected void collectUpdateBefore(org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out, org.apache.flink.table.data.RowData inputRow, long rank)
-