public class BinaryInMemorySortBuffer extends BinaryIndexedSortable implements SortBuffer
BinaryInMemorySortBuffer
instead of extended because it's a final class.
The main differences in the new sort buffer are:
currentSortIndexOffset, currentSortIndexSegment, indexEntrySize, lastIndexEntryOffset, memorySegmentPool, numRecords, OFFSET_LEN, recordBuffer, row1, serializer, serializer1, sortIndex
Modifier and Type | Method and Description |
---|---|
void |
clear()
We add clear() method here instead of reset() to release all memory segments.
|
static BinaryInMemorySortBuffer |
createBuffer(NormalizedKeyComputer normalizedKeyComputer,
org.apache.flink.table.runtime.typeutils.AbstractRowDataSerializer<org.apache.flink.table.data.RowData> serializer,
RecordComparator comparator,
org.apache.flink.table.runtime.util.MemorySegmentPool memoryPool)
Create a memory sorter in `insert` way.
|
boolean |
flushMemory()
Flush memory, return false if not supported.
|
int |
getBufferSegmentCount() |
long |
getOccupancy() |
org.apache.flink.util.MutableObjectIterator<org.apache.flink.table.data.binary.BinaryRowData> |
sortedIterator() |
boolean |
write(org.apache.flink.table.data.RowData 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, org.apache.flink.table.runtime.typeutils.AbstractRowDataSerializer<org.apache.flink.table.data.RowData> serializer, RecordComparator comparator, org.apache.flink.table.runtime.util.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(org.apache.flink.table.data.RowData 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 org.apache.flink.util.MutableObjectIterator<org.apache.flink.table.data.binary.BinaryRowData> sortedIterator()
sortedIterator
in interface SortBuffer
Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.