public final class BitVector extends BaseDataValueVector implements FixedWidthVector
| Modifier and Type | Class and Description |
|---|---|
class |
BitVector.Accessor |
class |
BitVector.Mutator
MutableBit implements a vector of bit-width values.
|
BaseValueVector.BaseAccessor, BaseValueVector.BaseMutator| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_CAPACITY
Maximum number of values that this fixed-width vector can hold
and stay below the maximum vector size limit.
|
static int |
MAX_COUNT
Maximum number of values that this fixed-width vector can hold
and stay below the maximum vector size limit and/or stay below
the maximum item count.
|
static int |
NET_MAX_SIZE
Actual maximum vector size, in bytes, given the number of fixed-width
values that either fit in the maximum overall vector size, or that
is no larger than the maximum vector item count.
|
static int |
VALUE_WIDTH
Width of each fixed-width value.
|
data, emptyByteArrayallocator, 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 |
|---|
BitVector(MaterializedField field,
BufferAllocator allocator) |
| Modifier and Type | Method and Description |
|---|---|
void |
allocateNew()
Allocate new buffers.
|
void |
allocateNew(int valueCount)
Allocate a new memory space for this vector.
|
boolean |
allocateNewSafe()
Allocates new buffers.
|
void |
clear()
Release the underlying DrillBuf and reset the ValueVector to empty.
|
void |
copyEntry(int toIndex,
ValueVector from,
int fromIndex) |
void |
copyFrom(int inIndex,
int outIndex,
BitVector from) |
void |
copyFromSafe(int inIndex,
int outIndex,
BitVector from) |
void |
exchange(ValueVector other)
Exchange state with another value vector of the same type.
|
BitVector.Accessor |
getAccessor()
Returns an
accessor that is used to read from this vector
instance. |
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.
|
BitVector.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. |
static int |
getSizeFromCount(int valueCount) |
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.
|
int |
getValueWidth()
The width of a record in bytes.
|
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 |
reAlloc()
Allocate new buffer with double capacity, and copy data into the new buffer.
|
DrillBuf |
reallocRaw(int newAllocationSize)
Core of vector allocation.
|
void |
reset()
This method has a similar effect of allocateNew() without actually clearing and reallocating
the value vector.
|
void |
setInitialCapacity(int valueCount)
Set the initial record capacity
|
void |
splitAndTransferTo(int startIndex,
int length,
BitVector target) |
void |
toNullable(ValueVector nullableVector)
Convert a non-nullable vector to nullable by shuffling the data from
one to the other.
|
void |
transferTo(BitVector target) |
void |
zeroVector()
Zero out the underlying buffer backing this vector.
|
close, collectLedgers, getAllocatedSize, getBuffer, getBufferscheckBufRefs, fillBitsVector, getAllocator, getField, getField, getMetadata, getMetadataBuilder, iterator, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclose, collectLedgers, getAllocatedSize, getAllocator, getBuffers, getField, getMetadataforEach, iterator, spliteratorpublic static final int VALUE_WIDTH
public static final int MAX_CAPACITY
public static final int MAX_COUNT
public static final int NET_MAX_SIZE
public BitVector(MaterializedField field, BufferAllocator allocator)
public FieldReader getReader()
ValueVectorfield reader that supports reading values
from this vector.getReader in interface ValueVectorpublic int getBufferSize()
ValueVectorgetBufferSize in interface ValueVectorgetBufferSize in class BaseDataValueVectorpublic int getBufferSizeFor(int valueCount)
ValueVectorgetBufferSizeFor in interface ValueVectorvalueCount - the number of values to assume this vector containspublic static int getSizeFromCount(int valueCount)
public int getValueCapacity()
ValueVectorgetValueCapacity in interface ValueVectorpublic void setInitialCapacity(int valueCount)
ValueVectorsetInitialCapacity in interface ValueVectorpublic void allocateNew()
ValueVectorallocateNew in interface ValueVectorpublic boolean allocateNewSafe()
ValueVectorallocateNewSafe in interface ValueVectorpublic void reset()
BaseDataValueVectorreset in class BaseDataValueVectorpublic void allocateNew(int valueCount)
allocateNew in interface FixedWidthVectorvalueCount - The number of values which can be contained within this vector.public void reAlloc()
public DrillBuf reallocRaw(int newAllocationSize)
BaseDataValueVectorreallocRaw in class BaseDataValueVectornewAllocationSize - new buffer size as a power of twopublic void zeroVector()
zeroVector in interface FixedWidthVectorpublic int getValueWidth()
FixedWidthVectorgetValueWidth in interface FixedWidthVectorpublic void copyFrom(int inIndex,
int outIndex,
BitVector from)
public void copyFromSafe(int inIndex,
int outIndex,
BitVector from)
public void copyEntry(int toIndex,
ValueVector from,
int fromIndex)
copyEntry in interface ValueVectorpublic void load(UserBitShared.SerializedField metadata, DrillBuf buffer)
ValueVectorload in interface ValueVectormetadata - Metadata used to decode the incoming buffer.buffer - The buffer that contains the ValueVector.public BitVector.Mutator getMutator()
ValueVectormutator that is used to write to this vector
instance.getMutator in interface ValueVectorpublic BitVector.Accessor getAccessor()
ValueVectoraccessor that is used to read from this vector
instance.getAccessor in interface ValueVectorpublic TransferPair getTransferPair(BufferAllocator allocator)
ValueVectortransfer pair, creating a new target vector of
the same type.getTransferPair in interface ValueVectorgetTransferPair in class BaseValueVectorpublic TransferPair getTransferPair(String ref, BufferAllocator allocator)
getTransferPair in interface ValueVectorpublic TransferPair makeTransferPair(ValueVector to)
ValueVectortransfer pair that is used to transfer underlying
buffers into the target vector.makeTransferPair in interface ValueVectorpublic void transferTo(BitVector target)
public void splitAndTransferTo(int startIndex,
int length,
BitVector target)
public void exchange(ValueVector other)
ValueVectorexchange in interface ValueVectorexchange in class BaseDataValueVectorpublic void clear()
ValueVectorclear in interface ValueVectorclear in class BaseDataValueVectorpublic int getPayloadByteCount(int valueCount)
ValueVectorgetPayloadByteCount in interface ValueVectorpublic void toNullable(ValueVector nullableVector)
ValueVectortoNullable in interface ValueVectortoNullable in class BaseValueVectornullableVector - nullable vector of the same minor type as
this vectorCopyright © 2021 The Apache Software Foundation. All rights reserved.