Class 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 Detail

      • recordBuffer

        protected final org.apache.flink.runtime.io.disk.RandomAccessInputView recordBuffer
      • currentSortIndexSegment

        protected org.apache.flink.core.memory.MemorySegment currentSortIndexSegment
      • sortIndex

        protected final ArrayList<org.apache.flink.core.memory.MemorySegment> sortIndex
      • indexEntrySize

        protected final int indexEntrySize
      • lastIndexEntryOffset

        protected final int lastIndexEntryOffset
      • row1

        protected final org.apache.flink.table.data.binary.BinaryRowData row1
      • currentSortIndexOffset

        protected int currentSortIndexOffset
      • numRecords

        protected int numRecords
    • 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:
        compare in interface org.apache.flink.runtime.operators.sort.IndexedSortable
      • compare

        public int compare​(int segmentNumberI,
                           int segmentOffsetI,
                           int segmentNumberJ,
                           int segmentOffsetJ)
        Specified by:
        compare in interface org.apache.flink.runtime.operators.sort.IndexedSortable
      • swap

        public void swap​(int i,
                         int j)
        Specified by:
        swap in interface org.apache.flink.runtime.operators.sort.IndexedSortable
      • swap

        public void swap​(int segmentNumberI,
                         int segmentOffsetI,
                         int segmentNumberJ,
                         int segmentOffsetJ)
        Specified by:
        swap in interface org.apache.flink.runtime.operators.sort.IndexedSortable
      • size

        public int size()
        Specified by:
        size in interface org.apache.flink.runtime.operators.sort.IndexedSortable
      • recordSize

        public int recordSize()
        Specified by:
        recordSize in interface org.apache.flink.runtime.operators.sort.IndexedSortable
      • recordsPerSegment

        public int recordsPerSegment()
        Specified by:
        recordsPerSegment in interface org.apache.flink.runtime.operators.sort.IndexedSortable
      • writeToOutput

        public void writeToOutput​(org.apache.flink.runtime.memory.AbstractPagedOutputView output)
                           throws IOException
        Spill: Write all records to a AbstractPagedOutputView.
        Throws:
        IOException