Class OrderedInt32

java.lang.Object
org.apache.hadoop.hbase.types.OrderedBytesBase<Integer>
org.apache.hadoop.hbase.types.OrderedInt32
All Implemented Interfaces:
DataType<Integer>

@Public public class OrderedInt32 extends OrderedBytesBase<Integer>
An int of 32-bits using a fixed-length encoding. Built on OrderedBytes.encodeInt32(PositionedByteRange, int, Order).
  • Field Details

  • Constructor Details

    • OrderedInt32

      public OrderedInt32(Order order)
      Creates a new 32-bit int with a fixed-length encoding.
      Parameters:
      order - the Order to use
  • Method Details

    • isNullable

      public boolean isNullable()
      Description copied from interface: DataType
      Indicates whether this instance supports encoding null values. This depends on the implementation details of the encoding format. All DataTypes that support null should treat null as comparing less than any non-null value for default sort ordering purposes.
      Specified by:
      isNullable in interface DataType<Integer>
      Overrides:
      isNullable in class OrderedBytesBase<Integer>
      Returns:
      true when null is supported, false otherwise.
    • encodedLength

      public int encodedLength(Integer val)
      Description copied from interface: DataType
      Inform consumers how long the encoded byte[] will be.
      Parameters:
      val - The value to check.
      Returns:
      the number of bytes required to encode val.a
    • encodedClass

      Description copied from interface: DataType
      Inform consumers over what type this DataType operates. Useful when working with bare DataType instances.
    • decode

      Description copied from interface: DataType
      Read an instance of T from the buffer src.
      Parameters:
      src - the buffer containing the encoded value.
    • encode

      public int encode(PositionedByteRange dst, Integer val)
      Description copied from interface: DataType
      Write instance val into buffer dst.
      Parameters:
      dst - the buffer containing the encoded value.
      val - the value to encode onto dst.
      Returns:
      number of bytes written.
    • decodeInt

      public int decodeInt(PositionedByteRange src)
      Read an int value from the buffer src.
      Parameters:
      src - the PositionedByteRange to read the int from
      Returns:
      the int read from the buffer
    • encodeInt

      public int encodeInt(PositionedByteRange dst, int val)
      Write instance val into buffer dst.
      Parameters:
      dst - the PositionedByteRange to write to
      val - the value to write to dst
      Returns:
      the number of bytes written