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 | 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().
|
BufferAllocator |
getAllocator() |
ArrowBuf[] |
getBuffers(boolean clear)
Return the underlying buffers associated with this vector.
|
int |
getBufferSize() |
int |
getBufferSizeFor(int valueCount)
Returns the number of bytes that is used by this vector if it holds the given number
of values.
|
ArrowBuf |
getDataBuffer()
Gets the underlying buffer associated with data vector
|
Field |
getField()
Get information about how this field is materialized.
|
Types.MinorType |
getMinorType() |
int |
getNullCount()
Returns number of null elements in the vector
|
Object |
getObject(int index)
Get friendly type object from the vector
|
ArrowBuf |
getOffsetBuffer()
Gets the underlying buffer associated with offset vector
|
FieldReader |
getReader() |
TransferPair |
getTransferPair(BufferAllocator allocator)
to transfer quota responsibility
|
TransferPair |
getTransferPair(String ref,
BufferAllocator allocator) |
TransferPair |
getTransferPair(String ref,
BufferAllocator allocator,
CallBack callBack) |
ArrowBuf |
getValidityBuffer()
Gets the underlying buffer associated with validity vector
|
int |
getValueCapacity()
Returns the maximum number of values that can be stored in this vector instance.
|
int |
getValueCount()
Gets the number of values
|
boolean |
isNull(int index)
Check whether an element in the vector is null
|
TransferPair |
makeTransferPair(ValueVector target)
makes a new transfer pair used to transfer underlying buffers
|
void |
reAlloc()
Allocate new buffer with double capacity, and copy data into the new buffer.
|
void |
setInitialCapacity(int numRecords)
Set the initial record capacity
|
void |
setValueCount(int valueCount)
Set number of values in the vector
|
void allocateNew() throws OutOfMemoryException
OutOfMemoryException
- Thrown if no memory can be allocated.boolean allocateNewSafe()
void reAlloc()
BufferAllocator getAllocator()
void setInitialCapacity(int numRecords)
numRecords
- the initial record capacity.int getValueCapacity()
void close()
close
in interface AutoCloseable
close
in interface Closeable
void clear()
Field getField()
Types.MinorType getMinorType()
TransferPair getTransferPair(BufferAllocator allocator)
allocator
- the target allocatortransfer pair
, creating a new target vector of
the same type.TransferPair getTransferPair(String ref, BufferAllocator allocator)
TransferPair getTransferPair(String ref, BufferAllocator allocator, CallBack callBack)
TransferPair makeTransferPair(ValueVector target)
target
- the target for the transfertransfer pair
that is used to transfer underlying
buffers into the target vector.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.ArrowBuf getValidityBuffer()
ArrowBuf getDataBuffer()
ArrowBuf getOffsetBuffer()
int getValueCount()
void setValueCount(int valueCount)
Object getObject(int index)
index
- int getNullCount()
boolean isNull(int index)
index
- Copyright © 2017 The Apache Software Foundation. All rights reserved.