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 Details

    • OFFSET_LEN

      public static final int OFFSET_LEN
      See Also:
    • 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 Details

  • 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:
      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