public class VectorContainer extends Object implements VectorAccessible
| Modifier and Type | Field and Description |
|---|---|
protected List<VectorWrapper<?>> |
wrappers |
| Constructor and Description |
|---|
VectorContainer() |
VectorContainer(BufferAllocator allocator) |
VectorContainer(BufferAllocator allocator,
BatchSchema schema)
Create a new vector container given a pre-defined schema.
|
VectorContainer(OperatorContext oContext) |
| Modifier and Type | Method and Description |
|---|---|
TypedFieldId |
add(ValueVector vv) |
void |
add(ValueVector[] hyperVector) |
void |
add(ValueVector[] hyperVector,
boolean releasable) |
void |
addCollection(Iterable<ValueVector> vectors) |
void |
addHyperList(List<ValueVector> vectors) |
void |
addHyperList(List<ValueVector> vectors,
boolean releasable) |
<T extends ValueVector> |
addOrGet(MaterializedField field) |
<T extends ValueVector> |
addOrGet(MaterializedField field,
SchemaChangeCallBack callBack) |
<T extends ValueVector> |
addOrGet(String name,
TypeProtos.MajorType type,
Class<T> clazz) |
void |
allocateNew() |
boolean |
allocateNewSafe() |
void |
buildSchema(BatchSchema.SelectionVectorMode mode) |
void |
clear() |
BufferAllocator |
getAllocator() |
int |
getNumberOfColumns() |
int |
getRecordCount()
Get the number of records.
|
BatchSchema |
getSchema()
Get the schema of the current RecordBatch.
|
SelectionVector2 |
getSelectionVector2() |
SelectionVector4 |
getSelectionVector4() |
static VectorContainer |
getTransferClone(VectorAccessible incoming,
BufferAllocator allocator) |
static VectorContainer |
getTransferClone(VectorAccessible incoming,
OperatorContext oContext)
Get a set of transferred clones of this container.
|
static VectorContainer |
getTransferClone(VectorAccessible incoming,
VectorWrapper<?>[] ignoreWrappers,
OperatorContext oContext) |
VectorWrapper<?> |
getValueAccessorById(Class<?> clazz,
int... fieldIds) |
VectorWrapper<?> |
getValueVector(int index) |
TypedFieldId |
getValueVectorId(SchemaPath path)
Get the value vector type and id for the given schema path.
|
boolean |
hasRecordCount() |
boolean |
hasSchema() |
boolean |
isSchemaChanged() |
Iterator<VectorWrapper<?>> |
iterator() |
VectorContainer |
merge(VectorContainer otherContainer)
Merge two batches to create a single, combined, batch.
|
void |
remove(ValueVector v) |
void |
setRecordCount(int recordCount) |
String |
toString() |
void |
transferIn(VectorContainer containerIn)
Transfer vectors from containerIn to this.
|
void |
transferOut(VectorContainer containerOut)
Transfer vectors from this to containerOut
|
void |
zeroVectors()
Clears the contained vectors.
|
protected final List<VectorWrapper<?>> wrappers
public VectorContainer()
public VectorContainer(OperatorContext oContext)
public VectorContainer(BufferAllocator allocator)
public VectorContainer(BufferAllocator allocator, BatchSchema schema)
allocateNew() or allocateNewSafe() to allocate
memory.
Note that this method does the equivalent of #buildSchema(SelectionVectorMode)
using the schema provided.
allocator - allocator to be used to allocate memory laterschema - the schema that defines the vectors to createpublic BufferAllocator getAllocator()
public boolean isSchemaChanged()
public void addHyperList(List<ValueVector> vectors)
public void addHyperList(List<ValueVector> vectors, boolean releasable)
public void transferIn(VectorContainer containerIn)
public void transferOut(VectorContainer containerOut)
public <T extends ValueVector> T addOrGet(MaterializedField field)
public <T extends ValueVector> T addOrGet(MaterializedField field, SchemaChangeCallBack callBack)
public <T extends ValueVector> T addOrGet(String name, TypeProtos.MajorType type, Class<T> clazz)
public static VectorContainer getTransferClone(VectorAccessible incoming, OperatorContext oContext)
incoming - The RecordBatch iterator the contains the batch we should take over.public static VectorContainer getTransferClone(VectorAccessible incoming, BufferAllocator allocator)
public static VectorContainer getTransferClone(VectorAccessible incoming, VectorWrapper<?>[] ignoreWrappers, OperatorContext oContext)
public void addCollection(Iterable<ValueVector> vectors)
public TypedFieldId add(ValueVector vv)
public void add(ValueVector[] hyperVector)
public void add(ValueVector[] hyperVector, boolean releasable)
public void remove(ValueVector v)
public TypedFieldId getValueVectorId(SchemaPath path)
VectorAccessiblegetValueVectorId in interface VectorAccessiblepath - the path where the vector should be located.public VectorWrapper<?> getValueVector(int index)
public VectorWrapper<?> getValueAccessorById(Class<?> clazz, int... fieldIds)
getValueAccessorById in interface VectorAccessiblepublic boolean hasSchema()
public BatchSchema getSchema()
VectorAccessiblegetSchema in interface VectorAccessiblepublic void buildSchema(BatchSchema.SelectionVectorMode mode)
public Iterator<VectorWrapper<?>> iterator()
iterator in interface Iterable<VectorWrapper<?>>public void clear()
public void setRecordCount(int recordCount)
public int getRecordCount()
VectorAccessiblegetRecordCount in interface VectorAccessiblepublic boolean hasRecordCount()
public SelectionVector2 getSelectionVector2()
getSelectionVector2 in interface VectorAccessiblepublic SelectionVector4 getSelectionVector4()
getSelectionVector4 in interface VectorAccessiblepublic void zeroVectors()
ValueVector.clear()).public int getNumberOfColumns()
public void allocateNew()
public boolean allocateNewSafe()
public VectorContainer merge(VectorContainer otherContainer)
BatchSchema.merge(BatchSchema).
The two batches must have identical row counts. The pattern is that
this container is the main part of the record batch, the other
represents new columns to merge.
Reference counts on the underlying buffers are unchanged. The client code is assumed to abandon the two input containers in favor of the merged container.
otherContainer - the container to merge with this oneCopyright © 2017 The Apache Software Foundation. All rights reserved.