public class FixedSizeListVector extends BaseValueVector implements BaseListVector, PromotableVector
allocator, fieldReader, INITIAL_VALUE_ALLOCATION, MAX_ALLOCATION_SIZE, MAX_ALLOCATION_SIZE_PROPERTY| Constructor and Description |
|---|
FixedSizeListVector(String name,
BufferAllocator allocator,
FieldType fieldType,
CallBack unusedSchemaChangeCallback)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
<OUT,IN> OUT |
accept(VectorVisitor<OUT,IN> visitor,
IN value)
Accept a generic
VectorVisitor and return the result. |
<T extends ValueVector> |
addOrGetVector(FieldType type) |
void |
allocateNew()
Allocate new buffers.
|
boolean |
allocateNewSafe()
Allocates new buffers.
|
void |
clear()
Release any owned ArrowBuf and reset the ValueVector to the initial state.
|
void |
copyFrom(int fromIndex,
int thisIndex,
ValueVector 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,
ValueVector from)
Same as
ValueVector.copyFrom(int, int, ValueVector) except that
it handles the case when the capacity of the vector needs to be expanded
before copy. |
static FixedSizeListVector |
empty(String name,
int size,
BufferAllocator allocator) |
ArrowBuf[] |
getBuffers(boolean clear)
Return the underlying buffers associated with this vector.
|
int |
getBufferSize()
Get the number of bytes used by this vector.
|
int |
getBufferSizeFor(int valueCount)
Returns the number of bytes that is used by this vector if it holds the given number
of values.
|
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() |
int |
getElementEndIndex(int index)
Get data vector end index with the given list index.
|
int |
getElementStartIndex(int index)
Get data vector start index with the given list index.
|
Field |
getField()
Get information about how this field is materialized.
|
List<ArrowBuf> |
getFieldBuffers()
Get the buffers of the fields, (same size as getFieldVectors() since it is their content).
|
List<BufferBacked> |
getFieldInnerVectors()
Deprecated.
This API will be removed as the current implementations no longer support inner vectors.
|
int |
getListSize()
Get the fixed size for each list.
|
Types.MinorType |
getMinorType() |
String |
getName()
Gets the name of the vector.
|
int |
getNullCount()
Returns number of null elements in the vector.
|
List<?> |
getObject(int index)
Get friendly type object from the vector.
|
ArrowBuf |
getOffsetBuffer()
Gets the underlying buffer associated with offset vector.
|
long |
getOffsetBufferAddress()
Gets the starting address of the underlying buffer associated with offset vector.
|
UnionFixedSizeListReader |
getReader()
Default implementation to create a reader for the vector.
|
protected FieldReader |
getReaderImpl()
Each vector has a different reader that implements the FieldReader interface.
|
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()
Returns the maximum number of values that can be stored in this vector instance.
|
int |
getValueCount()
Gets the number of values.
|
UnionFixedSizeListWriter |
getWriter() |
int |
hashCode(int index)
Returns hashCode of element in index with the default hasher.
|
int |
hashCode(int index,
ArrowBufHasher hasher)
Returns hashCode of element in index with the given hasher.
|
void |
initializeChildrenFromFields(List<Field> children)
Initializes the child vectors
to be later loaded with loadBuffers.
|
boolean |
isNull(int index)
Returns whether the value at index null.
|
int |
isSet(int index)
Returns non-zero when the value at index is non-null.
|
Iterator<ValueVector> |
iterator() |
void |
loadFieldBuffers(ArrowFieldNode fieldNode,
List<ArrowBuf> ownBuffers)
Loads data in the vectors.
|
TransferPair |
makeTransferPair(ValueVector target)
Makes a new transfer pair used to transfer underlying buffers.
|
UnionVector |
promoteToUnion() |
void |
reAlloc()
Allocate new buffer with double capacity, and copy data into the new buffer.
|
void |
reset()
Reset the ValueVector to the initial state without releasing any owned ArrowBuf.
|
void |
setInitialCapacity(int numRecords)
Set the initial record capacity.
|
void |
setNotNull(int index)
Sets the value at index to not-null.
|
void |
setNull(int index)
Sets the value at index to null.
|
void |
setValueCount(int valueCount)
Set number of values in the vector.
|
int |
size()
Get value indicating if inner vector is set.
|
int |
startNewValue(int index)
Start a new value in the list vector.
|
checkBufRefs, close, getAllocator, getTransferPair, getValidityBufferSizeFromCount, releaseBuffer, toString, transferBufferclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclose, getAllocator, getTransferPair, validate, validateFullforEach, spliteratorpublic FixedSizeListVector(String name, BufferAllocator allocator, FieldType fieldType, CallBack unusedSchemaChangeCallback)
name - The name for the vector.allocator - The allocator to use for creating/reallocating buffers for the vector.fieldType - The underlying data type of the vector.unusedSchemaChangeCallback - Currently unused.public static FixedSizeListVector empty(String name, int size, BufferAllocator allocator)
public Field getField()
ValueVectorgetField in interface ValueVectorpublic Types.MinorType getMinorType()
getMinorType in interface ValueVectorpublic String getName()
ValueVectorgetName in interface ValueVectorgetName in class BaseValueVectorpublic int getListSize()
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)
FieldVectorloadFieldBuffers in interface FieldVectorfieldNode - the fieldNodeownBuffers - the buffers for this Field (own buffers only, children not included)public List<ArrowBuf> getFieldBuffers()
FieldVectorgetFieldBuffers in interface FieldVector@Deprecated public List<BufferBacked> getFieldInnerVectors()
getFieldInnerVectors in interface FieldVectorprotected FieldReader getReaderImpl()
BaseValueVectorgetReaderImpl in class BaseValueVectorpublic UnionFixedSizeListReader getReader()
BaseValueVectorBaseValueVector.getReaderImpl() to initialize the reader appropriately.getReader in interface ValueVectorgetReader in class BaseValueVectorpublic void allocateNew()
throws OutOfMemoryException
ValueVectorallocateNew in interface ValueVectorOutOfMemoryException - Thrown if no memory can be allocated.public boolean allocateNewSafe()
ValueVectorallocateNewSafe in interface ValueVectorpublic void reAlloc()
ValueVectorreAlloc in interface ValueVectorpublic FieldVector getDataVector()
public int startNewValue(int index)
index - index of the value to startpublic UnionFixedSizeListWriter getWriter()
public void setInitialCapacity(int numRecords)
ValueVectorsetInitialCapacity in interface ValueVectornumRecords - the initial record capacity.public int getValueCapacity()
ValueVectorgetValueCapacity in interface ValueVectorpublic int getBufferSize()
ValueVectorgetBufferSize in interface ValueVectorpublic int getBufferSizeFor(int valueCount)
ValueVectorgetBufferSizeFor in interface ValueVectorvalueCount - the number of values to assume this vector containspublic Iterator<ValueVector> iterator()
iterator in interface Iterable<ValueVector>iterator in class BaseValueVectorpublic void clear()
ValueVectorclear in interface ValueVectorclear in class BaseValueVectorpublic void reset()
ValueVectorreset in interface ValueVectorpublic ArrowBuf[] getBuffers(boolean clear)
ValueVectorgetBuffers in interface ValueVectorclear - 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 int size()
public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(FieldType type)
addOrGetVector in interface PromotableVectorpublic void copyFromSafe(int inIndex,
int outIndex,
ValueVector from)
ValueVectorValueVector.copyFrom(int, int, ValueVector) except that
it handles the case when the capacity of the vector needs to be expanded
before copy.copyFromSafe in interface ValueVectorcopyFromSafe in class BaseValueVectorinIndex - position to copy from in source vectoroutIndex - position to copy to in this vectorfrom - source vectorpublic void copyFrom(int fromIndex,
int thisIndex,
ValueVector from)
ValueVectorcopyFrom in interface ValueVectorcopyFrom in class BaseValueVectorfromIndex - position to copy from in source vectorthisIndex - position to copy to in this vectorfrom - source vectorpublic UnionVector promoteToUnion()
promoteToUnion in interface PromotableVectorpublic 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 List<?> getObject(int index)
ValueVectorgetObject in interface ValueVectorindex - index of object to getpublic boolean isNull(int index)
isNull in interface ValueVectorindex - index to check for nullpublic int isSet(int index)
public int getNullCount()
ValueVectorgetNullCount in interface ValueVectorpublic int getValueCount()
ValueVectorgetValueCount in interface ValueVectorpublic void setNull(int index)
setNull in interface FieldVectorindex - the value to changepublic void setNotNull(int index)
public void setValueCount(int valueCount)
ValueVectorsetValueCount in interface ValueVectorpublic 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 int hashCode(int index)
ValueVectorhashCode in interface ValueVectorpublic int hashCode(int index,
ArrowBufHasher hasher)
ValueVectorhashCode in interface ValueVectorpublic <OUT,IN> OUT accept(VectorVisitor<OUT,IN> visitor, IN value)
ValueVectorVectorVisitor and return the result.accept in interface ValueVectorOUT - the output result type.IN - the input data together with visitor.public int getElementStartIndex(int index)
BaseListVectorgetElementStartIndex in interface BaseListVectorpublic int getElementEndIndex(int index)
BaseListVectorgetElementEndIndex in interface BaseListVectorCopyright © 2023 The Apache Software Foundation. All rights reserved.