public interface ValueVector extends Closeable, Iterable<ValueVector>
value vector stores underlying data in-memory in a columnar fashion that is compact and
efficient. The column whose data is stored, is referred by getField().
It is important that vector is allocated before attempting to read or write.
There are a few "rules" around vectors:
allocate > mutate > setvaluecount > access > clear (or allocate to start the process over).
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ValueVector.Accessor
An abstraction that is used to read from this vector instance.
|
static interface |
ValueVector.Mutator
An abstraction that is used to write into this vector instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
allocateNew()
Allocate new buffers.
|
boolean |
allocateNewSafe()
Allocates new buffers.
|
void |
clear()
Release the underlying ArrowBuf and reset the ValueVector to empty.
|
void |
close()
Alternative to clear().
|
ValueVector.Accessor |
getAccessor()
Returns an
accessor that is used to read from this vector
instance. |
BufferAllocator |
getAllocator() |
ArrowBuf[] |
getBuffers(boolean clear)
Return the underlying buffers associated with this vector.
|
int |
getBufferSize()
Returns the number of bytes that is used by this vector instance.
|
int |
getBufferSizeFor(int valueCount)
Returns the number of bytes that is used by this vector if it holds the given number
of values.
|
Field |
getField()
Get information about how this field is materialized.
|
Types.MinorType |
getMinorType() |
ValueVector.Mutator |
getMutator()
Returns an
mutator that is used to write to this vector
instance. |
FieldReader |
getReader()
Returns a
field reader that supports reading values
from this vector. |
TransferPair |
getTransferPair(BufferAllocator allocator)
Returns a
transfer pair, creating a new target vector of
the same type. |
TransferPair |
getTransferPair(String ref,
BufferAllocator allocator) |
int |
getValueCapacity()
Returns the maximum number of values that can be stored in this vector instance.
|
TransferPair |
makeTransferPair(ValueVector target)
Returns a new
transfer pair that is used to transfer underlying
buffers into the target vector. |
void |
setInitialCapacity(int numRecords)
Set the initial record capacity
|
void allocateNew()
throws OutOfMemoryException
OutOfMemoryException - Thrown if no memory can be allocated.boolean allocateNewSafe()
BufferAllocator getAllocator()
void setInitialCapacity(int numRecords)
numRecords - the initial record capacity.int getValueCapacity()
void close()
close in interface AutoCloseableclose in interface Closeablevoid clear()
Field getField()
Types.MinorType getMinorType()
TransferPair getTransferPair(BufferAllocator allocator)
transfer pair, creating a new target vector of
the same type.TransferPair getTransferPair(String ref, BufferAllocator allocator)
TransferPair makeTransferPair(ValueVector target)
transfer pair that is used to transfer underlying
buffers into the target vector.ValueVector.Accessor getAccessor()
accessor that is used to read from this vector
instance.ValueVector.Mutator getMutator()
mutator that is used to write to this vector
instance.FieldReader getReader()
field reader that supports reading values
from this vector.int getBufferSize()
int getBufferSizeFor(int valueCount)
valueCount - the number of values to assume this vector containsArrowBuf[] getBuffers(boolean clear)
clear - Whether to clear vector before returning; the buffers will still be refcounted;
but the returned array will be the only reference to thembuffers that is used by this vector instance.Copyright © 2016 The Apache Software Foundation. All rights reserved.