Package org.apache.arrow.vector.complex
Class AbstractContainerVector
java.lang.Object
org.apache.arrow.vector.complex.AbstractContainerVector
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Iterable<ValueVector>
,DensityAwareVector
,ValueVector
- Direct Known Subclasses:
AbstractStructVector
,DenseUnionVector
,UnionVector
public abstract class AbstractContainerVector
extends Object
implements ValueVector, DensityAwareVector
Base class for composite vectors.
This class implements common functionality of composite vectors.
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractContainerVector
(String name, BufferAllocator allocator, CallBack callBack) -
Method Summary
Modifier and TypeMethodDescriptionabstract <T extends FieldVector>
TaddOrGetFixedSizeList
(String name, int listSize) addOrGetList
(String name) addOrGetMap
(String name, boolean keysSorted) addOrGetStruct
(String name) addOrGetUnion
(String name) void
Allocate new buffers.void
close()
Clears out all underlying child vectors.void
copyFrom
(int fromIndex, int thisIndex, ValueVector from) Copy a cell value from a particular index in source vector to a particular position in this vector.void
copyFromSafe
(int fromIndex, int thisIndex, ValueVector from) Same asValueVector.copyFrom(int, int, ValueVector)
except that it handles the case when the capacity of the vector needs to be expanded before copy.Returns aValueVector
corresponding to the given field name if exists or null.abstract <T extends FieldVector>
Tabstract VectorWithOrdinal
getName()
Gets the name of the vector.abstract int
size()
protected boolean
toString()
Representation of vector suitable for debugging.protected <T extends ValueVector>
Ttypeify
(ValueVector v, Class<T> clazz) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.arrow.vector.DensityAwareVector
setInitialCapacity
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface org.apache.arrow.vector.ValueVector
accept, allocateNewSafe, clear, getBuffers, getBufferSize, getBufferSizeFor, getDataBuffer, getField, getMinorType, getNullCount, getObject, getOffsetBuffer, getReader, getTransferPair, getTransferPair, getTransferPair, getTransferPair, getTransferPair, getValidityBuffer, getValueCapacity, getValueCount, hashCode, hashCode, isNull, makeTransferPair, reAlloc, reset, setInitialCapacity, setValueCount, validate, validateFull
-
Field Details
-
name
-
allocator
-
callBack
-
-
Constructor Details
-
AbstractContainerVector
-
-
Method Details
-
toString
Representation of vector suitable for debugging. -
allocateNew
Description copied from interface:ValueVector
Allocate new buffers. ValueVector implements logic to determine how much to allocate.- Specified by:
allocateNew
in interfaceValueVector
- Throws:
OutOfMemoryException
- Thrown if no memory can be allocated.
-
getAllocator
- Specified by:
getAllocator
in interfaceValueVector
-
getChild
Returns aValueVector
corresponding to the given field name if exists or null.- Parameters:
name
- the name of the child to return- Returns:
- the corresponding FieldVector
-
close
public void close()Clears out all underlying child vectors.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceValueVector
-
typeify
-
supportsDirectRead
protected boolean supportsDirectRead() -
size
public abstract int size() -
addOrGet
public abstract <T extends FieldVector> T addOrGet(String name, FieldType fieldType, Class<T> clazz) -
getChild
-
getChildVectorWithOrdinal
-
addOrGetStruct
-
addOrGetList
-
addOrGetUnion
-
addOrGetFixedSizeList
-
addOrGetMap
-
copyFrom
Description copied from interface:ValueVector
Copy a cell value from a particular index in source vector to a particular position in this vector.- Specified by:
copyFrom
in interfaceValueVector
- Parameters:
fromIndex
- position to copy from in source vectorthisIndex
- position to copy to in this vectorfrom
- source vector
-
copyFromSafe
Description copied from interface:ValueVector
Same asValueVector.copyFrom(int, int, ValueVector)
except that it handles the case when the capacity of the vector needs to be expanded before copy.- Specified by:
copyFromSafe
in interfaceValueVector
- Parameters:
fromIndex
- position to copy from in source vectorthisIndex
- position to copy to in this vectorfrom
- source vector
-
getName
Description copied from interface:ValueVector
Gets the name of the vector.- Specified by:
getName
in interfaceValueVector
- Returns:
- the name of the vector.
-