public class MapVector extends AbstractMapVector
Modifier and Type | Class and Description |
---|---|
class |
MapVector.Accessor |
protected static class |
MapVector.MapTransferPair |
class |
MapVector.Mutator |
Modifier and Type | Field and Description |
---|---|
static TypeProtos.MajorType |
TYPE |
allocator, callBack, field
BITS_VECTOR_NAME, MAX_BUFFER_SIZE, MAX_ROW_COUNT, MIN_ROW_COUNT, OFFSETS_VECTOR_NAME, VALUES_VECTOR_NAME
Constructor and Description |
---|
MapVector(MaterializedField field,
BufferAllocator allocator,
CallBack callBack) |
MapVector(String path,
BufferAllocator allocator,
CallBack callBack) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Release the underlying DrillBuf and reset the ValueVector to empty.
|
void |
close()
Clears out all underlying child vectors.
|
void |
copyEntry(int toIndex,
ValueVector from,
int fromIndex) |
void |
copyFromSafe(int fromIndex,
int thisIndex,
MapVector from) |
void |
copyFromSafe(int fromSubIndex,
int thisIndex,
RepeatedMapVector from) |
void |
exchange(ValueVector other)
Exchange state with another value vector of the same type.
|
Iterator<String> |
fieldNameIterator() |
MapVector.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.
|
UserBitShared.SerializedField |
getMetadata()
Get the metadata for this field.
|
MapVector.Mutator |
getMutator()
Returns an
mutator that is used to write to this vector
instance. |
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.
|
ValueVector |
getVectorById(int id) |
void |
load(UserBitShared.SerializedField metadata,
DrillBuf buf)
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 |
setMapValueCount(int valueCount)
Set the value count for the map without setting the counts for the contained
vectors.
|
protected boolean |
supportsDirectRead() |
void |
toNullable(ValueVector nullableVector)
Convert a non-nullable vector to nullable by shuffling the data from
one to the other.
|
addOrGet, allocateNewSafe, collectLedgers, getChild, getChildByOrdinal, getChildren, getChildVectorWithOrdinal, getPayloadByteCount, getPrimitiveVectors, iterator, putChild, putVector, size
allocateNew, getAllocator, getChild, getChildFieldNames, getField, typeify
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static final TypeProtos.MajorType TYPE
public MapVector(String path, BufferAllocator allocator, CallBack callBack)
public MapVector(MaterializedField field, BufferAllocator allocator, CallBack callBack)
public FieldReader getReader()
ValueVector
field reader
that supports reading values
from this vector.public void copyFromSafe(int fromIndex, int thisIndex, MapVector from)
public void copyFromSafe(int fromSubIndex, int thisIndex, RepeatedMapVector from)
public void copyEntry(int toIndex, ValueVector from, int fromIndex)
protected boolean supportsDirectRead()
supportsDirectRead
in class AbstractContainerVector
public void setInitialCapacity(int numRecords)
ValueVector
public int getBufferSize()
ValueVector
getBufferSize
in interface ValueVector
getBufferSize
in class AbstractMapVector
public int getAllocatedSize()
ValueVector
getAllocatedSize
in interface ValueVector
getAllocatedSize
in class AbstractMapVector
public int getBufferSizeFor(int valueCount)
ValueVector
valueCount
- the number of values to assume this vector containspublic DrillBuf[] getBuffers(boolean clear)
ValueVector
getBuffers
in interface ValueVector
getBuffers
in class AbstractMapVector
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 TransferPair getTransferPair(BufferAllocator allocator)
ValueVector
transfer pair
, creating a new target vector of
the same type.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 int getValueCapacity()
ValueVector
public MapVector.Accessor getAccessor()
ValueVector
accessor
that is used to read from this vector
instance.public void load(UserBitShared.SerializedField metadata, DrillBuf buf)
ValueVector
metadata
- Metadata used to decode the incoming buffer.buf
- The buffer that contains the ValueVector.public UserBitShared.SerializedField getMetadata()
ValueVector
public MapVector.Mutator getMutator()
ValueVector
mutator
that is used to write to this vector
instance.public ValueVector getVectorById(int id)
public void setMapValueCount(int valueCount)
valueCount
- number of items in the mappublic void clear()
ValueVector
public void close()
AbstractContainerVector
close
in interface Closeable
close
in interface AutoCloseable
close
in interface ValueVector
close
in class AbstractMapVector
public void toNullable(ValueVector nullableVector)
ValueVector
nullableVector
- nullable vector of the same minor type as
this vectorpublic void exchange(ValueVector other)
ValueVector
exchange
in interface ValueVector
exchange
in class AbstractMapVector
Copyright © 1970 The Apache Software Foundation. All rights reserved.