public class BinaryInMemorySortBuffer extends BinaryIndexedSortable implements SortBuffer
clear()
: Clean all memory.
tryInitialize()
: initialize memory before write and read in buffer.
currentSortIndexOffset, currentSortIndexSegment, indexEntrySize, lastIndexEntryOffset, memorySegmentPool, numRecords, OFFSET_LEN, recordBuffer, row1, serializer, serializer1, sortIndex
Modifier and Type | Method and Description |
---|---|
void |
clear() |
static BinaryInMemorySortBuffer |
createBuffer(NormalizedKeyComputer normalizedKeyComputer,
AbstractRowDataSerializer<InternalRow> serializer,
RecordComparator comparator,
MemorySegmentPool memoryPool)
Create a memory sorter in `insert` way.
|
boolean |
flushMemory()
Flush memory, return false if not supported.
|
int |
getBufferSegmentCount() |
long |
getOccupancy() |
MutableObjectIterator<BinaryRow> |
sortedIterator() |
boolean |
write(InternalRow record)
Writes a given record to this sort buffer.
|
checkNextIndexOffset, compare, compare, nextMemorySegment, recordSize, recordsPerSegment, size, swap, swap, writeIndexAndNormalizedKey, writeToOutput
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
size
public static BinaryInMemorySortBuffer createBuffer(NormalizedKeyComputer normalizedKeyComputer, AbstractRowDataSerializer<InternalRow> serializer, RecordComparator comparator, MemorySegmentPool memoryPool)
public int getBufferSegmentCount()
public void clear()
clear
in interface SortBuffer
public long getOccupancy()
getOccupancy
in interface SortBuffer
public boolean flushMemory()
SortBuffer
flushMemory
in interface SortBuffer
public boolean write(InternalRow record) throws IOException
write
in interface SortBuffer
record
- The record to be written.IOException
- Thrown, if an error occurred while serializing the record into the
buffers.public final MutableObjectIterator<BinaryRow> sortedIterator()
sortedIterator
in interface SortBuffer
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.