org.apache.cassandra.db

## Class DeletionInfo

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

    public class DeletionInfo
    extends java.lang.Object

A combination of a top-level (or row) tombstone and range tombstones describing the deletions within a `ColumnFamily` (or row).

### Nested Class Summary

Nested Classes
`class` `DeletionInfo.InOrderTester` This object allow testing whether a given column (name/timestamp) is deleted or not by this DeletionInfo, assuming that the columns given to this object are passed in forward or reversed comparator sorted order.
`static class` `DeletionInfo.Serializer`

### Constructor Summary

Constructors
Constructor and Description
`DeletionInfo(java.nio.ByteBuffer start, java.nio.ByteBuffer end, java.util.Comparator<java.nio.ByteBuffer> comparator, long markedForDeleteAt, int localDeletionTime)`
`DeletionInfo(DeletionTime topLevel)`
`DeletionInfo(long markedForDeleteAt, int localDeletionTime)` Creates a DeletionInfo with only a top-level (row) tombstone.
`DeletionInfo(RangeTombstone rangeTombstone, java.util.Comparator<java.nio.ByteBuffer> comparator)`

### Method Summary

Methods
`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, java.util.Comparator<java.nio.ByteBuffer> comparator)`
`DeletionInfo` `copy()`
`int` `dataSize()`
`boolean` `equals(java.lang.Object o)`
`DeletionTime` `getTopLevelDeletion()` Returns the top-level (or "row") tombstone.
`int` `hashCode()`
`boolean` `hasPurgeableTombstones(int gcBefore)` Returns true if `purge` would remove the top-level tombstone or any of the range tombstones, false otherwise.
`boolean` `hasRanges()`
`DeletionInfo.InOrderTester` `inOrderTester(boolean reversed)` Returns a new `DeletionInfo.InOrderTester` given the order in which columns will be passed to it.
`boolean` `isDeleted(java.nio.ByteBuffer name, long timestamp)`
`boolean` `isDeleted(Column column)` Return whether a given column is deleted by the container having this deletion info.
`boolean` `isLive()` Returns whether this DeletionInfo is live, that is deletes no columns.
`static DeletionInfo` `live()` Returns a new DeletionInfo that has no top-level tombstone or any range tombstones.
`long` `maxTimestamp()` Returns the maximum timestamp in any of the range tombstones or the top-level tombstone.
`boolean` `mayModify(DeletionInfo delInfo)` Whether this deletion info may modify the provided one if added to it.
`long` `minTimestamp()` Returns the minimum timestamp in any of the range tombstones or the top-level tombstone.
`void` `purge(int gcBefore)` Purge every tombstones that are older than `gcbefore`.
`int` `rangeCount()`
`DeletionTime` `rangeCovering(java.nio.ByteBuffer name)`
`java.util.Iterator<RangeTombstone>` `rangeIterator()`
`static DeletionInfo.Serializer` `serializer()`
`java.lang.String` `toString()`
`void` `updateAllTimestamp(long timestamp)`

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

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

### Constructor Detail

#### DeletionInfo

    public DeletionInfo(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).

#### DeletionInfo

    public DeletionInfo(DeletionTime topLevel)

#### DeletionInfo

    public DeletionInfo(java.nio.ByteBuffer start,
                java.nio.ByteBuffer end,
                java.util.Comparator<java.nio.ByteBuffer> comparator,
                long markedForDeleteAt,
                int localDeletionTime)

#### DeletionInfo

    public DeletionInfo(RangeTombstone rangeTombstone,
                java.util.Comparator<java.nio.ByteBuffer> comparator)

### Method Detail

#### live

    public static DeletionInfo live()

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

#### serializer

    public static DeletionInfo.Serializer serializer()

#### copy

    public DeletionInfo copy()

#### isLive

    public boolean isLive()

Returns whether this DeletionInfo is live, that is deletes no columns.

#### isDeleted

    public boolean isDeleted(Column column)

Return whether a given column is deleted by the container having this deletion info.

Parameters:
  `column` - the column to check.
Returns:
  true if the column is deleted, false otherwise

#### isDeleted

    public boolean isDeleted(java.nio.ByteBuffer name,
                    long timestamp)

#### inOrderTester

    public DeletionInfo.InOrderTester inOrderTester(boolean reversed)

Returns a new `DeletionInfo.InOrderTester` given the order in which columns will be passed to it.

#### purge

    public void purge(int gcBefore)

Purge every tombstones that are older than `gcbefore`.

Parameters:
  `gcBefore` - timestamp (in seconds) before which tombstones should be purged

#### hasPurgeableTombstones

    public boolean hasPurgeableTombstones(int gcBefore)

Returns true if `purge` would remove the top-level tombstone or any of the range tombstones, false otherwise.

Parameters:
  `gcBefore` - timestamp (in seconds) before which tombstones should be purged

#### add

    public void add(DeletionTime newInfo)

Potentially replaces the top-level tombstone with another, keeping whichever has the higher markedForDeleteAt timestamp.

Parameters:
  `newInfo` -

#### add

    public void add(RangeTombstone tombstone,
           java.util.Comparator<java.nio.ByteBuffer> 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.

#### minTimestamp

    public long minTimestamp()

Returns the minimum timestamp in any of the range tombstones or the top-level tombstone.

#### maxTimestamp

    public long maxTimestamp()

Returns the maximum timestamp in any of the range tombstones or the top-level tombstone.

#### getTopLevelDeletion

    public DeletionTime getTopLevelDeletion()

Returns the top-level (or "row") tombstone.

#### rangeIterator

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

#### rangeCovering

    public DeletionTime rangeCovering(java.nio.ByteBuffer name)

#### dataSize

    public int dataSize()

#### hasRanges

    public boolean hasRanges()

#### rangeCount

    public int rangeCount()

#### mayModify

    public boolean mayModify(DeletionInfo delInfo)

Whether this deletion info may modify the provided one if added to it.

#### toString

    public java.lang.String toString()

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

#### updateAllTimestamp

    public void 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`