Package org.apache.cassandra.utils
Class CounterId
java.lang.Object
org.apache.cassandra.utils.CounterId
- All Implemented Interfaces:
Comparable<CounterId>
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbytes()intbooleanstatic CounterIdfromInt(int n) Pack an int in a valid CounterId so that the resulting ids respects the numerical ordering.static CounterIdgenerate()static CounterIdinthashCode()booleantoString()static CounterIdwrap(ByteBuffer id) static CounterIdwrap(ByteBuffer bb, int offset)
-
Field Details
-
LENGTH
public static final int LENGTH- See Also:
-
-
Method Details
-
getLocalId
-
fromInt
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
-
wrap
-
generate
-
bytes
-
isLocalId
public boolean isLocalId() -
compareTo
- Specified by:
compareToin interfaceComparable<CounterId>
-
toString
-
equals
-
hashCode
public int hashCode()
-