org.apache.cassandra.db
Class TimestampClock
java.lang.Object
org.apache.cassandra.db.TimestampClock
- All Implemented Interfaces:
- IClock
public class TimestampClock
- extends java.lang.Object
- implements IClock
A simple clock composed of a timestamp.
The comparison is the timestamp comparison.
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
MIN_VALUE
public static TimestampClock MIN_VALUE
ZERO_VALUE
public static TimestampClock ZERO_VALUE
SERIALIZER
public static ICompactSerializer2<IClock> SERIALIZER
TimestampClock
public TimestampClock(long timestamp)
timestamp
public long timestamp()
compare
public IClock.ClockRelationship compare(IClock other)
- Specified by:
compare
in interface IClock
- Parameters:
other
- Compare these two clocks.
- Returns:
- The relationship between the two clocks,
lets us know if reconciliation will have to take place.
getSuperset
public IClock getSuperset(java.util.List<IClock> otherClocks)
- Specified by:
getSuperset
in interface IClock
- Parameters:
otherClocks
- The other clock to use when extracting the superset.
- Returns:
- The superset of the two clocks.
size
public int size()
- Specified by:
size
in interface IClock
- Returns:
- number of bytes this type of clock
uses up when serialized.
type
public ClockType type()
- Specified by:
type
in interface IClock
- Returns:
- the type of this clock.
serialize
public void serialize(java.io.DataOutput out)
throws java.io.IOException
- Specified by:
serialize
in interface IClock
- Parameters:
out
- Write a serialized representation of this clock to the output.
- Throws:
java.io.IOException
- Thrown if writing failed.
toString
public java.lang.String toString()
- Specified by:
toString
in interface IClock
- Overrides:
toString
in class java.lang.Object
- Returns:
- a textual representation of this clock.
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
Copyright © 2010 The Apache Software Foundation