Class CounterId

java.lang.Object
org.apache.cassandra.utils.CounterId
All Implemented Interfaces:
Comparable<CounterId>

public class CounterId extends Object implements Comparable<CounterId>
  • Field Details

  • Method Details

    • getLocalId

      public static CounterId getLocalId()
    • fromInt

      public static CounterId fromInt(int n)
      Pack an int in a valid CounterId so that the resulting ids respects the numerical ordering. Used for creating handcrafted but easy to understand contexts in unit tests (see CounterContextTest). Also used to generate a special ID for special-case update contexts (see CounterContext.createUpdate()).
    • wrap

      public static CounterId wrap(ByteBuffer id)
    • wrap

      public static CounterId wrap(ByteBuffer bb, int offset)
    • generate

      public static CounterId generate()
    • bytes

      public ByteBuffer bytes()
    • isLocalId

      public boolean isLocalId()
    • compareTo

      public int compareTo(CounterId o)
      Specified by:
      compareTo in interface Comparable<CounterId>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object