java.lang.Object
org.apache.arrow.vector.BaseValueVector
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<ValueVector>,ValueVector
- Direct Known Subclasses:
BaseFixedWidthVector,BaseLargeRepeatedValueViewVector,BaseLargeVariableWidthVector,BaseRepeatedValueVector,BaseRepeatedValueViewVector,BaseVariableWidthVector,BaseVariableWidthViewVector,ExtensionTypeVector,FixedSizeListVector,LargeListVector,RunEndEncodedVector
Base class for other Arrow Vector Types. Provides basic functionality around memory management.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final BufferAllocatorprotected FieldReaderstatic final intstatic final longstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks to ensure that every buffervvuses has a positive reference count, throws if this precondition isn't met.voidclear()Release any owned ArrowBuf and reset the ValueVector to the initial state.voidclose()Alternative to clear().voidcopyFrom(int fromIndex, int thisIndex, ValueVector from) Copy a cell value from a particular index in source vector to a particular position in this vector.voidcopyFromSafe(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.Get the allocator associated with the vector.abstract StringgetName()Gets the name of the vector.Default implementation to create a reader for the vector.protected abstract FieldReaderEach vector has a different reader that implements the FieldReader interface.getTransferPair(BufferAllocator allocator) To transfer quota responsibility.protected static intgetValidityBufferSizeFromCount(int valueCount) iterator()protected ArrowBufreleaseBuffer(ArrowBuf buffer) toString()Representation of vector suitable for debugging.static ArrowBuftransferBuffer(ArrowBuf srcBuffer, BufferAllocator targetAllocator) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.apache.arrow.vector.ValueVector
accept, allocateNew, allocateNewSafe, getBuffers, getBufferSize, getBufferSizeFor, getDataBuffer, getField, getMinorType, getNullCount, getObject, getOffsetBuffer, getTransferPair, getTransferPair, getTransferPair, getTransferPair, getValidityBuffer, getValueCapacity, getValueCount, hashCode, hashCode, isNull, makeTransferPair, reAlloc, reset, setInitialCapacity, setValueCount, validate, validateFull
-
Field Details
-
MAX_ALLOCATION_SIZE_PROPERTY
- See Also:
-
MAX_ALLOCATION_SIZE
public static final long MAX_ALLOCATION_SIZE -
INITIAL_VALUE_ALLOCATION
public static final int INITIAL_VALUE_ALLOCATION- See Also:
-
allocator
-
fieldReader
-
-
Constructor Details
-
BaseValueVector
-
-
Method Details
-
getName
Description copied from interface:ValueVectorGets the name of the vector.- Specified by:
getNamein interfaceValueVector- Returns:
- the name of the vector.
-
toString
Representation of vector suitable for debugging. -
clear
public void clear()Description copied from interface:ValueVectorRelease any owned ArrowBuf and reset the ValueVector to the initial state. If the vector has any child vectors, they will also be cleared.- Specified by:
clearin interfaceValueVector
-
close
public void close()Description copied from interface:ValueVectorAlternative to clear(). Allows use as an AutoCloseable in try-with-resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceValueVector
-
getTransferPair
Description copied from interface:ValueVectorTo transfer quota responsibility.- Specified by:
getTransferPairin interfaceValueVector- Parameters:
allocator- the target allocator- Returns:
- a
transfer pair, creating a new target vector of the same type.
-
iterator
- Specified by:
iteratorin interfaceIterable<ValueVector>
-
checkBufRefs
Checks to ensure that every buffervvuses has a positive reference count, throws if this precondition isn't met. Returns true otherwise. -
getAllocator
Description copied from interface:ValueVectorGet the allocator associated with the vector. CAVEAT: Some ValueVector subclasses (e.g. NullVector) do not require an allocator for data storage and may return null.- Specified by:
getAllocatorin interfaceValueVector- Returns:
- Returns nullable allocator.
-
releaseBuffer
-
getValidityBufferSizeFromCount
protected static int getValidityBufferSizeFromCount(int valueCount) -
getReaderImpl
Each vector has a different reader that implements the FieldReader interface. Overridden methods must make sure to return the correct concrete reader implementation.- Returns:
- Returns a lambda that initializes a reader when called.
-
getReader
Default implementation to create a reader for the vector. Depends on the individual vector class' implementation ofgetReaderImpl()to initialize the reader appropriately.- Specified by:
getReaderin interfaceValueVector- Returns:
- Concrete instance of FieldReader by using double-checked locking.
-
transferBuffer
-
copyFrom
Description copied from interface:ValueVectorCopy a cell value from a particular index in source vector to a particular position in this vector.- Specified by:
copyFromin interfaceValueVector- Parameters:
fromIndex- position to copy from in source vectorthisIndex- position to copy to in this vectorfrom- source vector
-
copyFromSafe
Description copied from interface:ValueVectorSame 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:
copyFromSafein interfaceValueVector- Parameters:
fromIndex- position to copy from in source vectorthisIndex- position to copy to in this vectorfrom- source vector
-