|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cassandra.dht.AbstractBounds<T>
org.apache.cassandra.dht.Range<T>
public class Range<T extends RingPosition>
A representation of the range that a node is responsible for on the DHT ring. A Range is responsible for the tokens between (left, right]. Used by the partitioner and by map/reduce by-token range scans.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.cassandra.dht.AbstractBounds |
---|
AbstractBounds.AbstractBoundsSerializer |
Field Summary | |
---|---|
static long |
serialVersionUID
|
Fields inherited from class org.apache.cassandra.dht.AbstractBounds |
---|
left, partitioner, right, serializer |
Constructor Summary | |
---|---|
Range(T left,
T right)
|
|
Range(T left,
T right,
IPartitioner partitioner)
|
Method Summary | ||
---|---|---|
java.util.List<java.lang.String> |
asList()
|
|
int |
compareTo(Range<T> rhs)
|
|
boolean |
contains(Range<T> that)
|
|
boolean |
contains(T point)
Helps determine if a given point on the DHT ring is contained in the range in question. |
|
static
|
contains(T left,
T right,
T point)
|
|
java.util.Set<Range<T>> |
differenceToFetch(Range<T> rhs)
Calculate set of the difference ranges of given two ranges (as current (A, B] and rhs is (C, D]) which node will need to fetch when moving to a given new token |
|
boolean |
equals(java.lang.Object o)
|
|
protected java.lang.String |
getClosingString()
|
|
protected java.lang.String |
getOpeningString()
|
|
java.util.Set<Range<T>> |
intersectionWith(Range<T> that)
|
|
boolean |
intersects(AbstractBounds<T> that)
|
|
boolean |
intersects(Bounds<T> that)
|
|
boolean |
intersects(Range<T> that)
|
|
static
|
isInRanges(T token,
java.lang.Iterable<Range<T>> ranges)
|
|
boolean |
isWrapAround()
|
|
static
|
isWrapAround(T left,
T right)
Tells if the given range is a wrap around. |
|
static Range<RowPosition> |
makeRowRange(Token left,
Token right,
IPartitioner partitioner)
Compute a range of keys corresponding to a given range of token. |
|
static
|
normalize(java.util.Collection<Range<T>> ranges)
|
|
static
|
rangeSet(Range<T>... ranges)
|
|
static
|
rangeSet(Range<T> range)
|
|
Pair<AbstractBounds<T>,AbstractBounds<T>> |
split(T position)
Given token T and AbstractBounds ?L,R?, returns Pair(?L,T], (T,R?), where ? means that the same type of AbstractBounds is returned as the original. |
|
java.util.Set<Range<T>> |
subtract(Range<T> rhs)
|
|
AbstractBounds<RowPosition> |
toRowBounds()
Transform this abstract bounds to equivalent covering bounds of row positions. |
|
java.lang.String |
toString()
|
|
AbstractBounds<Token> |
toTokenBounds()
Transform this abstract bounds to a token abstract bounds. |
|
java.util.List<Range<T>> |
unwrap()
|
Methods inherited from class org.apache.cassandra.dht.AbstractBounds |
---|
getString, hashCode, intersects |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final long serialVersionUID
Constructor Detail |
---|
public Range(T left, T right)
public Range(T left, T right, IPartitioner partitioner)
Method Detail |
---|
public static <T extends RingPosition> boolean contains(T left, T right, T point)
public boolean contains(Range<T> that)
public boolean contains(T point)
contains
in class AbstractBounds<T extends RingPosition>
point
- point in question
public boolean intersects(Range<T> that)
that
- range to check for intersection
public boolean intersects(AbstractBounds<T> that)
public boolean intersects(Bounds<T> that)
that
- range to check for intersection
public static <T extends RingPosition> java.util.Set<Range<T>> rangeSet(Range<T>... ranges)
public static <T extends RingPosition> java.util.Set<Range<T>> rangeSet(Range<T> range)
public java.util.Set<Range<T>> intersectionWith(Range<T> that)
that
-
public Pair<AbstractBounds<T>,AbstractBounds<T>> split(T position)
AbstractBounds
split
in class AbstractBounds<T extends RingPosition>
public java.util.List<Range<T>> unwrap()
unwrap
in class AbstractBounds<T extends RingPosition>
public static <T extends RingPosition> boolean isWrapAround(T left, T right)
public int compareTo(Range<T> rhs)
compareTo
in interface java.lang.Comparable<Range<T extends RingPosition>>
public java.util.Set<Range<T>> subtract(Range<T> rhs)
public java.util.Set<Range<T>> differenceToFetch(Range<T> rhs)
rhs
- range to calculate difference
public static <T extends RingPosition> boolean isInRanges(T token, java.lang.Iterable<Range<T>> ranges)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String getOpeningString()
getOpeningString
in class AbstractBounds<T extends RingPosition>
protected java.lang.String getClosingString()
getClosingString
in class AbstractBounds<T extends RingPosition>
public java.util.List<java.lang.String> asList()
public boolean isWrapAround()
public static <T extends RingPosition> java.util.List<Range<T>> normalize(java.util.Collection<Range<T>> ranges)
public static Range<RowPosition> makeRowRange(Token left, Token right, IPartitioner partitioner)
public AbstractBounds<RowPosition> toRowBounds()
AbstractBounds
toRowBounds
in class AbstractBounds<T extends RingPosition>
public AbstractBounds<Token> toTokenBounds()
AbstractBounds
toTokenBounds
in class AbstractBounds<T extends RingPosition>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |