Package org.apache.cassandra.dht
Class Bounds<T extends RingPosition<T>>
java.lang.Object
org.apache.cassandra.dht.AbstractBounds<T>
org.apache.cassandra.dht.Bounds<T>
- All Implemented Interfaces:
Serializable
AbstractBounds containing both its endpoints: [left, right]. Used by "classic" by-key range scans.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.cassandra.dht.AbstractBounds
AbstractBounds.AbstractBoundsSerializer<T extends RingPosition<T>>, AbstractBounds.Boundary<T extends RingPosition<T>> -
Field Summary
Fields inherited from class org.apache.cassandra.dht.AbstractBounds
left, right, rowPositionSerializer, tokenSerializer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanprotected Stringstatic <T extends RingPosition<T>>
Set<Bounds<T>>getNonOverlappingBounds(Iterable<Bounds<T>> bounds) Retrieves non-overlapping bounds for the list of input bounds Assume we have the following bounds (brackets representing left/right bound): [ ] [ ] [ ] [ ] [ ] [ ] This method will return the following bounds: [ ] [ ]protected Stringbooleanbooleanbooleanintersects(Bounds<T> that) booleanstatic <T extends RingPosition<T>>
booleanisInBounds(T token, Iterable<Bounds<T>> bounds) booleanstatic Bounds<PartitionPosition>makeRowBounds(Token left, Token right) Compute a bounds of keys corresponding to a given bounds of token.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.toString()List<? extends AbstractBounds<T>>unwrap()withNewRight(T newRight) Methods inherited from class org.apache.cassandra.dht.AbstractBounds
bounds, bounds, getString, hashCode, intersects, isEmpty, leftBoundary, maxLeft, maxLeft, minRight, minRight, noneStrictlyWrapsAround, rightBoundary, strictlyWrapsAround
-
Constructor Details
-
Bounds
-
-
Method Details
-
contains
- Specified by:
containsin classAbstractBounds<T extends RingPosition<T>>
-
split
Description copied from class:AbstractBoundsGiven 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. Put another way, returns a Pair of everything this AbstractBounds contains up to and including the split position, and everything it contains after (not including the split position). The original AbstractBounds must either contain the position T, or T should be equals to the left bound L. If the split would only yield the same AbstractBound, null is returned instead.- Specified by:
splitin classAbstractBounds<T extends RingPosition<T>>
-
inclusiveLeft
public boolean inclusiveLeft()- Specified by:
inclusiveLeftin classAbstractBounds<T extends RingPosition<T>>
-
inclusiveRight
public boolean inclusiveRight()- Specified by:
inclusiveRightin classAbstractBounds<T extends RingPosition<T>>
-
intersects
-
unwrap
- Specified by:
unwrapin classAbstractBounds<T extends RingPosition<T>>
-
equals
-
toString
-
getOpeningString
- Specified by:
getOpeningStringin classAbstractBounds<T extends RingPosition<T>>
-
getClosingString
- Specified by:
getClosingStringin classAbstractBounds<T extends RingPosition<T>>
-
isInBounds
-
isStartInclusive
public boolean isStartInclusive()- Specified by:
isStartInclusivein classAbstractBounds<T extends RingPosition<T>>
-
isEndInclusive
public boolean isEndInclusive()- Specified by:
isEndInclusivein classAbstractBounds<T extends RingPosition<T>>
-
makeRowBounds
Compute a bounds of keys corresponding to a given bounds of token. -
withNewRight
- Specified by:
withNewRightin classAbstractBounds<T extends RingPosition<T>>
-
getNonOverlappingBounds
public static <T extends RingPosition<T>> Set<Bounds<T>> getNonOverlappingBounds(Iterable<Bounds<T>> bounds) Retrieves non-overlapping bounds for the list of input bounds Assume we have the following bounds (brackets representing left/right bound): [ ] [ ] [ ] [ ] [ ] [ ] This method will return the following bounds: [ ] [ ]- Parameters:
bounds- unsorted bounds to find overlaps- Returns:
- the non-overlapping bounds
-