public class ZeroVector extends Object implements ValueVector
ValueVector.Accessor, ValueVector.Mutator
Modifier and Type | Field and Description |
---|---|
static ZeroVector |
INSTANCE |
BITS_VECTOR_NAME, MAX_BUFFER_SIZE, MAX_ROW_COUNT, MIN_ROW_COUNT, OFFSETS_VECTOR_NAME, VALUES_VECTOR_NAME
Constructor and Description |
---|
ZeroVector() |
Modifier and Type | Method and Description |
---|---|
void |
allocateNew()
Allocate new buffers.
|
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.
|
ValueVector.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.
|
BufferAllocator |
getAllocator() |
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.
|
ValueVector.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 target)
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static final ZeroVector INSTANCE
public void close()
ValueVector
close
in interface Closeable
close
in interface AutoCloseable
close
in interface ValueVector
public void clear()
ValueVector
clear
in interface ValueVector
public MaterializedField getField()
ValueVector
getField
in interface ValueVector
public TransferPair getTransferPair(BufferAllocator allocator)
ValueVector
transfer pair
, creating a new target vector of
the same type.getTransferPair
in interface ValueVector
public UserBitShared.SerializedField getMetadata()
ValueVector
getMetadata
in interface ValueVector
public Iterator<ValueVector> iterator()
iterator
in interface Iterable<ValueVector>
public int getBufferSize()
ValueVector
getBufferSize
in interface ValueVector
public int getAllocatedSize()
ValueVector
getAllocatedSize
in interface ValueVector
public int getBufferSizeFor(int valueCount)
ValueVector
getBufferSizeFor
in interface ValueVector
valueCount
- the number of values to assume this vector containspublic DrillBuf[] getBuffers(boolean clear)
ValueVector
getBuffers
in interface 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 allocateNew() throws OutOfMemoryException
ValueVector
allocateNew
in interface ValueVector
OutOfMemoryException
- Thrown if no memory can be allocated.public boolean allocateNewSafe()
ValueVector
allocateNewSafe
in interface ValueVector
public BufferAllocator getAllocator()
getAllocator
in interface ValueVector
public void setInitialCapacity(int numRecords)
ValueVector
setInitialCapacity
in interface ValueVector
public int getValueCapacity()
ValueVector
getValueCapacity
in interface ValueVector
public TransferPair getTransferPair(String ref, BufferAllocator allocator)
getTransferPair
in interface ValueVector
public TransferPair makeTransferPair(ValueVector target)
ValueVector
transfer pair
that is used to transfer underlying
buffers into the target vector.makeTransferPair
in interface ValueVector
public ValueVector.Accessor getAccessor()
ValueVector
accessor
that is used to read from this vector
instance.getAccessor
in interface ValueVector
public ValueVector.Mutator getMutator()
ValueVector
mutator
that is used to write to this vector
instance.getMutator
in interface ValueVector
public FieldReader getReader()
ValueVector
field reader
that supports reading values
from this vector.getReader
in interface ValueVector
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 void copyEntry(int toIndex, ValueVector from, int fromIndex)
copyEntry
in interface ValueVector
public void exchange(ValueVector other)
ValueVector
exchange
in interface ValueVector
public void collectLedgers(Set<AllocationManager.BufferLedger> ledgers)
ValueVector
collectLedgers
in interface ValueVector
ledgers
- set of ledgers to which to add ledgers for this vectorpublic int getPayloadByteCount(int valueCount)
ValueVector
getPayloadByteCount
in interface ValueVector
public void toNullable(ValueVector nullableVector)
ValueVector
toNullable
in interface ValueVector
nullableVector
- nullable vector of the same minor type as
this vectorCopyright © 1970 The Apache Software Foundation. All rights reserved.