public abstract class BaseRepeatedValueVector extends BaseValueVector implements RepeatedValueVector
Modifier and Type | Class and Description |
---|---|
class |
BaseRepeatedValueVector.BaseRepeatedAccessor |
class |
BaseRepeatedValueVector.BaseRepeatedMutator |
protected class |
BaseRepeatedValueVector.BaseRepeatedValueVectorTransferPair<T extends BaseRepeatedValueVector> |
BaseValueVector.BaseAccessor, BaseValueVector.BaseMutator
RepeatedValueVector.RepeatedAccessor, RepeatedValueVector.RepeatedMutator
ValueVector.Accessor, ValueVector.Mutator
Modifier and Type | Field and Description |
---|---|
static String |
DATA_VECTOR_NAME |
static ValueVector |
DEFAULT_DATA_VECTOR |
protected UInt4Vector |
offsets |
static MaterializedField |
OFFSETS_FIELD |
static String |
OFFSETS_VECTOR_NAME |
protected ValueVector |
vector |
allocator, field, INITIAL_VALUE_ALLOCATION, MAX_ALLOCATION_SIZE
DEFAULT_REPEAT_PER_RECORD
BITS_VECTOR_NAME, MAX_BUFFER_SIZE, MAX_ROW_COUNT, MIN_ROW_COUNT, VALUES_VECTOR_NAME
Modifier | Constructor and Description |
---|---|
protected |
BaseRepeatedValueVector(MaterializedField field,
BufferAllocator allocator) |
protected |
BaseRepeatedValueVector(MaterializedField field,
BufferAllocator allocator,
ValueVector vector) |
Modifier and Type | Method and Description |
---|---|
<T extends ValueVector> |
addOrGetVector(VectorDescriptor descriptor)
Creates and adds a child vector if none with the same name exists, else returns the vector instance.
|
boolean |
allocateNewSafe()
Allocates new buffers.
|
void |
clear()
Release the underlying DrillBuf and reset the ValueVector to empty.
|
void |
collectLedgers(Set<AllocationManager.BufferLedger> ledgers)
Add the ledgers underlying the buffers underlying the components of the
vector to the set provided.
|
void |
exchange(ValueVector other)
Exchange state with another value vector of the same type.
|
int |
getAllocatedSize()
Returns the total size of buffers allocated by this vector.
|
DrillBuf[] |
getBuffers(boolean clear)
Return the underlying buffers associated with this vector.
|
int |
getBufferSize()
Returns the number of bytes that is used by this vector instance.
|
int |
getBufferSizeFor(int valueCount)
Returns the number of bytes that is used by this vector if it holds the given number
of values.
|
ValueVector |
getDataVector() |
protected UserBitShared.SerializedField.Builder |
getMetadataBuilder() |
UInt4Vector |
getOffsetVector() |
int |
getPayloadByteCount(int valueCount)
Return the number of value bytes consumed by actual data.
|
int |
getValueCapacity()
Returns the maximum number of values that can be stored in this vector instance.
|
Iterator<ValueVector> |
iterator() |
void |
load(UserBitShared.SerializedField metadata,
DrillBuf buffer)
Load the data provided in the buffer.
|
protected void |
replaceDataVector(ValueVector v) |
void |
setChildVector(ValueVector childVector) |
void |
setInitialCapacity(int numRecords)
Set the initial record capacity
|
int |
size()
Returns 1 if inner vector is explicitly set via #addOrGetVector else 0
|
checkBufRefs, close, fillBitsVector, getAllocator, getField, getField, getMetadata, getTransferPair, toNullable, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAccessor, getMutator
allocateNew, close, copyEntry, getAllocator, getField, getMetadata, getReader, getTransferPair, getTransferPair, makeTransferPair, toNullable
forEach, spliterator
public static final ValueVector DEFAULT_DATA_VECTOR
public static final String OFFSETS_VECTOR_NAME
public static final String DATA_VECTOR_NAME
public static final MaterializedField OFFSETS_FIELD
protected final UInt4Vector offsets
protected ValueVector vector
protected BaseRepeatedValueVector(MaterializedField field, BufferAllocator allocator)
protected BaseRepeatedValueVector(MaterializedField field, BufferAllocator allocator, ValueVector vector)
public boolean allocateNewSafe()
ValueVector
allocateNewSafe
in interface ValueVector
public UInt4Vector getOffsetVector()
getOffsetVector
in interface RepeatedValueVector
public ValueVector getDataVector()
getDataVector
in interface RepeatedValueVector
public void setInitialCapacity(int numRecords)
ValueVector
setInitialCapacity
in interface ValueVector
public int getValueCapacity()
ValueVector
getValueCapacity
in interface ValueVector
protected UserBitShared.SerializedField.Builder getMetadataBuilder()
getMetadataBuilder
in class BaseValueVector
public int getBufferSize()
ValueVector
getBufferSize
in interface ValueVector
public int getAllocatedSize()
ValueVector
getAllocatedSize
in interface ValueVector
public int getBufferSizeFor(int valueCount)
ValueVector
getBufferSizeFor
in interface ValueVector
valueCount
- the number of values to assume this vector containspublic Iterator<ValueVector> iterator()
iterator
in interface Iterable<ValueVector>
iterator
in class BaseValueVector
public void clear()
ValueVector
clear
in interface ValueVector
clear
in class BaseValueVector
public DrillBuf[] getBuffers(boolean clear)
ValueVector
getBuffers
in interface ValueVector
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 void load(UserBitShared.SerializedField metadata, DrillBuf buffer)
ValueVector
load
in interface ValueVector
metadata
- Metadata used to decode the incoming buffer.buffer
- The buffer that contains the ValueVector.public int size()
size
in interface ContainerVectorLike
ContainerVectorLike.size()
public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor)
ContainerVectorLike
addOrGetVector
in interface ContainerVectorLike
descriptor
- vector descriptorprotected void replaceDataVector(ValueVector v)
public void setChildVector(ValueVector childVector)
public void collectLedgers(Set<AllocationManager.BufferLedger> ledgers)
ValueVector
collectLedgers
in interface ValueVector
ledgers
- set of ledgers to which to add ledgers for this vectorpublic int getPayloadByteCount(int valueCount)
ValueVector
getPayloadByteCount
in interface ValueVector
public void exchange(ValueVector other)
ValueVector
exchange
in interface ValueVector
Copyright © 1970 The Apache Software Foundation. All rights reserved.