public abstract class BinaryIndexedSortable extends Object implements org.apache.flink.runtime.operators.sort.IndexedSortable
Modifier and Type | Field and Description |
---|---|
protected int |
currentSortIndexOffset |
protected org.apache.flink.core.memory.MemorySegment |
currentSortIndexSegment |
protected int |
indexEntrySize |
protected int |
lastIndexEntryOffset |
protected org.apache.flink.table.runtime.util.MemorySegmentPool |
memorySegmentPool |
protected int |
numRecords |
static int |
OFFSET_LEN |
protected org.apache.flink.runtime.io.disk.RandomAccessInputView |
recordBuffer |
protected org.apache.flink.table.data.binary.BinaryRowData |
row1 |
protected org.apache.flink.table.runtime.typeutils.BinaryRowDataSerializer |
serializer |
protected org.apache.flink.table.runtime.typeutils.BinaryRowDataSerializer |
serializer1 |
protected ArrayList<org.apache.flink.core.memory.MemorySegment> |
sortIndex |
Constructor and Description |
---|
BinaryIndexedSortable(NormalizedKeyComputer normalizedKeyComputer,
org.apache.flink.table.runtime.typeutils.BinaryRowDataSerializer serializer,
RecordComparator comparator,
ArrayList<org.apache.flink.core.memory.MemorySegment> recordBufferSegments,
org.apache.flink.table.runtime.util.MemorySegmentPool memorySegmentPool) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkNextIndexOffset()
check if we need request next index memory.
|
int |
compare(int i,
int j) |
int |
compare(int segmentNumberI,
int segmentOffsetI,
int segmentNumberJ,
int segmentOffsetJ) |
protected org.apache.flink.core.memory.MemorySegment |
nextMemorySegment() |
int |
recordSize() |
int |
recordsPerSegment() |
int |
size() |
void |
swap(int i,
int j) |
void |
swap(int segmentNumberI,
int segmentOffsetI,
int segmentNumberJ,
int segmentOffsetJ) |
protected void |
writeIndexAndNormalizedKey(org.apache.flink.table.data.RowData record,
long currOffset)
Write of index and normalizedKey.
|
void |
writeToOutput(org.apache.flink.runtime.memory.AbstractPagedOutputView output)
Spill: Write all records to a
AbstractPagedOutputView . |
public static final int OFFSET_LEN
protected final org.apache.flink.table.runtime.typeutils.BinaryRowDataSerializer serializer
protected final org.apache.flink.runtime.io.disk.RandomAccessInputView recordBuffer
protected org.apache.flink.core.memory.MemorySegment currentSortIndexSegment
protected final org.apache.flink.table.runtime.util.MemorySegmentPool memorySegmentPool
protected final ArrayList<org.apache.flink.core.memory.MemorySegment> sortIndex
protected final int indexEntrySize
protected final int lastIndexEntryOffset
protected final org.apache.flink.table.runtime.typeutils.BinaryRowDataSerializer serializer1
protected final org.apache.flink.table.data.binary.BinaryRowData row1
protected int currentSortIndexOffset
protected int numRecords
public BinaryIndexedSortable(NormalizedKeyComputer normalizedKeyComputer, org.apache.flink.table.runtime.typeutils.BinaryRowDataSerializer serializer, RecordComparator comparator, ArrayList<org.apache.flink.core.memory.MemorySegment> recordBufferSegments, org.apache.flink.table.runtime.util.MemorySegmentPool memorySegmentPool)
protected org.apache.flink.core.memory.MemorySegment nextMemorySegment()
protected boolean checkNextIndexOffset()
protected void writeIndexAndNormalizedKey(org.apache.flink.table.data.RowData record, long currOffset)
public int compare(int i, int j)
compare
in interface org.apache.flink.runtime.operators.sort.IndexedSortable
public int compare(int segmentNumberI, int segmentOffsetI, int segmentNumberJ, int segmentOffsetJ)
compare
in interface org.apache.flink.runtime.operators.sort.IndexedSortable
public void swap(int i, int j)
swap
in interface org.apache.flink.runtime.operators.sort.IndexedSortable
public void swap(int segmentNumberI, int segmentOffsetI, int segmentNumberJ, int segmentOffsetJ)
swap
in interface org.apache.flink.runtime.operators.sort.IndexedSortable
public int size()
size
in interface org.apache.flink.runtime.operators.sort.IndexedSortable
public int recordSize()
recordSize
in interface org.apache.flink.runtime.operators.sort.IndexedSortable
public int recordsPerSegment()
recordsPerSegment
in interface org.apache.flink.runtime.operators.sort.IndexedSortable
public void writeToOutput(org.apache.flink.runtime.memory.AbstractPagedOutputView output) throws IOException
AbstractPagedOutputView
.IOException
Copyright © 2019–2023 The Apache Software Foundation. All rights reserved.