Class AppendOnlyTopNHelper
java.lang.Object
org.apache.flink.table.runtime.operators.rank.AbstractTopNFunction.AbstractTopNHelper
org.apache.flink.table.runtime.operators.rank.utils.AppendOnlyTopNHelper
A helper to help do the logic 'Top-n' for append-only stream in
AppendOnlyTopNFunction
and AsyncStateAppendOnlyTopNFunction.-
Field Summary
Fields inherited from class org.apache.flink.table.runtime.operators.rank.AbstractTopNFunction.AbstractTopNHelper
keyContext, outputRankNumber, sortKeyComparator, sortKeySelector, topNFunction, ttlConfig -
Constructor Summary
ConstructorsConstructorDescriptionAppendOnlyTopNHelper(AbstractTopNFunction topNFunction, long cacheSize, long topNSize) -
Method Summary
Modifier and TypeMethodDescriptiongetTopNBufferFromCache(org.apache.flink.table.data.RowData currentKey) voidprocessElementWithoutRowNumber(TopNBuffer buffer, org.apache.flink.table.data.RowData input, long rankEnd, org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out) voidprocessElementWithRowNumber(TopNBuffer buffer, org.apache.flink.table.data.RowData sortKey, org.apache.flink.table.data.RowData input, long rankEnd, org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out) The without-number-algorithm can't handle topN with offset, so use the with-number-algorithm to handle offset.voidprotected abstract voidremoveFromState(org.apache.flink.table.data.RowData key) voidsaveTopNBufferToCache(org.apache.flink.table.data.RowData currentKey, TopNBuffer topNBuffer) protected abstract voidupdateState(org.apache.flink.table.data.RowData key, List<org.apache.flink.table.data.RowData> value) Methods inherited from class org.apache.flink.table.runtime.operators.rank.AbstractTopNFunction.AbstractTopNHelper
accHitCount, accRequestCount, collectDelete, collectDelete, collectInsert, collectInsert, collectUpdateAfter, collectUpdateAfter, collectUpdateBefore, collectUpdateBefore, isInRankEnd, registerMetric
-
Constructor Details
-
AppendOnlyTopNHelper
-
-
Method Details
-
registerMetric
public void registerMetric() -
getTopNBufferFromCache
-
saveTopNBufferToCache
public void saveTopNBufferToCache(org.apache.flink.table.data.RowData currentKey, TopNBuffer topNBuffer) -
processElementWithRowNumber
public void processElementWithRowNumber(TopNBuffer buffer, org.apache.flink.table.data.RowData sortKey, org.apache.flink.table.data.RowData input, long rankEnd, org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out) throws Exception The without-number-algorithm can't handle topN with offset, so use the with-number-algorithm to handle offset.- Throws:
Exception
-
processElementWithoutRowNumber
public void processElementWithoutRowNumber(TopNBuffer buffer, org.apache.flink.table.data.RowData input, long rankEnd, org.apache.flink.util.Collector<org.apache.flink.table.data.RowData> out) throws Exception - Throws:
Exception
-
removeFromState
- Throws:
Exception
-
updateState
protected abstract void updateState(org.apache.flink.table.data.RowData key, List<org.apache.flink.table.data.RowData> value) throws Exception - Throws:
Exception
-