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
public abstract class AbstractSyncStateTopNFunction extends AbstractTopNFunction
Base class for TopN Function with sync state api.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.flink.table.runtime.operators.rank.AbstractTopNFunction
AbstractTopNFunction.AbstractTopNHelper
-
-
Field Summary
Fields Modifier and Type Field Description protected longrankEnd-
Fields 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
Constructors Constructor Description 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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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, setKeyContext
-
Methods inherited from class org.apache.flink.streaming.api.functions.KeyedProcessFunction
onTimer, processElement
-
-
-
-
Constructor Detail
-
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 Detail
-
open
public void open(org.apache.flink.api.common.functions.OpenContext openContext) throws Exception- Specified by:
openin interfaceorg.apache.flink.api.common.functions.RichFunction- Overrides:
openin classAbstractTopNFunction- Throws:
Exception
-
initRankEnd
protected long initRankEnd(org.apache.flink.table.data.RowData row) throws ExceptionInitialize 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)
-
-