Class SortRecordBatchBuilder

java.lang.Object
org.apache.drill.exec.physical.impl.sort.SortRecordBatchBuilder
All Implemented Interfaces:
AutoCloseable

public class SortRecordBatchBuilder extends Object implements AutoCloseable
  • Constructor Details

    • SortRecordBatchBuilder

      public SortRecordBatchBuilder(BufferAllocator a)
  • Method Details

    • add

      public boolean add(VectorAccessible batch)
      Add another record batch to the set of record batches. TODO: Refactor this and other (RecordBatchData) method into one method.
      Parameters:
      batch -
      Returns:
      True if the requested add completed successfully. Returns false in the case that this builder is full and cannot receive additional packages.
      Throws:
      SchemaChangeException
    • add

      public void add(RecordBatchData rbd)
    • isEmpty

      public boolean isEmpty()
    • build

      public void build(VectorContainer outputContainer)
    • getSv4

      public SelectionVector4 getSv4()
    • clear

      public void clear()
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • getHeldRecordBatches

      public List<VectorContainer> getHeldRecordBatches()
    • memoryNeeded

      public static long memoryNeeded(int recordCount)
      For given record count, return the memory that SortRecordBatchBuilder needs for its own purpose. This is used in ExternalSortBatch to make decisions about whether to spill or not.
      Parameters:
      recordCount - expected output record count
      Returns:
      number of bytes needed for an SV4, power-of-two rounded