public class ObjectVector extends BaseValueVector
Modifier and Type | Class and Description |
---|---|
class |
ObjectVector.Accessor |
class |
ObjectVector.Mutator |
BaseValueVector.BaseAccessor, BaseValueVector.BaseMutator
allocator, field, INITIAL_VALUE_ALLOCATION, MAX_ALLOCATION_SIZE
BITS_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, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public ObjectVector(MaterializedField field, BufferAllocator allocator)
public void addNewArray()
public FieldReader getReader()
ValueVector
field reader
that supports reading values
from this vector.public void setInitialCapacity(int numRecords)
ValueVector
public void allocateNew() throws OutOfMemoryException
ValueVector
OutOfMemoryException
- Thrown if no memory can be allocated.public void allocateNew(int valueCount) throws OutOfMemoryException
OutOfMemoryException
public boolean allocateNewSafe()
ValueVector
public int getBufferSize()
ValueVector
public int getAllocatedSize()
ValueVector
public int getBufferSizeFor(int valueCount)
ValueVector
valueCount
- the number of values to assume this vector containspublic void close()
ValueVector
close
in interface Closeable
close
in interface AutoCloseable
close
in interface ValueVector
close
in class BaseValueVector
public void clear()
ValueVector
clear
in interface ValueVector
clear
in class BaseValueVector
public MaterializedField getField()
ValueVector
getField
in interface ValueVector
getField
in class BaseValueVector
public TransferPair getTransferPair(BufferAllocator allocator)
ValueVector
transfer pair
, creating a new target vector of
the same type.getTransferPair
in interface ValueVector
getTransferPair
in class BaseValueVector
public TransferPair makeTransferPair(ValueVector to)
ValueVector
transfer 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()
ValueVector
public ObjectVector.Accessor getAccessor()
ValueVector
accessor
that is used to read from this vector
instance.public DrillBuf[] getBuffers(boolean clear)
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
metadata
- Metadata used to decode the incoming buffer.buffer
- The buffer that contains the ValueVector.public UserBitShared.SerializedField getMetadata()
ValueVector
getMetadata
in interface ValueVector
getMetadata
in class BaseValueVector
public ObjectVector.Mutator getMutator()
ValueVector
mutator
that is used to write to this vector
instance.public Iterator<ValueVector> iterator()
iterator
in interface Iterable<ValueVector>
iterator
in class BaseValueVector
public void toNullable(ValueVector nullableVector)
ValueVector
toNullable
in interface ValueVector
toNullable
in class BaseValueVector
nullableVector
- nullable vector of the same minor type as
this vectorpublic void collectLedgers(Set<AllocationManager.BufferLedger> ledgers)
ValueVector
ledgers
- set of ledgers to which to add ledgers for this vectorpublic int getPayloadByteCount(int valueCount)
ValueVector
public void exchange(ValueVector other)
ValueVector
Copyright © 1970 The Apache Software Foundation. All rights reserved.