Package org.apache.drill.exec.vector
Class AllocationHelper
java.lang.Object
org.apache.drill.exec.vector.AllocationHelper
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidallocate(ValueVector vector, int valueCount, int bytesPerValue) static voidallocate(ValueVector vector, int valueCount, int bytesPerValue, float repeatedPerTop) Allocate an array, but with a fractional value for the number of elements per array.static voidallocate(ValueVector vector, int valueCount, int bytesPerValue, int repeatedPerTop) static voidallocateNew(ValueVector vector, int valueCount) Allocates the exact amount if v is fixed width, otherwise falls back to dynamic allocationstatic voidallocatePrecomputedChildCount(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
-