Class TopNRecordsCombiner
java.lang.Object
org.apache.flink.table.runtime.operators.rank.window.combines.TopNRecordsCombiner
- All Implemented Interfaces:
RecordsCombiner
An implementation of
RecordsCombiner that save topN records of incremental input records
into the window state.-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.apache.flink.table.runtime.operators.window.tvf.combines.RecordsCombiner
RecordsCombiner.LocalFactory -
Constructor Summary
ConstructorsConstructorDescriptionTopNRecordsCombiner(WindowTimerService<Long> timerService, StateKeyContext keyContext, WindowMapState<Long, List<org.apache.flink.table.data.RowData>> dataState, Comparator<org.apache.flink.table.data.RowData> sortKeyComparator, org.apache.flink.api.java.functions.KeySelector<org.apache.flink.table.data.RowData, org.apache.flink.table.data.RowData> sortKeySelector, long topN, org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> recordSerializer, boolean isEventTime) -
Method Summary
-
Constructor Details
-
TopNRecordsCombiner
public TopNRecordsCombiner(WindowTimerService<Long> timerService, StateKeyContext keyContext, WindowMapState<Long, List<org.apache.flink.table.data.RowData>> dataState, Comparator<org.apache.flink.table.data.RowData> sortKeyComparator, org.apache.flink.api.java.functions.KeySelector<org.apache.flink.table.data.RowData, org.apache.flink.table.data.RowData> sortKeySelector, long topN, org.apache.flink.api.common.typeutils.TypeSerializer<org.apache.flink.table.data.RowData> recordSerializer, boolean isEventTime)
-
-
Method Details
-
combine
public void combine(WindowKey windowKey, Iterator<org.apache.flink.table.data.RowData> records) throws Exception Description copied from interface:RecordsCombinerCombines the buffered data into state based on the given window-key pair.- Specified by:
combinein interfaceRecordsCombiner- Parameters:
windowKey- the window-key pair that the buffered data belong to, the window-key object is reused.records- the buffered data, the iterator andRowDataobjects are reused.- Throws:
Exception
-
close
Description copied from interface:RecordsCombinerRelease resources allocated by this combine function.- Specified by:
closein interfaceRecordsCombiner- Throws:
Exception
-