Package org.apache.drill.exec.vector
Class AllocationHelper
java.lang.Object
org.apache.drill.exec.vector.AllocationHelper
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
allocate
(ValueVector vector, int valueCount, int bytesPerValue) static void
allocate
(ValueVector vector, int valueCount, int bytesPerValue, float repeatedPerTop) Allocate an array, but with a fractional value for the number of elements per array.static void
allocate
(ValueVector vector, int valueCount, int bytesPerValue, int repeatedPerTop) static void
allocateNew
(ValueVector vector, int valueCount) Allocates the exact amount if v is fixed width, otherwise falls back to dynamic allocationstatic void
allocatePrecomputedChildCount
(ValueVector vector, int valueCount, int bytesPerValue, int childValCount)
-
Field Details
-
STD_REPETITION_FACTOR
public static final int STD_REPETITION_FACTOR- See Also:
-
-
Constructor Details
-
AllocationHelper
public AllocationHelper()
-
-
Method Details
-
allocate
-
allocatePrecomputedChildCount
public static void allocatePrecomputedChildCount(ValueVector vector, int valueCount, int bytesPerValue, int childValCount) -
allocate
public static void allocate(ValueVector vector, int valueCount, int bytesPerValue, int repeatedPerTop) -
allocate
public static void allocate(ValueVector vector, int valueCount, int bytesPerValue, float repeatedPerTop) Allocate an array, but with a fractional value for the number of elements per array. This form is useful when the number comes from observations and represents an average.- Parameters:
vector
- the vector to allocatevalueCount
- the number of top-level valuesbytesPerValue
- the width of each valuerepeatedPerTop
- the number of array elements per value.
-
allocateNew
Allocates the exact amount if v is fixed width, otherwise falls back to dynamic allocation- Parameters:
vector
- value vector we are trying to allocatevalueCount
- size we are trying to allocate- Throws:
org.apache.drill.exec.memory.OutOfMemoryException
- if it can't allocate the memory
-