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
ConstructorDescriptionMutator
(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.void
allocate
(int recordCount) void
clear()
Clear this mutator i.e.Allows a scanner to request a set of managed block of memory.boolean
Reports 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:OutputMutator
Add a ValueVector for new (or existing) field.- Specified by:
addField
in 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:
allocate
in 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:
isNewSchema
in interfaceOutputMutator
- Returns:
-
getManagedBuffer
Description copied from interface:OutputMutator
Allows a scanner to request a set of managed block of memory.- Specified by:
getManagedBuffer
in 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:
getCallBack
in interfaceOutputMutator
- Returns:
- the CallBack object for this mutator
-
clear
public void clear()Description copied from interface:OutputMutator
Clear this mutator i.e. reset it to pristine condition- Specified by:
clear
in interfaceOutputMutator
-