public class ObjectVector extends BaseValueVector
| Modifier and Type | Class and Description |
|---|---|
class |
ObjectVector.Accessor |
class |
ObjectVector.Mutator |
BaseValueVector.BaseAccessor, BaseValueVector.BaseMutatorallocator, field, INITIAL_VALUE_ALLOCATION, MAX_ALLOCATION_SIZEBITS_VECTOR_NAME, MAX_BUFFER_SIZE, MAX_ROW_COUNT, MIN_ROW_COUNT, OFFSETS_VECTOR_NAME, VALUES_VECTOR_NAME| Constructor and Description |
|---|
ObjectVector(MaterializedField field,
BufferAllocator allocator) |
| Modifier and Type | Method and Description |
|---|---|
void |
addNewArray() |
void |
allocateNew()
Allocate new buffers.
|
void |
allocateNew(int valueCount) |
boolean |
allocateNewSafe()
Allocates new buffers.
|
void |
clear()
Release the underlying DrillBuf and reset the ValueVector to empty.
|
void |
close()
Alternative to clear().
|
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 |
exchange(ValueVector other)
Exchange state with another value vector of the same type.
|
ObjectVector.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.
|
MaterializedField |
getField()
Get information about how this field is materialized.
|
UserBitShared.SerializedField |
getMetadata()
Get the metadata for this field.
|
ObjectVector.Mutator |
getMutator()
Returns an
mutator that is used to write to this vector
instance. |
int |
getPayloadByteCount(int valueCount)
Return the number of value bytes consumed by actual data.
|
FieldReader |
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 buffer)
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 |
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.
|
checkBufRefs, fillBitsVector, getAllocator, getField, getMetadataBuilder, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic ObjectVector(MaterializedField field, BufferAllocator allocator)
public void addNewArray()
public FieldReader getReader()
ValueVectorfield reader that supports reading values
from this vector.public void setInitialCapacity(int numRecords)
ValueVectorpublic void allocateNew()
throws OutOfMemoryException
ValueVectorOutOfMemoryException - Thrown if no memory can be allocated.public void allocateNew(int valueCount)
throws OutOfMemoryException
OutOfMemoryExceptionpublic boolean allocateNewSafe()
ValueVectorpublic int getBufferSize()
ValueVectorpublic int getAllocatedSize()
ValueVectorpublic int getBufferSizeFor(int valueCount)
ValueVectorvalueCount - the number of values to assume this vector containspublic void close()
ValueVectorclose in interface Closeableclose in interface AutoCloseableclose in interface ValueVectorclose in class BaseValueVectorpublic void clear()
ValueVectorclear in interface ValueVectorclear in class BaseValueVectorpublic MaterializedField getField()
ValueVectorgetField in interface ValueVectorgetField in class BaseValueVectorpublic TransferPair getTransferPair(BufferAllocator allocator)
ValueVectortransfer pair, creating a new target vector of
the same type.getTransferPair in interface ValueVectorgetTransferPair in class BaseValueVectorpublic TransferPair makeTransferPair(ValueVector to)
ValueVectortransfer pair that is used to transfer underlying
buffers into the target vector.public TransferPair getTransferPair(String ref, BufferAllocator allocator)
public void copyEntry(int toIndex,
ValueVector from,
int fromIndex)
public int getValueCapacity()
ValueVectorpublic ObjectVector.Accessor getAccessor()
ValueVectoraccessor that is used to read from this vector
instance.public DrillBuf[] getBuffers(boolean clear)
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 void load(UserBitShared.SerializedField metadata, DrillBuf buffer)
ValueVectormetadata - Metadata used to decode the incoming buffer.buffer - The buffer that contains the ValueVector.public UserBitShared.SerializedField getMetadata()
ValueVectorgetMetadata in interface ValueVectorgetMetadata in class BaseValueVectorpublic ObjectVector.Mutator getMutator()
ValueVectormutator that is used to write to this vector
instance.public Iterator<ValueVector> iterator()
iterator in interface Iterable<ValueVector>iterator in class BaseValueVectorpublic void toNullable(ValueVector nullableVector)
ValueVectortoNullable in interface ValueVectortoNullable in class BaseValueVectornullableVector - nullable vector of the same minor type as
this vectorpublic void collectLedgers(Set<AllocationManager.BufferLedger> ledgers)
ValueVectorledgers - set of ledgers to which to add ledgers for this vectorpublic int getPayloadByteCount(int valueCount)
ValueVectorpublic void exchange(ValueVector other)
ValueVectorCopyright © 2021 The Apache Software Foundation. All rights reserved.