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
Modifier and TypeFieldDescriptionprotected final BufferAllocator
protected FieldReader
static final int
static final long
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Checks to ensure that every buffervv
uses has a positive reference count, throws if this precondition isn't met.void
clear()
Release any owned ArrowBuf and reset the ValueVector to the initial state.void
close()
Alternative to clear().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.abstract String
getName()
Gets the name of the vector.Default implementation to create a reader for the vector.protected abstract FieldReader
Each vector has a different reader that implements the FieldReader interface.getTransferPair
(BufferAllocator allocator) To transfer quota responsibility.protected static int
getValidityBufferSizeFromCount
(int valueCount) iterator()
protected ArrowBuf
releaseBuffer
(ArrowBuf buffer) toString()
Representation of vector suitable for debugging.static ArrowBuf
transferBuffer
(ArrowBuf srcBuffer, BufferAllocator targetAllocator) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods 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:ValueVector
Gets the name of the vector.- Specified by:
getName
in interfaceValueVector
- Returns:
- the name of the vector.
-
toString
Representation of vector suitable for debugging. -
clear
public void clear()Description copied from interface:ValueVector
Release 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:
clear
in interfaceValueVector
-
close
public void close()Description copied from interface:ValueVector
Alternative to clear(). Allows use as an AutoCloseable in try-with-resources.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceValueVector
-
getTransferPair
Description copied from interface:ValueVector
To transfer quota responsibility.- Specified by:
getTransferPair
in interfaceValueVector
- Parameters:
allocator
- the target allocator- Returns:
- a
transfer pair
, creating a new target vector of the same type.
-
iterator
- Specified by:
iterator
in interfaceIterable<ValueVector>
-
checkBufRefs
Checks to ensure that every buffervv
uses has a positive reference count, throws if this precondition isn't met. Returns true otherwise. -
getAllocator
- Specified by:
getAllocator
in interfaceValueVector
-
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:
getReader
in interfaceValueVector
- Returns:
- Concrete instance of FieldReader by using double-checked locking.
-
transferBuffer
-
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
-