Package org.apache.cassandra.db
Class DeletionTime
- java.lang.Object
-
- org.apache.cassandra.db.DeletionTime
-
- All Implemented Interfaces:
java.lang.Comparable<DeletionTime>,IMeasurableMemory
public class DeletionTime extends java.lang.Object implements java.lang.Comparable<DeletionTime>, IMeasurableMemory
Information on deletion of a storage engine object.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDeletionTime.Serializer
-
Field Summary
Fields Modifier and Type Field Description static longEMPTY_SIZEstatic DeletionTimeLIVEA special DeletionTime that signifies that there is no top-level (row) tombstone.static DeletionTime.Serializerserializer
-
Constructor Summary
Constructors Constructor Description DeletionTime(long markedForDeleteAt, int localDeletionTime)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(DeletionTime dt)intdataSize()booleandeletes(long timestamp)booleandeletes(LivenessInfo info)booleandeletes(Cell<?> cell)voiddigest(Digest digest)booleanequals(java.lang.Object o)inthashCode()booleanisLive()Returns whether this DeletionTime is live, that is deletes no columns.intlocalDeletionTime()The local server timestamp, in seconds since the unix epoch, at which this tombstone was created.longmarkedForDeleteAt()A timestamp (typically in microseconds since the unix epoch, although this is not enforced) after which data should be considered deleted.booleansupersedes(DeletionTime dt)java.lang.StringtoString()longunsharedHeapSize()booleanvalidate()check if this deletion time is valid - localDeletionTime can never be negative
-
-
-
Field Detail
-
EMPTY_SIZE
public static final long EMPTY_SIZE
-
LIVE
public static final DeletionTime LIVE
A special DeletionTime that signifies that there is no top-level (row) tombstone.
-
serializer
public static final DeletionTime.Serializer serializer
-
-
Method Detail
-
markedForDeleteAt
public long markedForDeleteAt()
A timestamp (typically in microseconds since the unix epoch, although this is not enforced) after which data should be considered deleted. If set to Long.MIN_VALUE, this implies that the data has not been marked for deletion at all.
-
localDeletionTime
public int localDeletionTime()
The local server timestamp, in seconds since the unix epoch, at which this tombstone was created. This is only used for purposes of purging the tombstone after gc_grace_seconds have elapsed.
-
isLive
public boolean isLive()
Returns whether this DeletionTime is live, that is deletes no columns.
-
digest
public void digest(Digest digest)
-
validate
public boolean validate()
check if this deletion time is valid - localDeletionTime can never be negative- Returns:
- true if it is valid
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(DeletionTime dt)
- Specified by:
compareToin interfacejava.lang.Comparable<DeletionTime>
-
supersedes
public boolean supersedes(DeletionTime dt)
-
deletes
public boolean deletes(LivenessInfo info)
-
deletes
public boolean deletes(Cell<?> cell)
-
deletes
public boolean deletes(long timestamp)
-
dataSize
public int dataSize()
-
unsharedHeapSize
public long unsharedHeapSize()
- Specified by:
unsharedHeapSizein interfaceIMeasurableMemory- Returns:
- the amount of on-heap memory retained by the object that might be reclaimed if the object were reclaimed, i.e. it should try to exclude globally cached data where possible, or counting portions of arrays that are referenced by the object but used by other objects only (e.g. slabbed byte-buffers), etc.
-
-