Class Decimal9Vector

All Implemented Interfaces:
Closeable, AutoCloseable, Iterable<ValueVector>, FixedWidthVector, ValueVector

public final class Decimal9Vector extends BaseDataValueVector implements FixedWidthVector
Decimal9 implements a vector of fixed width values. Elements in the vector are accessed by position, starting from the logical start of the vector. Values should be pushed onto the vector sequentially, but may be accessed randomly.
  • The width of each element is VALUE_WIDTH (= 4) bytes.
  • The equivalent Java primitive is 'int'.
NB: this class is automatically generated from FixedValueVectors.java and ValueVectorTypes.tdd using FreeMarker.
  • Field Details Link icon

    • VALUE_WIDTH Link icon

      public static final int VALUE_WIDTH
      Width of each fixed-width value.
      See Also:
    • MAX_VALUE_COUNT Link icon

      public static final int MAX_VALUE_COUNT
      Maximum number of values that this fixed-width vector can hold and stay below the maximum vector size limit. This is the limit enforced when the vector is used to hold values in a repeated vector.
    • MAX_SCALAR_COUNT Link icon

      public static final int MAX_SCALAR_COUNT
      Maximum number of values that this fixed-width vector can hold and stay below the maximum vector size limit and/or stay below the maximum row count. This is the limit enforced when the vector is used to hold scalar (required or nullable) values.

      Note: MAX_ROW_COUNT is defined in the parent ValueVector class as the maximum number of rows in a record batch (64K). Use this in place of the Character.MAX_SIZE value previously used.

    • NET_MAX_SCALAR_SIZE Link icon

      public static final int NET_MAX_SCALAR_SIZE
      Actual maximum vector size, in bytes, given the number of fixed-width values that either fit in the maximum overall vector size, or that is no larger than the maximum vector item count.
  • Constructor Details Link icon

  • Method Details Link icon

    • getReader Link icon

      public FieldReader getReader()
      Description copied from interface: ValueVector
      Returns a field reader that supports reading values from this vector.
      Specified by:
      getReader in interface ValueVector
    • getBufferSizeFor Link icon

      public int getBufferSizeFor(int valueCount)
      Description copied from interface: ValueVector
      Returns the number of bytes that is used by this vector if it holds the given number of values. The result will be the same as if Mutator.setValueCount() were called, followed by calling getBufferSize(), but without any of the closing side-effects that setValueCount() implies wrt finishing off the population of a vector. Some operations might wish to use this to determine how much memory has been used by a vector so far, even though it is not finished being populated.
      Specified by:
      getBufferSizeFor in interface ValueVector
      Parameters:
      valueCount - the number of values to assume this vector contains
      Returns:
      the buffer size if this vector is holding valueCount values
    • getValueCapacity Link icon

      public int getValueCapacity()
      Description copied from interface: ValueVector
      Returns the maximum number of values that can be stored in this vector instance.
      Specified by:
      getValueCapacity in interface ValueVector
    • getAccessor Link icon

      public Decimal9Vector.Accessor getAccessor()
      Description copied from interface: ValueVector
      Returns an accessor that is used to read from this vector instance.
      Specified by:
      getAccessor in interface ValueVector
    • getMutator Link icon

      public Decimal9Vector.Mutator getMutator()
      Description copied from interface: ValueVector
      Returns an mutator that is used to write to this vector instance.
      Specified by:
      getMutator in interface ValueVector
    • setInitialCapacity Link icon

      public void setInitialCapacity(int valueCount)
      Description copied from interface: ValueVector
      Set the initial record capacity
      Specified by:
      setInitialCapacity in interface ValueVector
      Parameters:
      valueCount -
    • allocateNew Link icon

      public void allocateNew()
      Description copied from interface: ValueVector
      Allocate new buffers. ValueVector implements logic to determine how much to allocate.
      Specified by:
      allocateNew in interface ValueVector
    • allocateNewSafe Link icon

      public boolean allocateNewSafe()
      Description copied from interface: ValueVector
      Allocates new buffers. ValueVector implements logic to determine how much to allocate.
      Specified by:
      allocateNewSafe in interface ValueVector
      Returns:
      Returns true if allocation was successful.
    • allocateNew Link icon

      public void allocateNew(int valueCount)
      Allocate a new buffer that supports setting at least the provided number of values. May actually be sized bigger depending on underlying buffer rounding size. Must be called prior to using the ValueVector. Note that the maximum number of values a vector can allocate is Integer.MAX_VALUE / value width.
      Specified by:
      allocateNew in interface FixedWidthVector
      Parameters:
      valueCount -
      Throws:
      OutOfMemoryException - if it can't allocate the new buffer
    • reset Link icon

      public void reset()
      Description copied from class: BaseDataValueVector
      This method has a similar effect of allocateNew() without actually clearing and reallocating the value vector. The purpose is to move the value vector to a "mutate" state
      Overrides:
      reset in class BaseDataValueVector
    • reAlloc Link icon

      public void reAlloc()
      Allocate new buffer with double capacity, and copy data into the new buffer. Replace vector's buffer with new buffer, and release old one
    • reallocRaw Link icon

      public DrillBuf reallocRaw(int newAllocationSize)
      Description copied from class: BaseDataValueVector
      Core of vector allocation. Given a new size (which must be a power of two), allocate the new buffer, copy the current values, and leave the unused parts garbage-filled.
      Specified by:
      reallocRaw in class BaseDataValueVector
      Parameters:
      newAllocationSize - new buffer size as a power of two
      Returns:
      the new buffer
    • zeroVector Link icon

      public void zeroVector()
      Zero out the underlying buffer backing this vector.
      Specified by:
      zeroVector in interface FixedWidthVector
    • load Link icon

      public void load(UserBitShared.SerializedField metadata, DrillBuf buffer)
      Description copied from interface: ValueVector
      Load the data provided in the buffer. Typically used when deserializing from the wire.
      Specified by:
      load in interface ValueVector
      Parameters:
      metadata - Metadata used to decode the incoming buffer.
      buffer - The buffer that contains the ValueVector.
    • getTransferPair Link icon

      public TransferPair getTransferPair(BufferAllocator allocator)
      Description copied from interface: ValueVector
      Returns a transfer pair, creating a new target vector of the same type.
      Specified by:
      getTransferPair in interface ValueVector
      Overrides:
      getTransferPair in class BaseValueVector
    • getTransferPair Link icon

      public TransferPair getTransferPair(String ref, BufferAllocator allocator)
      Specified by:
      getTransferPair in interface ValueVector
    • makeTransferPair Link icon

      public TransferPair makeTransferPair(ValueVector to)
      Description copied from interface: ValueVector
      Returns a new transfer pair that is used to transfer underlying buffers into the target vector.
      Specified by:
      makeTransferPair in interface ValueVector
    • transferTo Link icon

      public void transferTo(Decimal9Vector target)
    • splitAndTransferTo Link icon

      public void splitAndTransferTo(int startIndex, int length, Decimal9Vector target)
    • getPayloadByteCount Link icon

      public int getPayloadByteCount(int valueCount)
      Description copied from interface: ValueVector
      Return the number of value bytes consumed by actual data.
      Specified by:
      getPayloadByteCount in interface ValueVector
    • getValueWidth Link icon

      public int getValueWidth()
      Description copied from interface: FixedWidthVector
      The width of a record in bytes.
      Specified by:
      getValueWidth in interface FixedWidthVector
      Returns:
      The width of a record in bytes.
    • copyFrom Link icon

      public void copyFrom(int fromIndex, int thisIndex, Decimal9Vector from)
    • copyFromSafe Link icon

      public void copyFromSafe(int fromIndex, int thisIndex, Decimal9Vector from)
    • copyEntry Link icon

      public void copyEntry(int toIndex, ValueVector from, int fromIndex)
      Specified by:
      copyEntry in interface ValueVector
    • decrementAllocationMonitor Link icon

      public void decrementAllocationMonitor()
    • toNullable Link icon

      public void toNullable(ValueVector nullableVector)
      Description copied from interface: ValueVector
      Convert a non-nullable vector to nullable by shuffling the data from one to the other. Avoids the need to generate copy code just to change mode. If this vector is non-nullable, accepts a nullable dual (same minor type, different mode.) If the vector is non-nullable, or non-scalar, then throws an exception.
      Specified by:
      toNullable in interface ValueVector
      Overrides:
      toNullable in class BaseValueVector
      Parameters:
      nullableVector - nullable vector of the same minor type as this vector