public final class TopNRecordsCombiner extends Object implements RecordsCombiner
RecordsCombiner that save topN records of incremental input records
into the window state.| 限定符和类型 | 类和说明 |
|---|---|
static class |
TopNRecordsCombiner.Factory
Factory to create
TopNRecordsCombiner. |
RecordsCombiner.LocalFactory| 构造器和说明 |
|---|
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) |
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)
public void combine(WindowKey windowKey, Iterator<org.apache.flink.table.data.RowData> records) throws Exception
RecordsCombinercombine 在接口中 RecordsCombinerwindowKey - the window-key pair that the buffered data belong to, the window-key object
is reused.records - the buffered data, the iterator and RowData objects are reused.Exceptionpublic void close()
throws Exception
RecordsCombinerclose 在接口中 RecordsCombinerExceptionCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.