Class BaseRepeatedValueVector
java.lang.Object
org.apache.drill.exec.vector.BaseValueVector
org.apache.drill.exec.vector.complex.BaseRepeatedValueVector
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<ValueVector>,ContainerVectorLike,RepeatedValueVector,ValueVector
- Direct Known Subclasses:
ListVector,RepeatedBigIntVector,RepeatedBitVector,RepeatedDateVector,RepeatedDecimal18Vector,RepeatedDecimal28DenseVector,RepeatedDecimal28SparseVector,RepeatedDecimal38DenseVector,RepeatedDecimal38SparseVector,RepeatedDecimal9Vector,RepeatedDictVector,RepeatedFloat4Vector,RepeatedFloat8Vector,RepeatedIntervalDayVector,RepeatedIntervalVector,RepeatedIntervalYearVector,RepeatedIntVector,RepeatedListVector.DelegateRepeatedVector,RepeatedSmallIntVector,RepeatedTimeStampVector,RepeatedTimeVector,RepeatedTinyIntVector,RepeatedUInt1Vector,RepeatedUInt2Vector,RepeatedUInt4Vector,RepeatedUInt8Vector,RepeatedVar16CharVector,RepeatedVarBinaryVector,RepeatedVarCharVector,RepeatedVarDecimalVector
public abstract class BaseRepeatedValueVector
extends BaseValueVector
implements RepeatedValueVector
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassprotected classNested classes/interfaces inherited from class org.apache.drill.exec.vector.BaseValueVector
BaseValueVector.BaseAccessor, BaseValueVector.BaseMutatorNested classes/interfaces inherited from interface org.apache.drill.exec.vector.complex.RepeatedValueVector
RepeatedValueVector.RepeatedAccessor, RepeatedValueVector.RepeatedMutatorNested classes/interfaces inherited from interface org.apache.drill.exec.vector.ValueVector
ValueVector.Accessor, ValueVector.Mutator -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final ValueVectorprotected final UInt4Vectorstatic final MaterializedFieldstatic final Stringprotected ValueVectorFields inherited from class org.apache.drill.exec.vector.BaseValueVector
allocator, field, INITIAL_VALUE_ALLOCATION, MAX_ALLOCATION_SIZEFields inherited from interface org.apache.drill.exec.vector.complex.RepeatedValueVector
DEFAULT_REPEAT_PER_RECORDFields inherited from interface org.apache.drill.exec.vector.ValueVector
BITS_VECTOR_NAME, MAX_BUFFER_SIZE, MAX_ROW_COUNT, MIN_ROW_COUNT, VALUES_VECTOR_NAME -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseRepeatedValueVector(MaterializedField field, BufferAllocator allocator) protectedBaseRepeatedValueVector(MaterializedField field, BufferAllocator allocator, ValueVector vector) -
Method Summary
Modifier and TypeMethodDescription<T extends ValueVector>
AddOrGetResult<T> addOrGetVector(VectorDescriptor descriptor) Creates and adds a child vector if none with the same name exists, else returns the vector instance.booleanAllocates new buffers.voidclear()Release the underlying DrillBuf and reset the ValueVector to empty.voidcollectLedgers(Set<AllocationManager.BufferLedger> ledgers) Add the ledgers underlying the buffers underlying the components of the vector to the set provided.voidexchange(ValueVector other) Exchange state with another value vector of the same type.intReturns the total size of buffers allocated by this vector.DrillBuf[]getBuffers(boolean clear) Return the underlying buffers associated with this vector.intReturns the number of bytes that is used by this vector instance.intgetBufferSizeFor(int valueCount) Returns the number of bytes that is used by this vector if it holds the given number of values.protected UserBitShared.SerializedField.BuilderintgetPayloadByteCount(int valueCount) Return the number of value bytes consumed by actual data.intReturns the maximum number of values that can be stored in this vector instance.iterator()voidload(UserBitShared.SerializedField metadata, DrillBuf buffer) Load the data provided in the buffer.protected voidvoidsetChildVector(ValueVector childVector) voidsetInitialCapacity(int numRecords) Set the initial record capacityintsize()Returns 1 if inner vector is explicitly set via #addOrGetVector else 0Methods inherited from class org.apache.drill.exec.vector.BaseValueVector
checkBufRefs, close, fillBitsVector, getAllocator, getField, getField, getMetadata, getTransferPair, toNullable, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.apache.drill.exec.vector.complex.RepeatedValueVector
getAccessor, getMutatorMethods inherited from interface org.apache.drill.exec.vector.ValueVector
allocateNew, close, copyEntry, getAllocator, getField, getMetadata, getReader, getTransferPair, getTransferPair, makeTransferPair, toNullable
-
Field Details
-
DEFAULT_DATA_VECTOR
-
OFFSETS_VECTOR_NAME
- See Also:
-
DATA_VECTOR_NAME
- See Also:
-
OFFSETS_FIELD
-
offsets
-
vector
-
-
Constructor Details
-
BaseRepeatedValueVector
-
BaseRepeatedValueVector
protected BaseRepeatedValueVector(MaterializedField field, BufferAllocator allocator, ValueVector vector)
-
-
Method Details
-
allocateNewSafe
public boolean allocateNewSafe()Description copied from interface:ValueVectorAllocates new buffers. ValueVector implements logic to determine how much to allocate.- Specified by:
allocateNewSafein interfaceValueVector- Returns:
- Returns true if allocation was successful.
-
getOffsetVector
- Specified by:
getOffsetVectorin interfaceRepeatedValueVector- Returns:
- the underlying offset vector or null if none exists.
-
getDataVector
- Specified by:
getDataVectorin interfaceRepeatedValueVector- Returns:
- the underlying data vector or null if none exists.
-
setInitialCapacity
public void setInitialCapacity(int numRecords) Description copied from interface:ValueVectorSet the initial record capacity- Specified by:
setInitialCapacityin interfaceValueVector- Parameters:
numRecords-
-
getValueCapacity
public int getValueCapacity()Description copied from interface:ValueVectorReturns the maximum number of values that can be stored in this vector instance.- Specified by:
getValueCapacityin interfaceValueVector
-
getMetadataBuilder
- Overrides:
getMetadataBuilderin classBaseValueVector
-
getBufferSize
public int getBufferSize()Description copied from interface:ValueVectorReturns the number of bytes that is used by this vector instance. This is a bit of a misnomer. Returns the number of bytes used by data in this instance.- Specified by:
getBufferSizein interfaceValueVector
-
getAllocatedSize
public int getAllocatedSize()Description copied from interface:ValueVectorReturns the total size of buffers allocated by this vector. Has meaning only when vectors are directly allocated and each vector has its own buffer. Does not have meaning for vectors deserialized from the network or disk in which multiple vectors share the same vector.- Specified by:
getAllocatedSizein interfaceValueVector- Returns:
- allocated buffer size, in bytes
-
getBufferSizeFor
public int getBufferSizeFor(int valueCount) Description copied from interface:ValueVectorReturns the number of bytes that is used by this vector if it holds the given number of values. The result will be the same as if Mutator.setValueCount() were called, followed by calling getBufferSize(), but without any of the closing side-effects that setValueCount() implies wrt finishing off the population of a vector. Some operations might wish to use this to determine how much memory has been used by a vector so far, even though it is not finished being populated.- Specified by:
getBufferSizeForin interfaceValueVector- Parameters:
valueCount- the number of values to assume this vector contains- Returns:
- the buffer size if this vector is holding valueCount values
-
iterator
- Specified by:
iteratorin interfaceIterable<ValueVector>- Overrides:
iteratorin classBaseValueVector
-
clear
public void clear()Description copied from interface:ValueVectorRelease the underlying DrillBuf and reset the ValueVector to empty.- Specified by:
clearin interfaceValueVector- Overrides:
clearin classBaseValueVector
-
getBuffers
Description copied from interface:ValueVectorReturn the underlying buffers associated with this vector. Note that this doesn't impact the reference counts for this buffer so it only should be used for in-context access. Also note that this buffer changes regularly thus external classes shouldn't hold a reference to it (unless they change it).- Specified by:
getBuffersin interfaceValueVector- Parameters:
clear- Whether to clear vector before returning; the buffers will still be refcounted; but the returned array will be the only reference to them- Returns:
- The underlying
buffersthat is used by this vector instance.
-
size
public int size()Returns 1 if inner vector is explicitly set via #addOrGetVector else 0- Specified by:
sizein interfaceContainerVectorLike- See Also:
-
addOrGetVector
Description copied from interface:ContainerVectorLikeCreates and adds a child vector if none with the same name exists, else returns the vector instance.- Specified by:
addOrGetVectorin interfaceContainerVectorLike- Parameters:
descriptor- vector descriptor- Returns:
- result of operation wrapping vector corresponding to the given descriptor and whether it's newly created
-
replaceDataVector
-
setChildVector
-
collectLedgers
Description copied from interface:ValueVectorAdd the ledgers underlying the buffers underlying the components of the vector to the set provided. Used to determine actual memory allocation.- Specified by:
collectLedgersin interfaceValueVector- Parameters:
ledgers- set of ledgers to which to add ledgers for this vector
-
getPayloadByteCount
public int getPayloadByteCount(int valueCount) Description copied from interface:ValueVectorReturn the number of value bytes consumed by actual data.- Specified by:
getPayloadByteCountin interfaceValueVector
-
exchange
Description copied from interface:ValueVectorExchange state with another value vector of the same type. Used to implement look-ahead writers.- Specified by:
exchangein interfaceValueVector
-