Class ScanBatch.Mutator
java.lang.Object
org.apache.drill.exec.physical.impl.ScanBatch.Mutator
- All Implemented Interfaces:
OutputMutator
- Enclosing class:
ScanBatch
Row set mutator implementation provided to record readers created by
this scan batch. Made visible so that tests can create this mutator
without also needing a ScanBatch instance. (This class is really independent
of the ScanBatch, but resides here for historical reasons. This is,
in turn, the only use of the generated vector readers in the vector
package.)
-
Constructor Summary
ConstructorsConstructorDescriptionMutator(OperatorContext oContext, BufferAllocator allocator, VectorContainer container) -
Method Summary
Modifier and TypeMethodDescription<T extends ValueVector>
TaddField(MaterializedField field, Class<T> clazz) Add a ValueVector for new (or existing) field.voidallocate(int recordCount) voidclear()Clear this mutator i.e.Allows a scanner to request a set of managed block of memory.booleanReports whether schema has changed (field was added or re-added) since last call toisNewSchema().
-
Constructor Details
-
Mutator
-
-
Method Details
-
fieldVectorMap
-
implicitFieldVectorMap
-
addField
public <T extends ValueVector> T addField(MaterializedField field, Class<T> clazz) throws SchemaChangeException Description copied from interface:OutputMutatorAdd a ValueVector for new (or existing) field.- Specified by:
addFieldin interfaceOutputMutator- Parameters:
field- The specification of the newly desired vector.clazz- The expected ValueVector class. Also allows strongly typed use of this interface.- Returns:
- The existing or new ValueVector associated with the provided field.
- Throws:
SchemaChangeException- If the addition of this field is incompatible with this OutputMutator's capabilities.
-
allocate
public void allocate(int recordCount) - Specified by:
allocatein interfaceOutputMutator
-
isNewSchema
public boolean isNewSchema()Reports whether schema has changed (field was added or re-added) since last call toisNewSchema(). Returns true at first call.- Specified by:
isNewSchemain interfaceOutputMutator- Returns:
-
getManagedBuffer
Description copied from interface:OutputMutatorAllows a scanner to request a set of managed block of memory.- Specified by:
getManagedBufferin interfaceOutputMutator- Returns:
- A DrillBuf that will be released at the end of the current query (and can be resized as desired during use).
-
getCallBack
- Specified by:
getCallBackin interfaceOutputMutator- Returns:
- the CallBack object for this mutator
-
clear
public void clear()Description copied from interface:OutputMutatorClear this mutator i.e. reset it to pristine condition- Specified by:
clearin interfaceOutputMutator
-