Class LongComparator

java.lang.Object
org.apache.hadoop.hbase.filter.ByteArrayComparable
org.apache.hadoop.hbase.filter.LongComparator
All Implemented Interfaces:
Comparable<byte[]>

@Public public class LongComparator extends ByteArrayComparable
A long comparator which numerical compares against the specified byte array
  • Field Details

  • Constructor Details

  • Method Details

    • compareTo

      public int compareTo(byte[] value, int offset, int length)
      Description copied from class: ByteArrayComparable
      Special compareTo method for subclasses, to avoid copying byte[] unnecessarily.
      Specified by:
      compareTo in class ByteArrayComparable
      Parameters:
      value - byte[] to compare
      offset - offset into value
      length - number of bytes to compare
      Returns:
      a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
    • compareTo

      public int compareTo(ByteBuffer value, int offset, int length)
      Description copied from class: ByteArrayComparable
      Special compareTo method for subclasses, to avoid copying bytes unnecessarily.
      Overrides:
      compareTo in class ByteArrayComparable
      Parameters:
      value - bytes to compare within a ByteBuffer
      offset - offset into value
      length - number of bytes to compare
      Returns:
      a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
    • toByteArray

      public byte[] toByteArray()
      Returns The comparator serialized using pb
      Specified by:
      toByteArray in class ByteArrayComparable
    • parseFrom

      public static LongComparator parseFrom(byte[] pbBytes) throws DeserializationException
      Parses a serialized representation of LongComparator
      Parameters:
      pbBytes - A pb serialized LongComparator instance
      Returns:
      An instance of LongComparator made from bytes
      Throws:
      DeserializationException - if an error occurred
      See Also:
    • areSerializedFieldsEqual

      Returns true if and only if the fields of the comparator that are serialized are equal to the corresponding fields in other. Used for testing.