Class TimeStampVector

All Implemented Interfaces:
Closeable, AutoCloseable, Iterable<ValueVector>, ElementAddressableVector, FieldVector, FixedWidthVector, ValueVector, VectorDefinitionSetter
Direct Known Subclasses:
TimeStampMicroTZVector, TimeStampMicroVector, TimeStampMilliTZVector, TimeStampMilliVector, TimeStampNanoTZVector, TimeStampNanoVector, TimeStampSecTZVector, TimeStampSecVector

public abstract class TimeStampVector extends BaseFixedWidthVector
TimeStampVector is an abstract interface for fixed width vector (8 bytes) of timestamp values which could be null. A validity buffer (bit vector) is maintained to track which elements in the vector are null.
  • Field Details

  • Constructor Details

    • TimeStampVector

      public TimeStampVector(String name, FieldType fieldType, BufferAllocator allocator)
      Instantiate a TimeStampVector. This doesn't allocate any memory for the data in vector.
      Parameters:
      name - name of the vector
      fieldType - type of Field materialized by this vector
      allocator - allocator for memory management.
    • TimeStampVector

      public TimeStampVector(Field field, BufferAllocator allocator)
      Instantiate a TimeStampVector. This doesn't allocate any memory for the data in vector.
      Parameters:
      field - field materialized by this vector
      allocator - allocator for memory management.
  • Method Details

    • get

      public long get(int index) throws IllegalStateException
      Get the element at the given index from the vector.
      Parameters:
      index - position of element
      Returns:
      element at given index
      Throws:
      IllegalStateException
    • setValue

      protected void setValue(int index, long value)
    • set

      public void set(int index, long value)
      Set the element at the given index to the given value.
      Parameters:
      index - position of element
      value - value of element
    • setSafe

      public void setSafe(int index, long value)
      Same as set(int, long) except that it handles the case when index is greater than or equal to existing value capacity BaseFixedWidthVector.getValueCapacity().
      Parameters:
      index - position of element
      value - value of element
    • set

      public void set(int index, int isSet, long value)
      Store the given value at a particular position in the vector. isSet indicates whether the value is NULL or not.
      Parameters:
      index - position of the new value
      isSet - 0 for NULL value, 1 otherwise
      value - element value
    • setSafe

      public void setSafe(int index, int isSet, long value)
      Same as set(int, int, long) except that it handles the case when index is greater than or equal to current value capacity of the vector.
      Parameters:
      index - position of the new value
      isSet - 0 for NULL value, 1 otherwise
      value - element value
    • get

      public static long get(ArrowBuf buffer, int index)
      Given a data buffer, get the value stored at a particular position in the vector.

      This method should not be used externally.

      Parameters:
      buffer - data buffer
      index - position of the element.
      Returns:
      value stored at the index.