public abstract class AbstractRepeatedMapVector extends AbstractMapVector implements RepeatedValueVector
Modifier and Type | Class and Description |
---|---|
class |
AbstractRepeatedMapVector.Accessor |
class |
AbstractRepeatedMapVector.Mutator |
RepeatedValueVector.RepeatedAccessor, RepeatedValueVector.RepeatedMutator
Modifier and Type | Field and Description |
---|---|
protected EmptyValuePopulator |
emptyPopulator |
protected UInt4Vector |
offsets |
allocator, callBack, field
DEFAULT_REPEAT_PER_RECORD
BITS_VECTOR_NAME, MAX_BUFFER_SIZE, MAX_ROW_COUNT, MIN_ROW_COUNT, OFFSETS_VECTOR_NAME, VALUES_VECTOR_NAME
Modifier | Constructor and Description |
---|---|
protected |
AbstractRepeatedMapVector(MaterializedField field,
BufferAllocator allocator,
CallBack callBack) |
protected |
AbstractRepeatedMapVector(MaterializedField field,
UInt4Vector offsets,
CallBack callBack) |
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.
|
void |
allocateNew(int groupCount,
int innerValueCount) |
boolean |
allocateNewSafe()
Allocates new buffers.
|
void |
allocateOffsetsNew(int groupCount) |
void |
clear()
Release the underlying DrillBuf and reset the ValueVector to empty.
|
void |
close()
Clears out all underlying child vectors.
|
void |
collectLedgers(Set<AllocationManager.BufferLedger> ledgers)
Add the ledgers underlying the buffers underlying the components of the
vector to the set provided.
|
void |
copyEntry(int toIndex,
ValueVector from,
int fromIndex) |
void |
copyFromSafe(int fromIndex,
int thisIndex,
AbstractRepeatedMapVector from) |
void |
exchange(ValueVector other)
Exchange state with another value vector of the same type.
|
Iterator<String> |
fieldNameIterator() |
abstract AbstractRepeatedMapVector.Accessor |
getAccessor()
Returns an
accessor that is used to read from this vector
instance. |
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() |
UserBitShared.SerializedField |
getMetadata()
Get the metadata for this field.
|
UInt4Vector |
getOffsetVector() |
int |
getPayloadByteCount(int valueCount)
Return the number of value bytes consumed by actual data.
|
List<ValueVector> |
getPrimitiveVectors()
Returns a list of scalar child vectors recursing the entire vector hierarchy.
|
TransferPair |
getTransferPairToSingleMap(String reference,
BufferAllocator allocator) |
int |
getValueCapacity()
Returns the maximum number of values that can be stored in this vector instance.
|
void |
load(UserBitShared.SerializedField metadata,
DrillBuf buffer)
Load the data provided in the buffer.
|
void |
setInitialCapacity(int numRecords)
Set the initial record capacity
|
void |
toNullable(ValueVector nullableVector)
Convert a non-nullable vector to nullable by shuffling the data from
one to the other.
|
addOrGet, getChild, getChildByOrdinal, getChildren, getChildVectorWithOrdinal, iterator, putChild, putVector, size
allocateNew, getAllocator, getChild, getChildFieldNames, getField, supportsDirectRead, typeify
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getMutator
allocateNew, getAllocator, getField, getReader, getTransferPair, getTransferPair, makeTransferPair
forEach, iterator, spliterator
size
protected final UInt4Vector offsets
protected final EmptyValuePopulator emptyPopulator
protected AbstractRepeatedMapVector(MaterializedField field, BufferAllocator allocator, CallBack callBack)
protected AbstractRepeatedMapVector(MaterializedField field, UInt4Vector offsets, CallBack callBack)
public UInt4Vector getOffsetVector()
getOffsetVector
in interface RepeatedValueVector
public ValueVector getDataVector()
getDataVector
in interface RepeatedValueVector
public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor)
ContainerVectorLike
addOrGetVector
in interface ContainerVectorLike
descriptor
- vector descriptorpublic void setInitialCapacity(int numRecords)
ValueVector
setInitialCapacity
in interface ValueVector
public void allocateNew(int groupCount, int innerValueCount)
public void allocateOffsetsNew(int groupCount)
public List<ValueVector> getPrimitiveVectors()
AbstractMapVector
getPrimitiveVectors
in class AbstractMapVector
public int getBufferSize()
ValueVector
getBufferSize
in interface ValueVector
getBufferSize
in class AbstractMapVector
public int getAllocatedSize()
ValueVector
getAllocatedSize
in interface ValueVector
getAllocatedSize
in class AbstractMapVector
public int getBufferSizeFor(int valueCount)
ValueVector
getBufferSizeFor
in interface ValueVector
valueCount
- the number of values to assume this vector containspublic void close()
AbstractContainerVector
close
in interface Closeable
close
in interface AutoCloseable
close
in interface ValueVector
close
in class AbstractMapVector
public TransferPair getTransferPairToSingleMap(String reference, BufferAllocator allocator)
public boolean allocateNewSafe()
ValueVector
allocateNewSafe
in interface ValueVector
allocateNewSafe
in class AbstractMapVector
public void copyFromSafe(int fromIndex, int thisIndex, AbstractRepeatedMapVector from)
public void copyEntry(int toIndex, ValueVector from, int fromIndex)
copyEntry
in interface ValueVector
public int getValueCapacity()
ValueVector
getValueCapacity
in interface ValueVector
public void exchange(ValueVector other)
ValueVector
exchange
in interface ValueVector
exchange
in class AbstractMapVector
public DrillBuf[] getBuffers(boolean clear)
ValueVector
getBuffers
in interface ValueVector
getBuffers
in class AbstractMapVector
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 UserBitShared.SerializedField getMetadata()
ValueVector
getMetadata
in interface ValueVector
public void clear()
ValueVector
clear
in interface ValueVector
public void collectLedgers(Set<AllocationManager.BufferLedger> ledgers)
ValueVector
collectLedgers
in interface ValueVector
collectLedgers
in class AbstractMapVector
ledgers
- set of ledgers to which to add ledgers for this vectorpublic void toNullable(ValueVector nullableVector)
ValueVector
toNullable
in interface ValueVector
nullableVector
- nullable vector of the same minor type as
this vectorpublic int getPayloadByteCount(int valueCount)
ValueVector
getPayloadByteCount
in interface ValueVector
getPayloadByteCount
in class AbstractMapVector
public abstract AbstractRepeatedMapVector.Accessor getAccessor()
ValueVector
accessor
that is used to read from this vector
instance.getAccessor
in interface RepeatedValueVector
getAccessor
in interface ValueVector
Copyright © 1970 The Apache Software Foundation. All rights reserved.