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
Fields Modifier and Type Field Description protected intcurrentSortIndexOffsetprotected org.apache.flink.core.memory.MemorySegmentcurrentSortIndexSegmentprotected intindexEntrySizeprotected intlastIndexEntryOffsetprotected MemorySegmentPoolmemorySegmentPoolprotected intnumRecordsstatic intOFFSET_LENprotected org.apache.flink.runtime.io.disk.RandomAccessInputViewrecordBufferprotected org.apache.flink.table.data.binary.BinaryRowDatarow1protected BinaryRowDataSerializerserializerprotected BinaryRowDataSerializerserializer1protected ArrayList<org.apache.flink.core.memory.MemorySegment>sortIndex
-
Constructor Summary
Constructors Constructor Description BinaryIndexedSortable(NormalizedKeyComputer normalizedKeyComputer, BinaryRowDataSerializer serializer, RecordComparator comparator, ArrayList<org.apache.flink.core.memory.MemorySegment> recordBufferSegments, MemorySegmentPool memorySegmentPool)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancheckNextIndexOffset()check 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.MemorySegmentnextMemorySegment()intrecordSize()intrecordsPerSegment()intsize()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 Detail
-
OFFSET_LEN
public static final int OFFSET_LEN
- See Also:
- Constant Field Values
-
serializer
protected final BinaryRowDataSerializer serializer
-
recordBuffer
protected final org.apache.flink.runtime.io.disk.RandomAccessInputView recordBuffer
-
currentSortIndexSegment
protected org.apache.flink.core.memory.MemorySegment currentSortIndexSegment
-
memorySegmentPool
protected final MemorySegmentPool memorySegmentPool
-
sortIndex
protected final ArrayList<org.apache.flink.core.memory.MemorySegment> sortIndex
-
indexEntrySize
protected final int indexEntrySize
-
lastIndexEntryOffset
protected final int lastIndexEntryOffset
-
serializer1
protected final BinaryRowDataSerializer serializer1
-
row1
protected final org.apache.flink.table.data.binary.BinaryRowData row1
-
currentSortIndexOffset
protected int currentSortIndexOffset
-
numRecords
protected int numRecords
-
-
Constructor Detail
-
BinaryIndexedSortable
public BinaryIndexedSortable(NormalizedKeyComputer normalizedKeyComputer, BinaryRowDataSerializer serializer, RecordComparator comparator, ArrayList<org.apache.flink.core.memory.MemorySegment> recordBufferSegments, MemorySegmentPool memorySegmentPool)
-
-
Method Detail
-
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 IOExceptionSpill: Write all records to aAbstractPagedOutputView.- Throws:
IOException
-
-