public abstract class AbstractMapVector extends AbstractContainerVector
ValueVector.Accessor, ValueVector.Mutator
allocator, callBack, field
BITS_VECTOR_NAME, MAX_BUFFER_SIZE, MAX_ROW_COUNT, MIN_ROW_COUNT, OFFSETS_VECTOR_NAME, VALUES_VECTOR_NAME
Modifier | Constructor and Description |
---|---|
protected |
AbstractMapVector(MaterializedField field,
BufferAllocator allocator,
CallBack callBack) |
Modifier and Type | Method and Description |
---|---|
<T extends ValueVector> |
addOrGet(String name,
TypeProtos.MajorType type,
Class<T> clazz)
Adds a new field with the given parameters or replaces the existing one and consequently returns the resultant
ValueVector . |
boolean |
allocateNewSafe()
Allocates new buffers.
|
void |
close()
Clears out all underlying child vectors.
|
void |
collectLedgers(Set<AllocationManager.BufferLedger> ledgers)
Add the ledgers underlying the buffers underlying the components of the
vector to the set provided.
|
void |
exchange(ValueVector other)
Exchange state with another value vector of the same type.
|
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.
|
<T extends ValueVector> |
getChild(String name,
Class<T> clazz)
Returns a
ValueVector instance of subtype of |
ValueVector |
getChildByOrdinal(int id)
Returns a
ValueVector corresponding to the given ordinal identifier. |
protected Collection<ValueVector> |
getChildren()
Returns a sequence of underlying child vectors.
|
VectorWithOrdinal |
getChildVectorWithOrdinal(String name)
Returns a vector with its corresponding ordinal mapping if field exists or null.
|
int |
getPayloadByteCount(int valueCount)
Return the number of value bytes consumed by actual data.
|
List<ValueVector> |
getPrimitiveVectors()
Returns a list of scalar child vectors recursing the entire vector hierarchy.
|
Iterator<ValueVector> |
iterator() |
void |
putChild(String name,
ValueVector vector)
Inserts the vector with the given name if it does not exist else replaces it with the new value.
|
protected void |
putVector(String name,
ValueVector vector)
Inserts the input vector into the map if it does not exist, replaces if it exists already
|
int |
size()
Returns the number of underlying child vectors.
|
allocateNew, getAllocator, getChild, getChildFieldNames, getField, supportsDirectRead, typeify
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, copyEntry, getAccessor, getBufferSizeFor, getMetadata, getMutator, getReader, getTransferPair, getTransferPair, getValueCapacity, load, makeTransferPair, setInitialCapacity, toNullable
forEach, spliterator
protected AbstractMapVector(MaterializedField field, BufferAllocator allocator, CallBack callBack)
public void close()
AbstractContainerVector
close
in interface Closeable
close
in interface AutoCloseable
close
in interface ValueVector
close
in class AbstractContainerVector
public boolean allocateNewSafe()
ValueVector
public <T extends ValueVector> T addOrGet(String name, TypeProtos.MajorType type, Class<T> clazz)
ValueVector
.
Execution takes place in the following order:
IllegalStateException
addOrGet
in class AbstractContainerVector
T
- class type of expected vector typename
- name of the fieldtype
- type of the fieldclazz
- class of expected vector typeValueVector
IllegalStateException
- raised if there is a hard schema changepublic ValueVector getChildByOrdinal(int id)
ValueVector
corresponding to the given ordinal identifier.public <T extends ValueVector> T getChild(String name, Class<T> clazz)
ValueVector
instance of subtype of getChild
in class AbstractContainerVector
public void putChild(String name, ValueVector vector)
protected void putVector(String name, ValueVector vector)
name
- field namevector
- vector to be insertedprotected Collection<ValueVector> getChildren()
public int size()
size
in class AbstractContainerVector
public Iterator<ValueVector> iterator()
public List<ValueVector> getPrimitiveVectors()
public VectorWithOrdinal getChildVectorWithOrdinal(String name)
getChildVectorWithOrdinal
in class AbstractContainerVector
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 int getBufferSize()
ValueVector
public int getAllocatedSize()
ValueVector
public 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.