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, vector
allocator, INITIAL_VALUE_ALLOCATION, MAX_ALLOCATION_SIZE, MAX_ALLOCATION_SIZE_PROPERTY, name
DEFAULT_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, size
checkBufRefs, close, compareTypes, getAllocator, getTransferPair, getValidityBufferSizeFromCount, releaseBuffer, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close, getAllocator, getBufferSizeFor, getTransferPair, getValueCount, setInitialCapacity
protected 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)
FieldVector
initializeChildrenFromFields
in interface FieldVector
children
- the schemapublic List<FieldVector> getChildrenFromFields()
FieldVector
getChildrenFromFields
in interface FieldVector
public void loadFieldBuffers(ArrowFieldNode fieldNode, List<ArrowBuf> ownBuffers)
loadFieldBuffers
in interface FieldVector
fieldNode
- 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 FieldVector
public UnionListWriter getWriter()
public void allocateNew() throws OutOfMemoryException
allocateNewSafe()
.allocateNew
in interface ValueVector
OutOfMemoryException
- Thrown if no memory can be allocated.public boolean allocateNewSafe()
allocateNewSafe
in interface ValueVector
allocateNewSafe
in class BaseRepeatedValueVector
public void reAlloc()
reAlloc
in interface ValueVector
reAlloc
in class BaseRepeatedValueVector
public 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 RepeatedValueVector
getDataVector
in class BaseRepeatedValueVector
public TransferPair getTransferPair(String ref, BufferAllocator allocator)
getTransferPair
in interface ValueVector
public TransferPair getTransferPair(String ref, BufferAllocator allocator, CallBack callBack)
getTransferPair
in interface ValueVector
public TransferPair makeTransferPair(ValueVector target)
ValueVector
makeTransferPair
in interface ValueVector
target
- the target for the transfertransfer pair
that is used to transfer underlying
buffers into the target vector.public long getValidityBufferAddress()
FieldVector
getValidityBufferAddress
in interface FieldVector
public long getDataBufferAddress()
FieldVector
getDataBufferAddress
in interface FieldVector
public long getOffsetBufferAddress()
FieldVector
getOffsetBufferAddress
in interface FieldVector
public ArrowBuf getValidityBuffer()
ValueVector
getValidityBuffer
in interface ValueVector
public ArrowBuf getDataBuffer()
ValueVector
getDataBuffer
in interface ValueVector
public ArrowBuf getOffsetBuffer()
ValueVector
getOffsetBuffer
in interface ValueVector
public UnionListReader getReader()
getReader
in interface ValueVector
field reader
that supports reading values
from this vector.public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(FieldType fieldType)
addOrGetVector
in interface PromotableVector
addOrGetVector
in class BaseRepeatedValueVector
public int getBufferSize()
getBufferSize
in interface ValueVector
getBufferSize
in class BaseRepeatedValueVector
public Field getField()
ValueVector
getField
in interface ValueVector
public Types.MinorType getMinorType()
getMinorType
in interface ValueVector
public void clear()
ValueVector
clear
in interface ValueVector
clear
in class BaseRepeatedValueVector
public ArrowBuf[] getBuffers(boolean clear)
getBuffers
in interface ValueVector
getBuffers
in class BaseRepeatedValueVector
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.public UnionVector promoteToUnion()
promoteToUnion
in interface PromotableVector
public Object getObject(int index)
getObject
in interface ValueVector
index
- position of the elementpublic boolean isNull(int index)
isNull
in interface ValueVector
isNull
in class BaseRepeatedValueVector
index
- position of elementpublic int isSet(int index)
isNull(int)
.index
- position of elementpublic int getNullCount()
getNullCount
in interface ValueVector
public int getValueCapacity()
getValueCapacity
in interface ValueVector
getValueCapacity
in class BaseRepeatedValueVector
public void setNotNull(int index)
public int startNewValue(int index)
startNewValue
in class BaseRepeatedValueVector
index
- 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 ValueVector
setValueCount
in class BaseRepeatedValueVector
valueCount
- value countpublic void setLastSet(int value)
public int getLastSet()
Copyright © 2017 The Apache Software Foundation. All rights reserved.