Class BinaryInMemorySortBuffer

java.lang.Object
org.apache.flink.table.runtime.operators.sort.BinaryIndexedSortable
org.apache.flink.table.runtime.operators.sort.BinaryInMemorySortBuffer
All Implemented Interfaces:
org.apache.flink.runtime.operators.sort.IndexedSortable

public final class BinaryInMemorySortBuffer extends BinaryIndexedSortable
In memory sort buffer for binary row.
  • Method Details

    • createBuffer

      public static BinaryInMemorySortBuffer createBuffer(NormalizedKeyComputer normalizedKeyComputer, AbstractRowDataSerializer<org.apache.flink.table.data.RowData> inputSerializer, BinaryRowDataSerializer serializer, RecordComparator comparator, MemorySegmentPool memoryPool)
      Create a memory sorter in `insert` way.
    • reset

      public void reset()
      Resets the sort buffer back to the state where it is empty. All contained data is discarded.
    • returnToSegmentPool

      public void returnToSegmentPool()
    • isEmpty

      public boolean isEmpty()
      Checks whether the buffer is empty.
      Returns:
      True, if no record is contained, false otherwise.
    • dispose

      public void dispose()
    • getCapacity

      public long getCapacity()
    • getOccupancy

      public long getOccupancy()
    • write

      public boolean write(org.apache.flink.table.data.RowData record) throws IOException
      Writes a given record to this sort buffer. The written record will be appended and take the last logical position.
      Parameters:
      record - The record to be written.
      Returns:
      True, if the record was successfully written, false, if the sort buffer was full.
      Throws:
      IOException - Thrown, if an error occurred while serializing the record into the buffers.
    • getIterator

      public org.apache.flink.util.MutableObjectIterator<org.apache.flink.table.data.binary.BinaryRowData> getIterator()
      Gets an iterator over all records in this buffer in their logical order.
      Returns:
      An iterator returning the records in their logical order.