public final class BinaryInMemorySortBuffer extends BinaryIndexedSortable
currentSortIndexOffset, currentSortIndexSegment, indexEntrySize, lastIndexEntryOffset, memorySegmentPool, numRecords, OFFSET_LEN, recordBuffer, row1, serializer, serializer1, sortIndex
Modifier and Type | Method and Description |
---|---|
static BinaryInMemorySortBuffer |
createBuffer(NormalizedKeyComputer normalizedKeyComputer,
AbstractRowDataSerializer<RowData> inputSerializer,
BinaryRowDataSerializer serializer,
RecordComparator comparator,
MemorySegmentPool memoryPool)
Create a memory sorter in `insert` way.
|
void |
dispose() |
long |
getCapacity() |
MutableObjectIterator<BinaryRowData> |
getIterator()
Gets an iterator over all records in this buffer in their logical order.
|
long |
getOccupancy() |
boolean |
isEmpty()
Checks whether the buffer is empty.
|
void |
reset()
Resets the sort buffer back to the state where it is empty.
|
void |
returnToSegmentPool() |
boolean |
write(RowData record)
Writes a given record to this sort buffer.
|
checkNextIndexOffset, compare, compare, nextMemorySegment, recordSize, recordsPerSegment, size, swap, swap, writeIndexAndNormalizedKey, writeToOutput
public static BinaryInMemorySortBuffer createBuffer(NormalizedKeyComputer normalizedKeyComputer, AbstractRowDataSerializer<RowData> inputSerializer, BinaryRowDataSerializer serializer, RecordComparator comparator, MemorySegmentPool memoryPool)
public void reset()
public void returnToSegmentPool()
public boolean isEmpty()
public void dispose()
public long getCapacity()
public long getOccupancy()
public boolean write(RowData record) throws IOException
record
- The record to be written.IOException
- Thrown, if an error occurred while serializing the record into the
buffers.public MutableObjectIterator<BinaryRowData> getIterator()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.