Class BinaryIndexedSortable
java.lang.Object
org.apache.flink.table.runtime.operators.sort.BinaryIndexedSortable
- All Implemented Interfaces:
org.apache.flink.runtime.operators.sort.IndexedSortable
- Direct Known Subclasses:
BinaryInMemorySortBuffer,BinaryKVInMemorySortBuffer
public abstract class BinaryIndexedSortable
extends Object
implements org.apache.flink.runtime.operators.sort.IndexedSortable
abstract sortable, provide basic compare and swap. Support writing of index and normalizedKey.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected org.apache.flink.core.memory.MemorySegmentprotected final intprotected final intprotected final MemorySegmentPoolprotected intstatic final intprotected final org.apache.flink.runtime.io.disk.RandomAccessInputViewprotected final org.apache.flink.table.data.binary.BinaryRowDataprotected final BinaryRowDataSerializerprotected final BinaryRowDataSerializerprotected final ArrayList<org.apache.flink.core.memory.MemorySegment> -
Constructor Summary
ConstructorsConstructorDescriptionBinaryIndexedSortable(NormalizedKeyComputer normalizedKeyComputer, BinaryRowDataSerializer serializer, RecordComparator comparator, ArrayList<org.apache.flink.core.memory.MemorySegment> recordBufferSegments, MemorySegmentPool memorySegmentPool) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheck if we need request next index memory.intcompare(int i, int j) intcompare(int segmentNumberI, int segmentOffsetI, int segmentNumberJ, int segmentOffsetJ) protected org.apache.flink.core.memory.MemorySegmentintintintsize()voidswap(int i, int j) voidswap(int segmentNumberI, int segmentOffsetI, int segmentNumberJ, int segmentOffsetJ) protected voidwriteIndexAndNormalizedKey(org.apache.flink.table.data.RowData record, long currOffset) Write of index and normalizedKey.voidwriteToOutput(org.apache.flink.runtime.memory.AbstractPagedOutputView output) Spill: Write all records to aAbstractPagedOutputView.
-
Field Details
-
OFFSET_LEN
public static final int OFFSET_LEN- See Also:
-
serializer
-
recordBuffer
protected final org.apache.flink.runtime.io.disk.RandomAccessInputView recordBuffer -
currentSortIndexSegment
protected org.apache.flink.core.memory.MemorySegment currentSortIndexSegment -
memorySegmentPool
-
sortIndex
-
indexEntrySize
protected final int indexEntrySize -
lastIndexEntryOffset
protected final int lastIndexEntryOffset -
serializer1
-
row1
protected final org.apache.flink.table.data.binary.BinaryRowData row1 -
currentSortIndexOffset
protected int currentSortIndexOffset -
numRecords
protected int numRecords
-
-
Constructor Details
-
BinaryIndexedSortable
public BinaryIndexedSortable(NormalizedKeyComputer normalizedKeyComputer, BinaryRowDataSerializer serializer, RecordComparator comparator, ArrayList<org.apache.flink.core.memory.MemorySegment> recordBufferSegments, MemorySegmentPool memorySegmentPool)
-
-
Method Details
-
nextMemorySegment
protected org.apache.flink.core.memory.MemorySegment nextMemorySegment() -
checkNextIndexOffset
protected boolean checkNextIndexOffset()check if we need request next index memory. -
writeIndexAndNormalizedKey
protected void writeIndexAndNormalizedKey(org.apache.flink.table.data.RowData record, long currOffset) Write of index and normalizedKey. -
compare
public int compare(int i, int j) - Specified by:
comparein interfaceorg.apache.flink.runtime.operators.sort.IndexedSortable
-
compare
public int compare(int segmentNumberI, int segmentOffsetI, int segmentNumberJ, int segmentOffsetJ) - Specified by:
comparein interfaceorg.apache.flink.runtime.operators.sort.IndexedSortable
-
swap
public void swap(int i, int j) - Specified by:
swapin interfaceorg.apache.flink.runtime.operators.sort.IndexedSortable
-
swap
public void swap(int segmentNumberI, int segmentOffsetI, int segmentNumberJ, int segmentOffsetJ) - Specified by:
swapin interfaceorg.apache.flink.runtime.operators.sort.IndexedSortable
-
size
public int size()- Specified by:
sizein interfaceorg.apache.flink.runtime.operators.sort.IndexedSortable
-
recordSize
public int recordSize()- Specified by:
recordSizein interfaceorg.apache.flink.runtime.operators.sort.IndexedSortable
-
recordsPerSegment
public int recordsPerSegment()- Specified by:
recordsPerSegmentin interfaceorg.apache.flink.runtime.operators.sort.IndexedSortable
-
writeToOutput
public void writeToOutput(org.apache.flink.runtime.memory.AbstractPagedOutputView output) throws IOException Spill: Write all records to aAbstractPagedOutputView.- Throws:
IOException
-