Package org.apache.drill.exec.record
Class RecordBatchLoader
java.lang.Object
org.apache.drill.exec.record.RecordBatchLoader
- All Implemented Interfaces:
Iterable<VectorWrapper<?>>
,VectorAccessible
Holds record batch loaded from record batch message.
-
Constructor Summary
ConstructorDescriptionRecordBatchLoader
(BufferAllocator allocator) Constructs a loader using the given allocator for vector buffer allocation. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears this loader, which clears the internal vector container (seeVectorContainer.clear()
) and resets the record count to zero.int
Get the number of records.Get the schema of the current RecordBatch.getValueAccessorById
(Class<?> clazz, int... ids) getValueVectorId
(SchemaPath path) Get the value vector type and id for the given schema path.iterator()
boolean
load
(UserBitShared.RecordBatchDef def, DrillBuf buf) Load a record batch from a single buffer.void
toString()
void
zero()
Removes an data from the loader, but maintains the schema and empty vectors.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
RecordBatchLoader
Constructs a loader using the given allocator for vector buffer allocation.
-
-
Method Details
-
allocator
-
getValueVectorId
Description copied from interface:VectorAccessible
Get the value vector type and id for the given schema path. The TypedFieldId should store a fieldId which is the same as the ordinal position of the field within the Iterator provided this classes implementation ofIterable<ValueVector>
.
- Specified by:
getValueVectorId
in interfaceVectorAccessible
- Parameters:
path
- the path where the vector should be located.- Returns:
- the local field id associated with this vector. If no field matches this path, this will return a null TypedFieldId
-
getRecordCount
public int getRecordCount()Description copied from interface:VectorAccessible
Get the number of records.- Specified by:
getRecordCount
in interfaceVectorAccessible
- Returns:
- number of records
-
getContainer
-
getValueAccessorById
- Specified by:
getValueAccessorById
in interfaceVectorAccessible
-
getWritableBatch
-
iterator
- Specified by:
iterator
in interfaceIterable<VectorWrapper<?>>
-
getSelectionVector2
- Specified by:
getSelectionVector2
in interfaceVectorAccessible
-
getSelectionVector4
- Specified by:
getSelectionVector4
in interfaceVectorAccessible
-
getSchema
Description copied from interface:VectorAccessible
Get the schema of the current RecordBatch. This changes if and only if a *_NEW_SCHEMA IterOutcome is provided.- Specified by:
getSchema
in interfaceVectorAccessible
- Returns:
- schema of the current batch
-
resetRecordCount
public void resetRecordCount() -
zero
public void zero()Removes an data from the loader, but maintains the schema and empty vectors. -
clear
public void clear()Clears this loader, which clears the internal vector container (seeVectorContainer.clear()
) and resets the record count to zero. -
toString
-