Enum DataBufferCalculator

java.lang.Object
java.lang.Enum<DataBufferCalculator>
com.illumon.iris.db.util.file.DataBufferCalculator
All Implemented Interfaces:
Serializable, Comparable<DataBufferCalculator>, java.lang.constant.Constable

public enum DataBufferCalculator
extends Enum<DataBufferCalculator>
Useful constants and utilities for manipulating buffers.
  • Enum Constant Details

    • DEFAULT

      public static final DataBufferCalculator DEFAULT
      The default instance used to calculate offsets for storing and communicating Deephaven-format binary data.
    • WRITE_ONLY

      public static final DataBufferCalculator WRITE_ONLY
      The instance used to calculate offsets for write-only data append.
  • Method Details

    • values

      public static DataBufferCalculator[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static DataBufferCalculator valueOf​(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getSimpleDataRecordSizeInBytes

      public static int getSimpleDataRecordSizeInBytes​(@NotNull Class<?> type)
    • getDataRecordSizeInBytes

      public static int getDataRecordSizeInBytes​(@NotNull com.illumon.dataobjects.ColumnDefinition<?> columnDefinition)
    • getDataRecordSizeToByteSizeShift

      public static int getDataRecordSizeToByteSizeShift​(int recordSizeInBytes)
    • getDataRecordSizeToByteSizeShift

      public static int getDataRecordSizeToByteSizeShift​(@NotNull com.illumon.dataobjects.ColumnDefinition<?> columnDefinition)
    • getBufferSize

      public final int getBufferSize()
    • getBufferIndex

      public final int getBufferIndex​(long byteIndex)
      Calculate the index of the column buffer that holds the desired element.
      Parameters:
      byteIndex - A byte index into a buffer series
      Returns:
      The index of the column buffer that holds the desired element
    • getSubBufferByteIndex

      public final int getSubBufferByteIndex​(long byteIndex)
      Calculate the byte offset into the buffer that holds the specified byte index.
      Parameters:
      byteIndex - A byte index into a buffer series
      Returns:
      The byte offset into the buffer that holds the specified byte index
    • getFirstByteIndex

      public final long getFirstByteIndex​(int bufferIndex)
      Calculate the byte index of the first byte of the specified buffer.
      Parameters:
      bufferIndex - The buffer's index in a buffer series
      Returns:
      The byte index of the first byte of the specified buffer
    • calculateBufferUsedSize

      public final int calculateBufferUsedSize​(long totalUsedSize, int bufferIndex)
      Calculate the used size of the specified buffer.
      Parameters:
      totalUsedSize - Total used size in bytes of a buffer series
      bufferIndex - The buffer's index in the buffer series
      Returns:
      The used size of the specified buffer