public abstract class BaseRepeatedValueVector extends BaseValueVector implements RepeatedValueVector, BaseListVector
| Modifier and Type | Field and Description |
|---|---|
static String |
DATA_VECTOR_NAME |
static FieldVector |
DEFAULT_DATA_VECTOR |
protected String |
defaultDataVectorName |
static byte |
OFFSET_WIDTH |
protected long |
offsetAllocationSizeInBytes |
protected ArrowBuf |
offsetBuffer |
protected CallBack |
repeatedCallBack |
protected int |
valueCount |
protected FieldVector |
vector |
allocator, fieldReader, INITIAL_VALUE_ALLOCATION, MAX_ALLOCATION_SIZE, MAX_ALLOCATION_SIZE_PROPERTYDEFAULT_REPEAT_PER_RECORD| Modifier | Constructor and Description |
|---|---|
protected |
BaseRepeatedValueVector(String name,
BufferAllocator allocator,
CallBack callBack) |
protected |
BaseRepeatedValueVector(String name,
BufferAllocator allocator,
FieldVector vector,
CallBack callBack) |
| Modifier and Type | Method and Description |
|---|---|
<T extends ValueVector> |
addOrGetVector(FieldType fieldType)
Initialize the data vector (and execute callback) if it hasn't already been done,
returns the data vector.
|
boolean |
allocateNewSafe()
Allocates new buffers.
|
protected ArrowBuf |
allocateOffsetBuffer(long size) |
void |
clear()
Release any owned ArrowBuf and reset the ValueVector to the initial state.
|
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.
|
FieldVector |
getDataVector()
Get the data vector.
|
int |
getInnerValueCount() |
int |
getInnerValueCountAt(int index)
Returns the value count for inner data vector at a particular index.
|
String |
getName()
Gets the name of the vector.
|
protected int |
getOffsetBufferValueCapacity() |
UInt4Vector |
getOffsetVector()
Deprecated.
This API will be removed, as the current implementations no longer hold inner offset vectors.
|
int |
getValueCapacity()
Returns the maximum number of values that can be stored in this vector instance.
|
int |
getValueCount()
Gets the number of values.
|
boolean |
isEmpty(int index)
Return if value at index is empty (this implementation is always false).
|
boolean |
isNull(int index)
Return if value at index is null (this implementation is always false).
|
Iterator<ValueVector> |
iterator() |
void |
reAlloc()
Allocate new buffer with double capacity, and copy data into the new buffer.
|
protected void |
reallocOffsetBuffer() |
protected void |
replaceDataVector(FieldVector v) |
void |
reset()
Reset the ValueVector to the initial state without releasing any owned ArrowBuf.
|
void |
setInitialCapacity(int numRecords)
Set the initial record capacity.
|
void |
setInitialCapacity(int numRecords,
double density)
Specialized version of setInitialCapacity() for ListVector.
|
void |
setInitialTotalCapacity(int numRecords,
int totalNumberOfElements)
Specialized version of setInitialTotalCapacity() for ListVector.
|
void |
setValueCount(int valueCount)
Preallocates the number of repeated values.
|
int |
size()
Get value indicating if inner vector is set.
|
int |
startNewValue(int index)
Starts a new repeated value.
|
checkBufRefs, close, copyFrom, copyFromSafe, getAllocator, getReader, getReaderImpl, getTransferPair, getValidityBufferSizeFromCount, releaseBuffer, toString, transferBufferclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetElementEndIndex, getElementStartIndexexportBuffer, exportCDataBuffers, getChildrenFromFields, getDataBufferAddress, getFieldBuffers, getFieldInnerVectors, getOffsetBufferAddress, getValidityBufferAddress, initializeChildrenFromFields, loadFieldBuffers, setNullaccept, allocateNew, close, copyFrom, copyFromSafe, getAllocator, getDataBuffer, getField, getMinorType, getNullCount, getObject, getOffsetBuffer, getReader, getTransferPair, getTransferPair, getTransferPair, getTransferPair, getTransferPair, getValidityBuffer, hashCode, hashCode, makeTransferPair, validate, validateFullforEach, spliteratorpublic static final FieldVector DEFAULT_DATA_VECTOR
public static final String DATA_VECTOR_NAME
public static final byte OFFSET_WIDTH
protected ArrowBuf offsetBuffer
protected FieldVector vector
protected final CallBack repeatedCallBack
protected int valueCount
protected long offsetAllocationSizeInBytes
protected String defaultDataVectorName
protected BaseRepeatedValueVector(String name, BufferAllocator allocator, CallBack callBack)
protected BaseRepeatedValueVector(String name, BufferAllocator allocator, FieldVector vector, CallBack callBack)
public String getName()
ValueVectorgetName in interface ValueVectorgetName in class BaseValueVectorpublic boolean allocateNewSafe()
ValueVectorallocateNewSafe in interface ValueVectorprotected ArrowBuf allocateOffsetBuffer(long size)
public void reAlloc()
ValueVectorreAlloc in interface ValueVectorprotected void reallocOffsetBuffer()
@Deprecated public UInt4Vector getOffsetVector()
getOffsetVector in interface RepeatedValueVectorpublic FieldVector getDataVector()
RepeatedValueVectorgetDataVector in interface RepeatedValueVectorpublic void setInitialCapacity(int numRecords)
ValueVectorsetInitialCapacity in interface ValueVectornumRecords - the initial record capacity.public void setInitialCapacity(int numRecords,
double density)
setInitialCapacity in interface DensityAwareVectornumRecords - value countdensity - density of ListVector. Density is the average size of
list per position in the List vector. For example, a
density value of 10 implies each position in the list
vector has a list of 10 values.
A density value of 0.1 implies out of 10 positions in
the list vector, 1 position has a list of size 1 and
remaining positions are null (no lists) or empty lists.
This helps in tightly controlling the memory we provision
for inner data vector.public void setInitialTotalCapacity(int numRecords,
int totalNumberOfElements)
numRecords - value counttotalNumberOfElements - the total number of elements to to allow
for in this vector across all records.public int getValueCapacity()
ValueVectorgetValueCapacity in interface ValueVectorprotected int getOffsetBufferValueCapacity()
public 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 fieldType)
protected void replaceDataVector(FieldVector v)
public int getValueCount()
ValueVectorgetValueCount in interface ValueVectorpublic int getInnerValueCount()
public int getInnerValueCountAt(int index)
public boolean isNull(int index)
isNull in interface ValueVectorindex - index to check for nullpublic boolean isEmpty(int index)
public int startNewValue(int index)
public void setValueCount(int valueCount)
setValueCount in interface ValueVectorCopyright © 2024 The Apache Software Foundation. All rights reserved.