Class DeletionTime

java.lang.Object
org.apache.cassandra.db.DeletionTime
All Implemented Interfaces:
Comparable<DeletionTime>, IMeasurableMemory
Direct Known Subclasses:
DeletionTime.InvalidDeletionTime

public class DeletionTime extends Object implements Comparable<DeletionTime>, IMeasurableMemory
Information on deletion of a storage engine object.
  • Field Details

    • 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.
  • Method Details

    • build

      public static DeletionTime build(long markedForDeleteAt, long localDeletionTime)
    • 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 long 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. This is always true, because - as we permit negative timestamps, markedForDeleteAt can be negative. - localDeletionTime is stored as an unsigned int and cannot be negative.
      Returns:
      true if it is valid
    • equals

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

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • toString

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

      public int compareTo(DeletionTime dt)
      Specified by:
      compareTo in interface 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:
      unsharedHeapSize in interface IMeasurableMemory
      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.
    • getSerializer

      public static DeletionTime.Serializer getSerializer(Version version)