Package org.apache.arrow.vector
Class AllocationHelper
java.lang.Object
org.apache.arrow.vector.AllocationHelper
Helper utility methods for allocating storage for Vectors.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
allocate
(ValueVector v, int valueCount, int bytesPerValue) Allocates the vector.static void
allocate
(ValueVector v, int valueCount, int bytesPerValue, int repeatedPerTop) Allocates memory for a vector assuming given number of values and their width.static void
allocateNew
(ValueVector v, int valueCount) Allocates the exact amount if v is fixed width, otherwise falls back to dynamic allocation.static void
allocatePrecomputedChildCount
(ValueVector v, int valueCount, int bytesPerValue, int childValCount) Allocates memory for a vector assuming given number of values and their width.
-
Method Details
-
allocate
Allocates the vector.- Parameters:
v
- The vector to allocate.valueCount
- Number of values to allocate.bytesPerValue
- bytes per value.- Throws:
OutOfMemoryException
- if it can't allocate the memory.
-
allocatePrecomputedChildCount
public static void allocatePrecomputedChildCount(ValueVector v, int valueCount, int bytesPerValue, int childValCount) Allocates memory for a vector assuming given number of values and their width.- Parameters:
v
- The vector the allocate.valueCount
- The number of elements to allocate.bytesPerValue
- The bytes per value to use for allocating underlying storagechildValCount
- Ifv
is a repeated vector, this is number of child elements to allocate.- Throws:
OutOfMemoryException
- if it can't allocate the memory.
-
allocate
Allocates memory for a vector assuming given number of values and their width.- Parameters:
v
- The vector the allocate.valueCount
- The number of elements to allocate.bytesPerValue
- The bytes per value to use for allocating underlying storagerepeatedPerTop
- Ifv
is a repeated vector, this is assumed number of elements per child.- Throws:
OutOfMemoryException
- if it can't allocate the memory
-
allocateNew
Allocates the exact amount if v is fixed width, otherwise falls back to dynamic allocation.- Parameters:
v
- value vector we are trying to allocatevalueCount
- size we are trying to allocate- Throws:
OutOfMemoryException
- if it can't allocate the memory
-