public class ListVector extends BaseRepeatedValueVector implements FieldVector, PromotableVector
| Modifier and Type | Field and Description |
|---|---|
protected ArrowBuf |
validityBuffer |
DATA_VECTOR_NAME, DEFAULT_DATA_VECTOR, OFFSET_WIDTH, offsetAllocationSizeInBytes, offsetBuffer, valueCount, vectorallocator, INITIAL_VALUE_ALLOCATION, MAX_ALLOCATION_SIZE, MAX_ALLOCATION_SIZE_PROPERTY, nameDEFAULT_REPEAT_PER_RECORD| Constructor and Description |
|---|
ListVector(String name,
BufferAllocator allocator,
CallBack callBack)
Deprecated.
|
ListVector(String name,
BufferAllocator allocator,
DictionaryEncoding dictionary,
CallBack callBack)
Deprecated.
|
ListVector(String name,
BufferAllocator allocator,
FieldType fieldType,
CallBack callBack) |
| Modifier and Type | Method and Description |
|---|---|
<T extends ValueVector> |
addOrGetVector(FieldType fieldType) |
void |
allocateNew()
Same as
allocateNewSafe(). |
boolean |
allocateNewSafe()
Allocate memory for the vector.
|
void |
clear()
Release the underlying ArrowBuf and reset the ValueVector to empty.
|
void |
copyFrom(int inIndex,
int outIndex,
ListVector from)
Copy a cell value from a particular index in source vector to a particular
position in this vector
|
void |
copyFromSafe(int inIndex,
int outIndex,
ListVector from)
Same as
copyFrom(int, int, ListVector) except that
it handles the case when the capacity of the vector needs to be expanded
before copy. |
static ListVector |
empty(String name,
BufferAllocator allocator) |
void |
endValue(int index,
int size)
End the current value
|
ArrowBuf[] |
getBuffers(boolean clear)
Return the underlying buffers associated with this vector.
|
int |
getBufferSize()
Get the size (number of bytes) of underlying buffers used by this
vector
|
List<FieldVector> |
getChildrenFromFields()
the returned list is the same size as the list passed to initializeChildrenFromFields
|
ArrowBuf |
getDataBuffer()
Gets the underlying buffer associated with data vector
|
long |
getDataBufferAddress()
Gets the starting address of the underlying buffer associated with data vector
|
FieldVector |
getDataVector()
Get the inner data vector for this list vector
|
Field |
getField()
Get information about how this field is materialized.
|
List<ArrowBuf> |
getFieldBuffers()
Get the buffers belonging to this vector
|
List<BufferBacked> |
getFieldInnerVectors()
Deprecated.
|
int |
getLastSet() |
Types.MinorType |
getMinorType() |
int |
getNullCount()
Get the number of elements that are null in the vector
|
Object |
getObject(int index)
Get the element in the list vector at a particular index
|
ArrowBuf |
getOffsetBuffer()
Gets the underlying buffer associated with offset vector
|
long |
getOffsetBufferAddress()
Gets the starting address of the underlying buffer associated with offset vector
|
UnionListReader |
getReader() |
TransferPair |
getTransferPair(String ref,
BufferAllocator allocator) |
TransferPair |
getTransferPair(String ref,
BufferAllocator allocator,
CallBack callBack) |
ArrowBuf |
getValidityBuffer()
Gets the underlying buffer associated with validity vector
|
long |
getValidityBufferAddress()
Gets the starting address of the underlying buffer associated with validity vector
|
int |
getValueCapacity()
Get the current value capacity for the vector
|
UnionListWriter |
getWriter() |
void |
initializeChildrenFromFields(List<Field> children)
Initializes the child vectors
to be later loaded with loadBuffers
|
boolean |
isNull(int index)
Check if element at given index is null.
|
int |
isSet(int index)
Same as
isNull(int). |
void |
loadFieldBuffers(ArrowFieldNode fieldNode,
List<ArrowBuf> ownBuffers)
Load the buffers of this vector with provided source buffers.
|
TransferPair |
makeTransferPair(ValueVector target)
makes a new transfer pair used to transfer underlying buffers
|
UnionVector |
promoteToUnion() |
void |
reAlloc()
Resize the vector to increase the capacity.
|
void |
setLastSet(int value) |
void |
setNotNull(int index) |
void |
setValueCount(int valueCount)
Sets the value count for the vector
|
int |
startNewValue(int index)
Start a new value in the list vector
|
allocateOffsetBuffer, getBufferSizeFor, getInnerValueCount, getInnerValueCountAt, getOffsetBufferValueCapacity, getOffsetVector, getValueCount, isEmpty, iterator, reallocOffsetBuffer, replaceDataVector, setInitialCapacity, sizecheckBufRefs, close, compareTypes, getAllocator, getTransferPair, getValidityBufferSizeFromCount, releaseBuffer, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclose, getAllocator, getBufferSizeFor, getTransferPair, getValueCount, setInitialCapacityprotected ArrowBuf validityBuffer
@Deprecated public ListVector(String name, BufferAllocator allocator, CallBack callBack)
@Deprecated public ListVector(String name, BufferAllocator allocator, DictionaryEncoding dictionary, CallBack callBack)
public ListVector(String name, BufferAllocator allocator, FieldType fieldType, CallBack callBack)
public static ListVector empty(String name, BufferAllocator allocator)
public void initializeChildrenFromFields(List<Field> children)
FieldVectorinitializeChildrenFromFields in interface FieldVectorchildren - the schemapublic List<FieldVector> getChildrenFromFields()
FieldVectorgetChildrenFromFields in interface FieldVectorpublic void loadFieldBuffers(ArrowFieldNode fieldNode, List<ArrowBuf> ownBuffers)
loadFieldBuffers in interface FieldVectorfieldNode - the fieldNode indicating the value countownBuffers - the buffers for this Field (own buffers only, children not included)public List<ArrowBuf> getFieldBuffers()
getFieldBuffers in interface FieldVector@Deprecated public List<BufferBacked> getFieldInnerVectors()
getFieldInnerVectors in interface FieldVectorpublic UnionListWriter getWriter()
public void allocateNew()
throws OutOfMemoryException
allocateNewSafe().allocateNew in interface ValueVectorOutOfMemoryException - Thrown if no memory can be allocated.public boolean allocateNewSafe()
allocateNewSafe in interface ValueVectorallocateNewSafe in class BaseRepeatedValueVectorpublic void reAlloc()
reAlloc in interface ValueVectorreAlloc in class BaseRepeatedValueVectorpublic void copyFromSafe(int inIndex,
int outIndex,
ListVector from)
copyFrom(int, int, ListVector) except that
it handles the case when the capacity of the vector needs to be expanded
before copy.inIndex - position to copy from in source vectoroutIndex - position to copy to in this vectorfrom - source vectorpublic void copyFrom(int inIndex,
int outIndex,
ListVector from)
inIndex - position to copy from in source vectoroutIndex - position to copy to in this vectorfrom - source vectorpublic FieldVector getDataVector()
getDataVector in interface RepeatedValueVectorgetDataVector in class BaseRepeatedValueVectorpublic TransferPair getTransferPair(String ref, BufferAllocator allocator)
getTransferPair in interface ValueVectorpublic TransferPair getTransferPair(String ref, BufferAllocator allocator, CallBack callBack)
getTransferPair in interface ValueVectorpublic TransferPair makeTransferPair(ValueVector target)
ValueVectormakeTransferPair in interface ValueVectortarget - the target for the transfertransfer pair that is used to transfer underlying
buffers into the target vector.public long getValidityBufferAddress()
FieldVectorgetValidityBufferAddress in interface FieldVectorpublic long getDataBufferAddress()
FieldVectorgetDataBufferAddress in interface FieldVectorpublic long getOffsetBufferAddress()
FieldVectorgetOffsetBufferAddress in interface FieldVectorpublic ArrowBuf getValidityBuffer()
ValueVectorgetValidityBuffer in interface ValueVectorpublic ArrowBuf getDataBuffer()
ValueVectorgetDataBuffer in interface ValueVectorpublic ArrowBuf getOffsetBuffer()
ValueVectorgetOffsetBuffer in interface ValueVectorpublic UnionListReader getReader()
getReader in interface ValueVectorfield reader that supports reading values
from this vector.public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(FieldType fieldType)
addOrGetVector in interface PromotableVectoraddOrGetVector in class BaseRepeatedValueVectorpublic int getBufferSize()
getBufferSize in interface ValueVectorgetBufferSize in class BaseRepeatedValueVectorpublic Field getField()
ValueVectorgetField in interface ValueVectorpublic Types.MinorType getMinorType()
getMinorType in interface ValueVectorpublic void clear()
ValueVectorclear in interface ValueVectorclear in class BaseRepeatedValueVectorpublic ArrowBuf[] getBuffers(boolean clear)
getBuffers in interface ValueVectorgetBuffers in class BaseRepeatedValueVectorclear - 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.public UnionVector promoteToUnion()
promoteToUnion in interface PromotableVectorpublic Object getObject(int index)
getObject in interface ValueVectorindex - position of the elementpublic boolean isNull(int index)
isNull in interface ValueVectorisNull in class BaseRepeatedValueVectorindex - position of elementpublic int isSet(int index)
isNull(int).index - position of elementpublic int getNullCount()
getNullCount in interface ValueVectorpublic int getValueCapacity()
getValueCapacity in interface ValueVectorgetValueCapacity in class BaseRepeatedValueVectorpublic void setNotNull(int index)
public int startNewValue(int index)
startNewValue in class BaseRepeatedValueVectorindex - index of the value to startpublic void endValue(int index,
int size)
index - index of the value to endsize - number of elements in the list that was writtenpublic void setValueCount(int valueCount)
setValueCount in interface ValueVectorsetValueCount in class BaseRepeatedValueVectorvalueCount - value countpublic void setLastSet(int value)
public int getLastSet()
Copyright © 2017 The Apache Software Foundation. All rights reserved.