Class ProjectMemoryManager
Setup phase: As and when ProjectRecordBatch creates or transfers a field, it registers the field with PMM. If the field is a variable-width field, PMM records the expression that produces the variable-width field. The expression is a tree of LogicalExpressions. The PMM walks this tree of LogicalExpressions to produce a tree of OutputWidthExpressions. The widths of fixed-width fields are just accumulated into a single total. Note: The PMM, currently, cannot handle new complex fields, it just uses a hard-coded estimate for such fields.
Execution phase: Just before a batch is processed by Project, the PMM walks the tree of OutputWidthExpressions and converts them to FixedWidthExpressions. It uses the RecordBatchSizer and the function annotations to do this conversion. See OutputWidthVisitor for details.
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.apache.drill.exec.record.RecordBatchMemoryManager
DEFAULT_INPUT_INDEX, MAX_NUM_ROWS, MIN_NUM_ROWS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addNewField
(ValueVector vvOut, LogicalExpression logicalExpression) void
addTransferField
(ValueVector vvIn, String inputColumnName, String outputColumnName) static int
getFixedWidth
(TypeProtos.MajorType majorType) static int
void
init
(RecordBatch incomingBatch, ProjectRecordBatch outgoingBatch) boolean
isComplex
(TypeProtos.MajorType majorType) boolean
isFixedWidth
(TypedFieldId fieldId) void
update()
Methods inherited from class org.apache.drill.exec.record.RecordBatchMemoryManager
adjustOutputRowCount, allocateVectors, allocateVectors, allocateVectors, allocateVectors, computeOutputRowCount, getAvgInputBatchSize, getAvgInputBatchSize, getAvgInputRowWidth, getAvgInputRowWidth, getAvgOutputBatchSize, getAvgOutputRowWidth, getColumnSize, getColumnSize, getCurrentOutgoingMaxRowCount, getNumIncomingBatches, getNumIncomingBatches, getNumOutgoingBatches, getOffsetVectorWidth, getOutgoingRowWidth, getOutputBatchSize, getOutputRowCount, getRecordBatchSizer, getRecordBatchSizer, getTotalInputRecords, getTotalInputRecords, getTotalOutputRecords, setCurrentOutgoingMaxRowCount, setOutgoingRowWidth, setOutputRowCount, setOutputRowCount, setRecordBatchSizer, setRecordBatchSizer, update, update, update, update, update, update, update, updateIfNeeded, updateIncomingStats, updateIncomingStats, updateOutgoingStats
-
Constructor Details
-
ProjectMemoryManager
public ProjectMemoryManager(int configuredOutputSize)
-
-
Method Details
-
incomingBatch
-
isComplex
-
isFixedWidth
-
getFixedWidth
-
addTransferField
-
addNewField
-
addComplexField
-
init
-
update
public void update()- Overrides:
update
in classRecordBatchMemoryManager
-
getMetadataWidth
-