public class RepeatedListVector extends AbstractContainerVector implements RepeatedValueVector
Modifier and Type | Class and Description |
---|---|
protected static class |
RepeatedListVector.DelegateRepeatedVector |
protected class |
RepeatedListVector.RepeatedListTransferPair |
RepeatedValueVector.RepeatedAccessor, RepeatedValueVector.RepeatedMutator
ValueVector.Accessor, ValueVector.Mutator
Modifier and Type | Field and Description |
---|---|
static TypeProtos.MajorType |
TYPE |
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 |
---|---|
|
RepeatedListVector(MaterializedField field,
BufferAllocator allocator,
CallBack callBack) |
protected |
RepeatedListVector(MaterializedField field,
BufferAllocator allocator,
CallBack callBack,
RepeatedListVector.DelegateRepeatedVector delegate) |
|
RepeatedListVector(String path,
BufferAllocator allocator,
CallBack callBack) |
Modifier and Type | Method and Description |
---|---|
<T extends ValueVector> |
addOrGet(String name,
TypeProtos.MajorType type,
Class<T> clazz)
Deprecated.
prefer using
addOrGetVector(org.apache.drill.exec.vector.VectorDescriptor) instead. |
<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()
Allocate new buffers.
|
void |
allocateNew(int valueCount,
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,
RepeatedListVector from) |
void |
exchange(ValueVector other)
Exchange state with another value vector of the same type.
|
RepeatedListVector.DelegateRepeatedVector.RepeatedListAccessor |
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.
|
<T extends ValueVector> |
getChild(String name,
Class<T> clazz) |
VectorWithOrdinal |
getChildVectorWithOrdinal(String name) |
ValueVector |
getDataVector() |
UserBitShared.SerializedField |
getMetadata()
Get the metadata for this field.
|
RepeatedListVector.DelegateRepeatedVector.RepeatedListMutator |
getMutator()
Returns an
mutator that is used to write to this vector
instance. |
UInt4Vector |
getOffsetVector() |
int |
getPayloadByteCount(int valueCount)
Return the number of value bytes consumed by actual data.
|
RepeatedListReaderImpl |
getReader()
Returns a
field reader that supports reading values
from this vector. |
TransferPair |
getTransferPair(BufferAllocator allocator)
Returns a
transfer pair , creating a new target vector of
the same type. |
TransferPair |
getTransferPair(String ref,
BufferAllocator allocator) |
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 buf)
Load the data provided in the buffer.
|
TransferPair |
makeTransferPair(ValueVector to)
Returns a new
transfer pair that is used to transfer underlying
buffers into the target vector. |
void |
setChildVector(ValueVector childVector) |
void |
setInitialCapacity(int numRecords)
Set the initial record capacity
|
int |
size()
Returns the number of child vectors in this container vector-like instance.
|
void |
toNullable(ValueVector nullableVector)
Convert a non-nullable vector to nullable by shuffling the data from
one to the other.
|
getAllocator, getChild, getChildFieldNames, getField, supportsDirectRead, typeify
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAllocator, getField
forEach, spliterator
public static final TypeProtos.MajorType TYPE
public RepeatedListVector(String path, BufferAllocator allocator, CallBack callBack)
public RepeatedListVector(MaterializedField field, BufferAllocator allocator, CallBack callBack)
protected RepeatedListVector(MaterializedField field, BufferAllocator allocator, CallBack callBack, RepeatedListVector.DelegateRepeatedVector delegate)
public RepeatedListReaderImpl getReader()
ValueVector
field reader
that supports reading values
from this vector.getReader
in interface ValueVector
public RepeatedListVector.DelegateRepeatedVector.RepeatedListAccessor getAccessor()
ValueVector
accessor
that is used to read from this vector
instance.getAccessor
in interface RepeatedValueVector
getAccessor
in interface ValueVector
public RepeatedListVector.DelegateRepeatedVector.RepeatedListMutator getMutator()
ValueVector
mutator
that is used to write to this vector
instance.getMutator
in interface RepeatedValueVector
getMutator
in interface ValueVector
public UInt4Vector getOffsetVector()
getOffsetVector
in interface RepeatedValueVector
public ValueVector getDataVector()
getDataVector
in interface RepeatedValueVector
public void allocateNew() throws OutOfMemoryException
ValueVector
allocateNew
in interface ValueVector
allocateNew
in class AbstractContainerVector
OutOfMemoryException
- Thrown if no memory can be allocated.public boolean allocateNewSafe()
ValueVector
allocateNewSafe
in interface ValueVector
public <T extends ValueVector> AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor)
ContainerVectorLike
addOrGetVector
in interface ContainerVectorLike
descriptor
- vector descriptorpublic void setChildVector(ValueVector childVector)
public int size()
ContainerVectorLike
size
in interface ContainerVectorLike
size
in class AbstractContainerVector
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 void close()
AbstractContainerVector
close
in interface Closeable
close
in interface AutoCloseable
close
in interface ValueVector
close
in class AbstractContainerVector
public void clear()
ValueVector
clear
in interface ValueVector
public TransferPair getTransferPair(BufferAllocator allocator)
ValueVector
transfer pair
, creating a new target vector of
the same type.getTransferPair
in interface ValueVector
public TransferPair getTransferPair(String ref, BufferAllocator allocator)
getTransferPair
in interface ValueVector
public TransferPair makeTransferPair(ValueVector to)
ValueVector
transfer pair
that is used to transfer underlying
buffers into the target vector.makeTransferPair
in interface ValueVector
public int getValueCapacity()
ValueVector
getValueCapacity
in interface ValueVector
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 buf)
ValueVector
load
in interface ValueVector
metadata
- Metadata used to decode the incoming buffer.buf
- The buffer that contains the ValueVector.public UserBitShared.SerializedField getMetadata()
ValueVector
getMetadata
in interface ValueVector
public Iterator<ValueVector> iterator()
iterator
in interface Iterable<ValueVector>
public void setInitialCapacity(int numRecords)
ValueVector
setInitialCapacity
in interface ValueVector
@Deprecated public <T extends ValueVector> T addOrGet(String name, TypeProtos.MajorType type, Class<T> clazz)
addOrGetVector(org.apache.drill.exec.vector.VectorDescriptor)
instead.addOrGet
in class AbstractContainerVector
public <T extends ValueVector> T getChild(String name, Class<T> clazz)
getChild
in class AbstractContainerVector
public void allocateNew(int valueCount, int innerValueCount)
public void allocateOffsetsNew(int groupCount)
public VectorWithOrdinal getChildVectorWithOrdinal(String name)
getChildVectorWithOrdinal
in class AbstractContainerVector
public void copyFromSafe(int fromIndex, int thisIndex, RepeatedListVector from)
public void copyEntry(int toIndex, ValueVector from, int fromIndex)
copyEntry
in interface ValueVector
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
public void toNullable(ValueVector nullableVector)
ValueVector
toNullable
in interface ValueVector
nullableVector
- nullable vector of the same minor type as
this vectorCopyright © 1970 The Apache Software Foundation. All rights reserved.