public class RecordBatchLoader extends Object implements VectorAccessible
Constructor and Description |
---|
RecordBatchLoader(BufferAllocator allocator)
Constructs a loader using the given allocator for vector buffer allocation.
|
Modifier and Type | Method and Description |
---|---|
BufferAllocator |
allocator() |
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() |
String |
toString() |
void |
zero()
Removes an data from the loader, but maintains the schema and empty vectors.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public RecordBatchLoader(BufferAllocator allocator)
public BufferAllocator allocator()
public boolean load(UserBitShared.RecordBatchDef def, DrillBuf buf)
def
- The definition for the record batch.buf
- The buffer that holds the data associated with the record batch.public TypedFieldId getValueVectorId(SchemaPath path)
VectorAccessible
Iterable<ValueVector>.
getValueVectorId
in interface VectorAccessible
path
- the path where the vector should be located.public int getRecordCount()
VectorAccessible
getRecordCount
in interface VectorAccessible
public VectorContainer getContainer()
public VectorWrapper<?> getValueAccessorById(Class<?> clazz, int... ids)
getValueAccessorById
in interface VectorAccessible
public WritableBatch getWritableBatch()
public Iterator<VectorWrapper<?>> iterator()
iterator
in interface Iterable<VectorWrapper<?>>
public SelectionVector2 getSelectionVector2()
getSelectionVector2
in interface VectorAccessible
public SelectionVector4 getSelectionVector4()
getSelectionVector4
in interface VectorAccessible
public BatchSchema getSchema()
VectorAccessible
getSchema
in interface VectorAccessible
public void resetRecordCount()
public void zero()
public void clear()
VectorContainer.clear()
) and resets the record count to zero.Copyright © 1970 The Apache Software Foundation. All rights reserved.