Package 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 ofDeletionInfo.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMutableDeletionInfo.BuilderBuilds DeletionInfo object from (in order) range tombstone markers.
-
Field Summary
-
Fields inherited from interface org.apache.cassandra.db.DeletionInfo
LIVE
-
-
Constructor Summary
Constructors Constructor Description MutableDeletionInfo(long markedForDeleteAt, int localDeletionTime)Creates a DeletionInfo with only a top-level (row) tombstone.MutableDeletionInfo(DeletionTime partitionDeletion)MutableDeletionInfo(DeletionTime partitionDeletion, RangeTombstoneList ranges)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DeletionInfoadd(DeletionInfo newInfo)Combines another DeletionInfo with this one and returns the result.voidadd(DeletionTime newInfo)Potentially replaces the top-level tombstone with another, keeping whichever has the higher markedForDeleteAt timestamp.voidadd(RangeTombstone tombstone, ClusteringComparator comparator)static MutableDeletionInfo.Builderbuilder(DeletionTime partitionLevelDeletion, ClusteringComparator comparator, boolean reversed)MutableDeletionInfoclone(ByteBufferCloner cloner)voidcollectStats(EncodingStats.Collector collector)intdataSize()booleanequals(java.lang.Object o)DeletionTimegetPartitionDeletion()inthashCode()booleanhasRanges()booleanisLive()Returns whether this DeletionInfo is live, that is deletes no columns.static MutableDeletionInfolive()Returns a new DeletionInfo that has no top-level tombstone or any range tombstones.longmaxTimestamp()booleanmayModify(DeletionInfo delInfo)Whether this deletion info may modify the provided one if added to it.MutableDeletionInfomutableCopy()intrangeCount()RangeTombstonerangeCovering(Clustering<?> name)java.util.Iterator<RangeTombstone>rangeIterator(boolean reversed)java.util.Iterator<RangeTombstone>rangeIterator(Slice slice, boolean reversed)java.lang.StringtoString()longunsharedHeapSize()DeletionInfoupdateAllTimestamp(long timestamp)
-
-
-
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 deletedlocalDeletionTime- 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:
mutableCopyin interfaceDeletionInfo
-
clone
public MutableDeletionInfo clone(ByteBufferCloner cloner)
- Specified by:
clonein interfaceDeletionInfo
-
isLive
public boolean isLive()
Returns whether this DeletionInfo is live, that is deletes no columns.- Specified by:
isLivein interfaceDeletionInfo
-
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:
getPartitionDeletionin interfaceDeletionInfo
-
rangeIterator
public java.util.Iterator<RangeTombstone> rangeIterator(boolean reversed)
- Specified by:
rangeIteratorin interfaceDeletionInfo
-
rangeIterator
public java.util.Iterator<RangeTombstone> rangeIterator(Slice slice, boolean reversed)
- Specified by:
rangeIteratorin interfaceDeletionInfo
-
rangeCovering
public RangeTombstone rangeCovering(Clustering<?> name)
- Specified by:
rangeCoveringin interfaceDeletionInfo
-
dataSize
public int dataSize()
- Specified by:
dataSizein interfaceDeletionInfo
-
hasRanges
public boolean hasRanges()
- Specified by:
hasRangesin interfaceDeletionInfo
-
rangeCount
public int rangeCount()
- Specified by:
rangeCountin interfaceDeletionInfo
-
maxTimestamp
public long maxTimestamp()
- Specified by:
maxTimestampin interfaceDeletionInfo
-
mayModify
public boolean mayModify(DeletionInfo delInfo)
Whether this deletion info may modify the provided one if added to it.- Specified by:
mayModifyin interfaceDeletionInfo
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
updateAllTimestamp
public DeletionInfo updateAllTimestamp(long timestamp)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
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.
-
collectStats
public void collectStats(EncodingStats.Collector collector)
- Specified by:
collectStatsin interfaceDeletionInfo
-
builder
public static MutableDeletionInfo.Builder builder(DeletionTime partitionLevelDeletion, ClusteringComparator comparator, boolean reversed)
-
-