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,
AbstractRowSerializer<BaseRow> inputSerializer,
BinaryRowSerializer serializer,
RecordComparator comparator,
List<MemorySegment> memory)
Create a memory sorter in `insert` way.
|
void |
dispose() |
long |
getCapacity() |
MutableObjectIterator<BinaryRow> |
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(BaseRow 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, AbstractRowSerializer<BaseRow> inputSerializer, BinaryRowSerializer serializer, RecordComparator comparator, List<MemorySegment> memory) throws IOException
IOException
public void reset()
public void returnToSegmentPool()
public boolean isEmpty()
public void dispose()
public long getCapacity()
public long getOccupancy()
public boolean write(BaseRow record) throws IOException
record
- The record to be written.IOException
- Thrown, if an error occurred while serializing the record into the buffers.public final MutableObjectIterator<BinaryRow> getIterator()
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.