public class ProjectMemoryManager extends RecordBatchMemoryManager
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.
Modifier and Type | Class and Description |
---|---|
static class |
ProjectMemoryManager.VariableWidthColumnInfo |
DEFAULT_INPUT_INDEX, MAX_NUM_ROWS, MIN_NUM_ROWS
Constructor and Description |
---|
ProjectMemoryManager(int configuredOutputSize) |
Modifier and Type | Method and Description |
---|---|
void |
addComplexField(ValueVector vv) |
void |
addNewField(ValueVector vvOut,
LogicalExpression logicalExpression) |
void |
addTransferField(ValueVector vvIn,
String inputColumnName,
String outputColumnName) |
static int |
getFixedWidth(TypeProtos.MajorType majorType) |
static int |
getMetadataWidth(ValueVector vv) |
RecordBatch |
incomingBatch() |
void |
init(RecordBatch incomingBatch,
ProjectRecordBatch outgoingBatch) |
boolean |
isComplex(TypeProtos.MajorType majorType) |
boolean |
isFixedWidth(TypedFieldId fieldId) |
void |
update() |
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
public RecordBatch incomingBatch()
public boolean isComplex(TypeProtos.MajorType majorType)
public boolean isFixedWidth(TypedFieldId fieldId)
public static int getFixedWidth(TypeProtos.MajorType majorType)
public void addTransferField(ValueVector vvIn, String inputColumnName, String outputColumnName)
public void addNewField(ValueVector vvOut, LogicalExpression logicalExpression)
public void addComplexField(ValueVector vv)
public void init(RecordBatch incomingBatch, ProjectRecordBatch outgoingBatch)
public void update()
update
in class RecordBatchMemoryManager
public static int getMetadataWidth(ValueVector vv)
Copyright © 1970 The Apache Software Foundation. All rights reserved.