public class RecordBatchLoader extends Object implements VectorAccessible, Iterable<VectorWrapper<?>>
| Constructor and Description |
|---|
RecordBatchLoader(BufferAllocator allocator)
Constructs a loader using the given allocator for vector buffer allocation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears this loader, which clears the internal vector container (see
VectorContainer.clear()) and resets the record count to zero. |
VectorContainer |
getContainer() |
int |
getRecordCount()
Get the number of records.
|
BatchSchema |
getSchema()
Get the schema of the current RecordBatch.
|
SelectionVector2 |
getSelectionVector2() |
SelectionVector4 |
getSelectionVector4() |
VectorWrapper<?> |
getValueAccessorById(Class<?> clazz,
int... ids) |
TypedFieldId |
getValueVectorId(SchemaPath path)
Get the value vector type and id for the given schema path.
|
WritableBatch |
getWritableBatch() |
Iterator<VectorWrapper<?>> |
iterator() |
boolean |
load(UserBitShared.RecordBatchDef def,
DrillBuf buf)
Load a record batch from a single buffer.
|
void |
resetRecordCount() |
public RecordBatchLoader(BufferAllocator allocator)
public boolean load(UserBitShared.RecordBatchDef def, DrillBuf buf) throws SchemaChangeException
def - The definition for the record batch.buf - The buffer that holds the data associated with the record batch.SchemaChangeException - TODO: Clean: DRILL-2933 load(...) never actually throws SchemaChangeException.public TypedFieldId getValueVectorId(SchemaPath path)
VectorAccessiblegetValueVectorId in interface VectorAccessiblepath - the path where the vector should be located.public int getRecordCount()
VectorAccessiblegetRecordCount in interface VectorAccessiblepublic VectorContainer getContainer()
public VectorWrapper<?> getValueAccessorById(Class<?> clazz, int... ids)
getValueAccessorById in interface VectorAccessiblepublic WritableBatch getWritableBatch()
public Iterator<VectorWrapper<?>> iterator()
iterator in interface Iterable<VectorWrapper<?>>public SelectionVector2 getSelectionVector2()
getSelectionVector2 in interface VectorAccessiblepublic SelectionVector4 getSelectionVector4()
getSelectionVector4 in interface VectorAccessiblepublic BatchSchema getSchema()
VectorAccessiblegetSchema in interface VectorAccessiblepublic void resetRecordCount()
public void clear()
VectorContainer.clear()) and resets the record count to zero.Copyright © 2017 The Apache Software Foundation. All rights reserved.