public final class TopNRecordsCombiner extends Object implements RecordsCombiner
RecordsCombiner
that save topN records of incremental input records
into the window state.Modifier and Type | Class and Description |
---|---|
static class |
TopNRecordsCombiner.Factory
Factory to create
TopNRecordsCombiner . |
RecordsCombiner.LocalFactory
Constructor and Description |
---|
TopNRecordsCombiner(WindowTimerService<Long> timerService,
StateKeyContext keyContext,
WindowMapState<Long,List<RowData>> dataState,
Comparator<RowData> sortKeyComparator,
KeySelector<RowData,RowData> sortKeySelector,
long topN,
TypeSerializer<RowData> recordSerializer,
boolean isEventTime) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Release resources allocated by this combine function.
|
void |
combine(WindowKey windowKey,
Iterator<RowData> records)
Combines the buffered data into state based on the given window-key pair.
|
public TopNRecordsCombiner(WindowTimerService<Long> timerService, StateKeyContext keyContext, WindowMapState<Long,List<RowData>> dataState, Comparator<RowData> sortKeyComparator, KeySelector<RowData,RowData> sortKeySelector, long topN, TypeSerializer<RowData> recordSerializer, boolean isEventTime)
public void combine(WindowKey windowKey, Iterator<RowData> records) throws Exception
RecordsCombiner
combine
in interface RecordsCombiner
windowKey
- 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.Exception
public void close() throws Exception
RecordsCombiner
close
in interface RecordsCombiner
Exception
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.