Package org.apache.cassandra.db
Class RangeTombstoneList
java.lang.Object
org.apache.cassandra.db.RangeTombstoneList
- All Implemented Interfaces:
Iterable<RangeTombstone>,IMeasurableMemory
public class RangeTombstoneList
extends Object
implements Iterable<RangeTombstone>, IMeasurableMemory
Data structure holding the range tombstones of a ColumnFamily.
This is essentially a sorted list of non-overlapping (tombstone) ranges.
A range tombstone has 4 elements: the start and end of the range covered,
and the deletion infos (markedAt timestamp and local deletion time). The
markedAt timestamp is what define the priority of 2 overlapping tombstones.
That is, given 2 tombstones [0, 10]@t1 and [5, 15]@t2, then if t2 > t1 (and
are the tombstones markedAt values), the 2nd tombstone take precedence over
the first one on [5, 10]. If such tombstones are added to a RangeTombstoneList,
the range tombstone list will store them as [[0, 5]@t1, [5, 15]@t2].
The only use of the local deletion time is to know when a given tombstone can be purged, which will be done by the purge() method.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(RangeTombstone tombstone) voidaddAll(RangeTombstoneList tombstones) Adds all the range tombstones oftombstonesto this RangeTombstoneList.clone(ByteBufferCloner cloner) voidcollectStats(EncodingStats.Collector collector) copy()intdataSize()booleanfinal inthashCode()booleanisDeleted(Clustering<?> clustering, Cell<?> cell) Returns whether the given name/timestamp pair is deleted by one of the tombstone of this RangeTombstoneList.booleanisEmpty()iterator()iterator(boolean reversed) longsearch(Clustering<?> name) searchDeletionTime(Clustering<?> name) Returns the DeletionTime for the tombstone overlappingname(there can't be more than one), or null ifnameis not covered by any tombstone.intsize()longvoidupdateAllTimestamp(long timestamp) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
RangeTombstoneList
-
-
Method Details
-
isEmpty
public boolean isEmpty() -
size
public int size() -
comparator
-
copy
-
clone
-
add
-
addAll
Adds all the range tombstones oftombstonesto this RangeTombstoneList. -
isDeleted
Returns whether the given name/timestamp pair is deleted by one of the tombstone of this RangeTombstoneList. -
searchDeletionTime
Returns the DeletionTime for the tombstone overlappingname(there can't be more than one), or null ifnameis not covered by any tombstone. -
search
-
dataSize
public int dataSize() -
maxMarkedAt
public long maxMarkedAt() -
collectStats
-
updateAllTimestamp
public void updateAllTimestamp(long timestamp) -
iterator
- Specified by:
iteratorin interfaceIterable<RangeTombstone>
-
iterator
-
iterator
-
equals
-
hashCode
public final int hashCode()
-