org.apache.cassandra.db

## Class MutableDeletionInfo

- java.lang.Object
- - org.apache.cassandra.db.MutableDeletionInfo

- All Implemented Interfaces:
    IMeasurableMemory, DeletionInfo

      public class MutableDeletionInfo
      extends java.lang.Object
      implements DeletionInfo

  A mutable implementation of `DeletionInfo`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `MutableDeletionInfo.Builder` Builds DeletionInfo object from (in order) range tombstone markers.

  - ### Field Summary

    - ### Fields inherited from interface org.apache.cassandra.db.DeletionInfo

      `LIVE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MutableDeletionInfo(DeletionTime partitionDeletion)`
    `MutableDeletionInfo(DeletionTime partitionDeletion, RangeTombstoneList ranges)`
    `MutableDeletionInfo(long markedForDeleteAt, int localDeletionTime)` Creates a DeletionInfo with only a top-level (row) tombstone.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `DeletionInfo` | `add(DeletionInfo newInfo)` Combines another DeletionInfo with this one and returns the result.
    `void` | `add(DeletionTime newInfo)` Potentially replaces the top-level tombstone with another, keeping whichever has the higher markedForDeleteAt timestamp.
    `void` | `add(RangeTombstone tombstone, ClusteringComparator comparator)`
    `static MutableDeletionInfo.Builder` | `builder(DeletionTime partitionLevelDeletion, ClusteringComparator comparator, boolean reversed)`
    `void` | `collectStats(EncodingStats.Collector collector)`
    `MutableDeletionInfo` | `copy(AbstractAllocator allocator)`
    `int` | `dataSize()`
    `boolean` | `equals(java.lang.Object o)`
    `DeletionTime` | `getPartitionDeletion()`
    `int` | `hashCode()`
    `boolean` | `hasRanges()`
    `boolean` | `isLive()` Returns whether this DeletionInfo is live, that is deletes no columns.
    `static MutableDeletionInfo` | `live()` Returns a new DeletionInfo that has no top-level tombstone or any range tombstones.
    `long` | `maxTimestamp()`
    `boolean` | `mayModify(DeletionInfo delInfo)` Whether this deletion info may modify the provided one if added to it.
    `MutableDeletionInfo` | `mutableCopy()`
    `int` | `rangeCount()`
    `RangeTombstone` | `rangeCovering(Clustering name)`
    `java.util.Iterator<RangeTombstone>` | `rangeIterator(boolean reversed)`
    `java.util.Iterator<RangeTombstone>` | `rangeIterator(Slice slice, boolean reversed)`
    `java.lang.String` | `toString()`
    `long` | `unsharedHeapSize()`
    `DeletionInfo` | `updateAllTimestamp(long timestamp)`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### MutableDeletionInfo

          public MutableDeletionInfo(long markedForDeleteAt,
                                     int localDeletionTime)

      Creates a DeletionInfo with only a top-level (row) tombstone.
      Parameters:
        `markedForDeleteAt` - the time after which the entire row should be considered deleted
        `localDeletionTime` - what time the deletion write was applied locally (for purposes of purging the tombstone after gc_grace_seconds).

    - #### MutableDeletionInfo

          public MutableDeletionInfo(DeletionTime partitionDeletion)

    - #### MutableDeletionInfo

          public MutableDeletionInfo(DeletionTime partitionDeletion,
                                     RangeTombstoneList ranges)

  - ### Method Detail

    - #### live

          public static MutableDeletionInfo live()

      Returns a new DeletionInfo that has no top-level tombstone or any range tombstones.

    - #### mutableCopy

          public MutableDeletionInfo mutableCopy()

      Specified by:
        `mutableCopy` in interface `DeletionInfo`

    - #### copy

          public MutableDeletionInfo copy(AbstractAllocator allocator)

      Specified by:
        `copy` in interface `DeletionInfo`

    - #### isLive

          public boolean isLive()

      Returns whether this DeletionInfo is live, that is deletes no columns.
      Specified by:
        `isLive` in interface `DeletionInfo`

    - #### add

          public void add(DeletionTime newInfo)

      Potentially replaces the top-level tombstone with another, keeping whichever has the higher markedForDeleteAt timestamp.
      Parameters:
        `newInfo` - the deletion time to add to this deletion info.

    - #### add

          public void add(RangeTombstone tombstone,
                          ClusteringComparator comparator)

    - #### add

          public DeletionInfo add(DeletionInfo newInfo)

      Combines another DeletionInfo with this one and returns the result. Whichever top-level tombstone has the higher markedForDeleteAt timestamp will be kept, along with its localDeletionTime. The range tombstones will be combined.
      Returns:
        this object.

    - #### getPartitionDeletion

          public DeletionTime getPartitionDeletion()

      Specified by:
        `getPartitionDeletion` in interface `DeletionInfo`

    - #### rangeIterator

          public java.util.Iterator<RangeTombstone> rangeIterator(boolean reversed)

      Specified by:
        `rangeIterator` in interface `DeletionInfo`

    - #### rangeIterator

          public java.util.Iterator<RangeTombstone> rangeIterator(Slice slice,
                                                                  boolean reversed)

      Specified by:
        `rangeIterator` in interface `DeletionInfo`

    - #### rangeCovering

          public RangeTombstone rangeCovering(Clustering name)

      Specified by:
        `rangeCovering` in interface `DeletionInfo`

    - #### dataSize

          public int dataSize()

      Specified by:
        `dataSize` in interface `DeletionInfo`

    - #### hasRanges

          public boolean hasRanges()

      Specified by:
        `hasRanges` in interface `DeletionInfo`

    - #### rangeCount

          public int rangeCount()

      Specified by:
        `rangeCount` in interface `DeletionInfo`

    - #### maxTimestamp

          public long maxTimestamp()

      Specified by:
        `maxTimestamp` in interface `DeletionInfo`

    - #### mayModify

          public boolean mayModify(DeletionInfo delInfo)

      Whether this deletion info may modify the provided one if added to it.
      Specified by:
        `mayModify` in interface `DeletionInfo`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### updateAllTimestamp

          public DeletionInfo updateAllTimestamp(long timestamp)

    - #### equals

          public boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public final int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### 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.

    - #### collectStats

          public void collectStats(EncodingStats.Collector collector)

      Specified by:
        `collectStats` in interface `DeletionInfo`

    - #### builder

          public static MutableDeletionInfo.Builder builder(DeletionTime partitionLevelDeletion,
                                                            ClusteringComparator comparator,
                                                            boolean reversed)

Copyright © 2018 The Apache Software Foundation