Class RecordBatchMemoryManager

java.lang.Object
org.apache.drill.exec.record.RecordBatchMemoryManager
Direct Known Subclasses:
JoinBatchMemoryManager, ProjectMemoryManager

public class RecordBatchMemoryManager extends Object
  • Field Details

  • Constructor Details

    • RecordBatchMemoryManager

      public RecordBatchMemoryManager(int numInputs, int configuredOutputSize)
    • RecordBatchMemoryManager

      public RecordBatchMemoryManager(int configuredOutputSize)
  • Method Details

    • getNumOutgoingBatches

      public long getNumOutgoingBatches()
    • getTotalOutputRecords

      public long getTotalOutputRecords()
    • getAvgOutputBatchSize

      public long getAvgOutputBatchSize()
    • getAvgOutputRowWidth

      public long getAvgOutputRowWidth()
    • getNumIncomingBatches

      public long getNumIncomingBatches()
    • getAvgInputBatchSize

      public long getAvgInputBatchSize()
    • getAvgInputRowWidth

      public long getAvgInputRowWidth()
    • getTotalInputRecords

      public long getTotalInputRecords()
    • getNumIncomingBatches

      public long getNumIncomingBatches(int index)
    • getAvgInputBatchSize

      public long getAvgInputBatchSize(int index)
    • getAvgInputRowWidth

      public long getAvgInputRowWidth(int index)
    • getTotalInputRecords

      public long getTotalInputRecords(int index)
    • update

      public void update(int inputIndex)
    • update

      public void update()
    • update

      public void update(RecordBatch recordBatch)
    • update

      public void update(RecordBatch recordBatch, int index)
    • update

      public void update(int inputIndex, int outputPosition, boolean useAggregate)
    • update

      public void update(int inputIndex, int outputPosition)
    • update

      public void update(RecordBatch batch, int inputIndex, int outputPosition)
    • update

      public void update(RecordBatch batch, int inputIndex, int outputPosition, boolean useAggregate)
    • updateIfNeeded

      public boolean updateIfNeeded(int newOutgoingRowWidth)
    • getOutputRowCount

      public int getOutputRowCount()
      Should be used as maximum output row count that can be filled in output batch when a new output batch is allocated after calling update on BatchMemoryManager.
      Returns:
      outputRowCount max output row count
    • getCurrentOutgoingMaxRowCount

      public int getCurrentOutgoingMaxRowCount()
      Should be used as maximum output row count that can be filled in output batch which is already allocated.
      Returns:
      currentOutgoingMaxRowCount max output row count for current output batch
    • setOutputRowCount

      public void setOutputRowCount(int targetBatchSize, int rowWidth)
      Given batchSize and rowWidth, this will set output rowCount taking into account the min and max that is allowed.
    • setOutputRowCount

      public void setOutputRowCount(int outputRowCount)
    • setCurrentOutgoingMaxRowCount

      public void setCurrentOutgoingMaxRowCount(int newTargetOutputCount)
      Set the max row count which the current output batch (already allocated) can contain. Since this setter doesn't adjust the input value we make sure it doesn't go above MAX_NUM_ROWS
      Parameters:
      newTargetOutputCount -
    • adjustOutputRowCount

      public static int adjustOutputRowCount(int rowCount)
      This will adjust rowCount taking into account the min and max that is allowed. We will round down to nearest power of two - 1 for better memory utilization. -1 is done for adjusting accounting for offset vectors.
    • computeOutputRowCount

      public static int computeOutputRowCount(int batchSize, int rowWidth)
    • setOutgoingRowWidth

      public void setOutgoingRowWidth(int outgoingRowWidth)
    • getOutgoingRowWidth

      public int getOutgoingRowWidth()
    • setRecordBatchSizer

      public void setRecordBatchSizer(int index, RecordBatchSizer sizer)
    • setRecordBatchSizer

      public void setRecordBatchSizer(RecordBatchSizer sizer)
    • getRecordBatchSizer

      public RecordBatchSizer getRecordBatchSizer(int index)
    • getRecordBatchSizer

      public RecordBatchSizer getRecordBatchSizer()
    • getColumnSize

      public RecordBatchSizer.ColumnSize getColumnSize(int index, String name)
    • getColumnSize

      public RecordBatchSizer.ColumnSize getColumnSize(String name)
    • updateIncomingStats

      public void updateIncomingStats(int index)
    • updateIncomingStats

      public void updateIncomingStats()
    • updateOutgoingStats

      public void updateOutgoingStats(int outputRecords)
    • getOutputBatchSize

      public int getOutputBatchSize()
    • getOffsetVectorWidth

      public int getOffsetVectorWidth()
    • allocateVectors

      public void allocateVectors(VectorContainer container, int recordCount)
    • allocateVectors

      public void allocateVectors(List<ValueVector> valueVectors, int recordCount)
    • allocateVectors

      public void allocateVectors(VectorContainer container)
    • allocateVectors

      public void allocateVectors(List<ValueVector> valueVectors)