Record Class ProgressToken.BucketKeyWrapper

java.lang.Object
java.lang.Record
com.yahoo.documentapi.ProgressToken.BucketKeyWrapper
All Implemented Interfaces:
Comparable<ProgressToken.BucketKeyWrapper>
Enclosing class:
ProgressToken

public static record ProgressToken.BucketKeyWrapper(long key) extends Record implements Comparable<ProgressToken.BucketKeyWrapper>
For consistent bucket key ordering, we need to ensure that reverse bucket IDs that have their MSB set actually are compared as being greater than those that don't. This is yet another issue caused by Java's lack of unsigned integers.
  • Constructor Details

    • BucketKeyWrapper

      public BucketKeyWrapper(long key)
      Creates an instance of a BucketKeyWrapper record class.
      Parameters:
      key - the value for the key record component
  • Method Details

    • compareTo

      public int compareTo(ProgressToken.BucketKeyWrapper other)
      Specified by:
      compareTo in interface Comparable<ProgressToken.BucketKeyWrapper>
    • toBucketId

      public com.yahoo.document.BucketId toBucketId()
    • toString

      public String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • equals

      public boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • hashCode

      public int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • key

      public long key()
      Returns the value of the key record component.
      Returns:
      the value of the key record component