public final class UntypedNullVector extends BaseDataValueVector implements FixedWidthVector
TypeProtos.MinorType.NULL
All values in the vector represent two semantic implications: 1) the value is unknown, 2) the type is unknown.
Because of this, we only have to keep track of the number of values in value vector,
and there is no allocated buffer to back up this value vector. Therefore, the majority of
methods in this class is either no-op, or throws UnsupportedOperationException
.Modifier and Type | Class and Description |
---|---|
class |
UntypedNullVector.Accessor |
class |
UntypedNullVector.Mutator
UntypedNullVector.Mutator throws Exception for most of its mutate operations, except for the ones that set
value counts.
|
BaseValueVector.BaseAccessor, BaseValueVector.BaseMutator
Modifier and Type | Field and Description |
---|---|
static int |
VALUE_WIDTH
Width of each fixed-width value.
|
data, emptyByteArray
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 |
---|
UntypedNullVector(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 fromIndex,
int thisIndex,
UntypedNullVector from) |
void |
copyFromSafe(int fromIndex,
int thisIndex,
UntypedNullVector from) |
UntypedNullVector.Accessor |
getAccessor()
Returns an
accessor that is used to read from 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.
|
UntypedNullVector.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.
|
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. |
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,
UntypedNullVector target) |
void |
transferTo(UntypedNullVector target) |
void |
zeroVector()
Zero out the underlying buffer backing this vector.
|
close, collectLedgers, exchange, getAllocatedSize, getBuffer, getBuffers, getBufferSize
checkBufRefs, fillBitsVector, getAllocator, getField, getField, getMetadata, getMetadataBuilder, iterator, toNullable, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close, collectLedgers, exchange, getAllocatedSize, getAllocator, getBuffers, getBufferSize, getField, getMetadata, toNullable
forEach, iterator, spliterator
public static final int VALUE_WIDTH
public UntypedNullVector(MaterializedField field, BufferAllocator allocator)
public FieldReader getReader()
ValueVector
field reader
that supports reading values
from this vector.getReader
in interface ValueVector
public int getBufferSizeFor(int valueCount)
ValueVector
getBufferSizeFor
in interface ValueVector
valueCount
- the number of values to assume this vector containspublic int getValueCapacity()
ValueVector
getValueCapacity
in interface ValueVector
public UntypedNullVector.Accessor getAccessor()
ValueVector
accessor
that is used to read from this vector
instance.getAccessor
in interface ValueVector
public UntypedNullVector.Mutator getMutator()
ValueVector
mutator
that is used to write to this vector
instance.getMutator
in interface ValueVector
public void setInitialCapacity(int valueCount)
ValueVector
setInitialCapacity
in interface ValueVector
public void allocateNew()
ValueVector
allocateNew
in interface ValueVector
public boolean allocateNewSafe()
ValueVector
allocateNewSafe
in interface ValueVector
public void allocateNew(int valueCount)
FixedWidthVector
allocateNew
in interface FixedWidthVector
valueCount
- Number of values in the vector.public void reset()
BaseDataValueVector
reset
in class BaseDataValueVector
public void zeroVector()
zeroVector
in interface FixedWidthVector
public DrillBuf reallocRaw(int newAllocationSize)
BaseDataValueVector
reallocRaw
in class BaseDataValueVector
newAllocationSize
- new buffer size as a power of twopublic int getValueWidth()
FixedWidthVector
getValueWidth
in interface FixedWidthVector
public void load(UserBitShared.SerializedField metadata, DrillBuf buffer)
ValueVector
load
in interface ValueVector
metadata
- Metadata used to decode the incoming buffer.buffer
- The buffer that contains the ValueVector.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 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 void transferTo(UntypedNullVector target)
public void splitAndTransferTo(int startIndex, int length, UntypedNullVector target)
public int getPayloadByteCount(int valueCount)
ValueVector
getPayloadByteCount
in interface ValueVector
public void copyFrom(int fromIndex, int thisIndex, UntypedNullVector from)
public void copyFromSafe(int fromIndex, int thisIndex, UntypedNullVector from)
public void copyEntry(int toIndex, ValueVector from, int fromIndex)
copyEntry
in interface ValueVector
public void clear()
ValueVector
clear
in interface ValueVector
clear
in class BaseDataValueVector
Copyright © 1970 The Apache Software Foundation. All rights reserved.