public class BufferedKVExternalSorter extends Object
For Hash Aggregation:We store the data in MemorySegmentHashTable in KeyValue format. When memory is not enough, we spill all the data in memory onto disk and degenerate it into Sort Aggregation. So we need a BufferedKVExternalSorter to write the data that already in memory to disk, and then carry out SortMerge.
Constructor and Description |
---|
BufferedKVExternalSorter(IOManager ioManager,
BinaryRowDataSerializer keySerializer,
BinaryRowDataSerializer valueSerializer,
NormalizedKeyComputer nKeyComputer,
RecordComparator comparator,
int pageSize,
int maxNumFileHandles,
boolean compressionEnabled,
int compressionBlockSize) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
MutableObjectIterator<Tuple2<BinaryRowData,BinaryRowData>> |
getKVIterator() |
void |
sortAndSpill(ArrayList<MemorySegment> recordBufferSegments,
long numElements,
MemorySegmentPool pool) |
public BufferedKVExternalSorter(IOManager ioManager, BinaryRowDataSerializer keySerializer, BinaryRowDataSerializer valueSerializer, NormalizedKeyComputer nKeyComputer, RecordComparator comparator, int pageSize, int maxNumFileHandles, boolean compressionEnabled, int compressionBlockSize)
public MutableObjectIterator<Tuple2<BinaryRowData,BinaryRowData>> getKVIterator() throws IOException
IOException
public void sortAndSpill(ArrayList<MemorySegment> recordBufferSegments, long numElements, MemorySegmentPool pool) throws IOException
IOException
public void close()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.