public class RangeTombstoneList extends java.lang.Object implements java.lang.Iterable<RangeTombstone>, IMeasurableMemory
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 and Description |
---|
RangeTombstoneList(ClusteringComparator comparator,
int capacity) |
Modifier and Type | Method and Description |
---|---|
void |
add(ClusteringBound<?> start,
ClusteringBound<?> end,
long markedAt,
int delTime)
Adds a new range tombstone.
|
void |
add(RangeTombstone tombstone) |
void |
addAll(RangeTombstoneList tombstones)
Adds all the range tombstones of
tombstones to this RangeTombstoneList. |
RangeTombstoneList |
clone(ByteBufferCloner cloner) |
void |
collectStats(EncodingStats.Collector collector) |
ClusteringComparator |
comparator() |
RangeTombstoneList |
copy() |
int |
dataSize() |
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
boolean |
isDeleted(Clustering<?> clustering,
Cell<?> cell)
Returns whether the given name/timestamp pair is deleted by one of the tombstone
of this RangeTombstoneList.
|
boolean |
isEmpty() |
java.util.Iterator<RangeTombstone> |
iterator() |
java.util.Iterator<RangeTombstone> |
iterator(boolean reversed) |
java.util.Iterator<RangeTombstone> |
iterator(Slice slice,
boolean reversed) |
long |
maxMarkedAt() |
RangeTombstone |
search(Clustering<?> name) |
DeletionTime |
searchDeletionTime(Clustering<?> name)
Returns the DeletionTime for the tombstone overlapping
name (there can't be more than one),
or null if name is not covered by any tombstone. |
int |
size() |
long |
unsharedHeapSize() |
void |
updateAllTimestamp(long timestamp) |
public RangeTombstoneList(ClusteringComparator comparator, int capacity)
public boolean isEmpty()
public int size()
public ClusteringComparator comparator()
public RangeTombstoneList copy()
public RangeTombstoneList clone(ByteBufferCloner cloner)
public void add(RangeTombstone tombstone)
public void add(ClusteringBound<?> start, ClusteringBound<?> end, long markedAt, int delTime)
public void addAll(RangeTombstoneList tombstones)
tombstones
to this RangeTombstoneList.public boolean isDeleted(Clustering<?> clustering, Cell<?> cell)
public DeletionTime searchDeletionTime(Clustering<?> name)
name
(there can't be more than one),
or null if name
is not covered by any tombstone.public RangeTombstone search(Clustering<?> name)
public int dataSize()
public long maxMarkedAt()
public void collectStats(EncodingStats.Collector collector)
public void updateAllTimestamp(long timestamp)
public java.util.Iterator<RangeTombstone> iterator()
iterator
in interface java.lang.Iterable<RangeTombstone>
public java.util.Iterator<RangeTombstone> iterator(boolean reversed)
public java.util.Iterator<RangeTombstone> iterator(Slice slice, boolean reversed)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public final int hashCode()
hashCode
in class java.lang.Object
public long unsharedHeapSize()
unsharedHeapSize
in interface IMeasurableMemory
Copyright © 2009- The Apache Software Foundation