Class AllocationHelper

java.lang.Object
org.apache.drill.exec.vector.AllocationHelper

public class AllocationHelper extends Object
  • Field Details

  • Constructor Details

    • AllocationHelper

      public AllocationHelper()
  • Method Details

    • allocate

      public static void allocate(ValueVector vector, int valueCount, int bytesPerValue)
    • 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 allocate
      valueCount - the number of top-level values
      bytesPerValue - the width of each value
      repeatedPerTop - the number of array elements per value.
    • allocateNew

      public static void allocateNew(ValueVector vector, int valueCount)
      Allocates the exact amount if v is fixed width, otherwise falls back to dynamic allocation
      Parameters:
      vector - value vector we are trying to allocate
      valueCount - size we are trying to allocate
      Throws:
      org.apache.drill.exec.memory.OutOfMemoryException - if it can't allocate the memory