Package org.apache.drill.exec.record
Class RecordBatchMemoryManager
java.lang.Object
org.apache.drill.exec.record.RecordBatchMemoryManager
- Direct Known Subclasses:
JoinBatchMemoryManager,ProjectMemoryManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intprotected static final int -
Constructor Summary
ConstructorsConstructorDescriptionRecordBatchMemoryManager(int configuredOutputSize) RecordBatchMemoryManager(int numInputs, int configuredOutputSize) -
Method Summary
Modifier and TypeMethodDescriptionstatic intadjustOutputRowCount(int rowCount) This will adjust rowCount taking into account the min and max that is allowed.voidallocateVectors(List<ValueVector> valueVectors) voidallocateVectors(List<ValueVector> valueVectors, int recordCount) voidallocateVectors(VectorContainer container) voidallocateVectors(VectorContainer container, int recordCount) static intcomputeOutputRowCount(int batchSize, int rowWidth) longlonggetAvgInputBatchSize(int index) longlonggetAvgInputRowWidth(int index) longlonggetColumnSize(int index, String name) getColumnSize(String name) intShould be used as maximum output row count that can be filled in output batch which is already allocated.longlonggetNumIncomingBatches(int index) longintintintintShould 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.getRecordBatchSizer(int index) longlonggetTotalInputRecords(int index) longvoidsetCurrentOutgoingMaxRowCount(int newTargetOutputCount) Set the max row count which the current output batch (already allocated) can contain.voidsetOutgoingRowWidth(int outgoingRowWidth) voidsetOutputRowCount(int outputRowCount) voidsetOutputRowCount(int targetBatchSize, int rowWidth) Given batchSize and rowWidth, this will set output rowCount taking into account the min and max that is allowed.voidsetRecordBatchSizer(int index, RecordBatchSizer sizer) voidvoidupdate()voidupdate(int inputIndex) voidupdate(int inputIndex, int outputPosition) voidupdate(int inputIndex, int outputPosition, boolean useAggregate) voidupdate(RecordBatch recordBatch) voidupdate(RecordBatch recordBatch, int index) voidupdate(RecordBatch batch, int inputIndex, int outputPosition) voidupdate(RecordBatch batch, int inputIndex, int outputPosition, boolean useAggregate) booleanupdateIfNeeded(int newOutgoingRowWidth) voidvoidupdateIncomingStats(int index) voidupdateOutgoingStats(int outputRecords)
-
Field Details
-
MAX_NUM_ROWS
protected static final int MAX_NUM_ROWS- See Also:
-
MIN_NUM_ROWS
protected static final int MIN_NUM_ROWS- See Also:
-
DEFAULT_INPUT_INDEX
protected static final int DEFAULT_INPUT_INDEX- See Also:
-
-
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
-
update
-
update
public void update(int inputIndex, int outputPosition, boolean useAggregate) -
update
public void update(int inputIndex, int outputPosition) -
update
-
update
-
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
-
setRecordBatchSizer
-
getRecordBatchSizer
-
getRecordBatchSizer
-
getColumnSize
-
getColumnSize
-
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
-
allocateVectors
-
allocateVectors
-
allocateVectors
-