Package org.apache.cassandra.dht
Class AbstractBounds<T extends RingPosition<T>>
java.lang.Object
org.apache.cassandra.dht.AbstractBounds<T>
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Bounds,ExcludingBounds,IncludingExcludingBounds,Range
public abstract class AbstractBounds<T extends RingPosition<T>>
extends Object
implements Serializable
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classAbstractBounds.Boundary<T extends RingPosition<T>> -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal Tfinal Tstatic final IPartitionerDependentSerializer<AbstractBounds<PartitionPosition>>static final IPartitionerDependentSerializer<AbstractBounds<Token>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends RingPosition<T>>
AbstractBounds<T>bounds(AbstractBounds.Boundary<T> min, AbstractBounds.Boundary<T> max) static <T extends RingPosition<T>>
AbstractBounds<T>bounds(T min, boolean inclusiveMin, T max, boolean inclusiveMax) abstract booleanprotected abstract Stringprotected abstract StringgetString(AbstractType<?> keyValidator) inthashCode()abstract booleanabstract booleanbooleanintersects(Iterable<Range<T>> ranges) return true if @param range intersects any of the given @param rangesstatic <T extends RingPosition<T>>
booleanisEmpty(AbstractBounds.Boundary<T> left, AbstractBounds.Boundary<T> right) abstract booleanabstract booleanstatic <T extends RingPosition<T>>
AbstractBounds.Boundary<T>maxLeft(AbstractBounds.Boundary<T> left1, AbstractBounds.Boundary<T> left2) static <T extends RingPosition<T>>
AbstractBounds.Boundary<T>maxLeft(AbstractBounds.Boundary<T> left1, T left2, boolean isInclusiveLeft2) static <T extends RingPosition<T>>
AbstractBounds.Boundary<T>minRight(AbstractBounds.Boundary<T> right1, AbstractBounds.Boundary<T> right2) static <T extends RingPosition<T>>
AbstractBounds.Boundary<T>minRight(AbstractBounds.Boundary<T> right1, T right2, boolean isInclusiveRight2) static <T extends RingPosition<T>>
booleannoneStrictlyWrapsAround(Collection<AbstractBounds<T>> bounds) abstract Pair<AbstractBounds<T>,AbstractBounds<T>> 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.static <T extends RingPosition<T>>
booleanstrictlyWrapsAround(T left, T right) Whetherleftandrightforms a wrapping interval, that is if unwrapping wouldn't be a no-op.abstract List<? extends AbstractBounds<T>>unwrap()abstract AbstractBounds<T>withNewRight(T newRight)
-
Field Details
-
tokenSerializer
-
rowPositionSerializer
public static final IPartitionerDependentSerializer<AbstractBounds<PartitionPosition>> rowPositionSerializer -
left
-
right
-
-
Constructor Details
-
AbstractBounds
-
-
Method Details
-
split
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. 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. -
inclusiveLeft
public abstract boolean inclusiveLeft() -
inclusiveRight
public abstract boolean inclusiveRight() -
strictlyWrapsAround
Whetherleftandrightforms a wrapping interval, that is if unwrapping wouldn't be a no-op.Note that the semantic is slightly different from
Range.isWrapAround()in the sense that if bothrightare minimal (for the partitioner), this methods return false (doesn't wrap) whileRange.isWrapAround()returns true (does wrap). This is confusing and we should fix it by refactoring/rewriting the whole AbstractBounds hierarchy with cleaner semantics, but we don't want to risk breaking something by changingRange.isWrapAround()in the meantime. -
noneStrictlyWrapsAround
public static <T extends RingPosition<T>> boolean noneStrictlyWrapsAround(Collection<AbstractBounds<T>> bounds) -
hashCode
public int hashCode() -
intersects
return true if @param range intersects any of the given @param ranges -
contains
-
unwrap
-
getString
-
getOpeningString
-
getClosingString
-
isStartInclusive
public abstract boolean isStartInclusive() -
isEndInclusive
public abstract boolean isEndInclusive() -
withNewRight
-
bounds
public static <T extends RingPosition<T>> AbstractBounds<T> bounds(AbstractBounds.Boundary<T> min, AbstractBounds.Boundary<T> max) -
bounds
public static <T extends RingPosition<T>> AbstractBounds<T> bounds(T min, boolean inclusiveMin, T max, boolean inclusiveMax) -
leftBoundary
-
rightBoundary
-
isEmpty
public static <T extends RingPosition<T>> boolean isEmpty(AbstractBounds.Boundary<T> left, AbstractBounds.Boundary<T> right) -
minRight
public static <T extends RingPosition<T>> AbstractBounds.Boundary<T> minRight(AbstractBounds.Boundary<T> right1, T right2, boolean isInclusiveRight2) -
minRight
public static <T extends RingPosition<T>> AbstractBounds.Boundary<T> minRight(AbstractBounds.Boundary<T> right1, AbstractBounds.Boundary<T> right2) -
maxLeft
public static <T extends RingPosition<T>> AbstractBounds.Boundary<T> maxLeft(AbstractBounds.Boundary<T> left1, T left2, boolean isInclusiveLeft2) -
maxLeft
public static <T extends RingPosition<T>> AbstractBounds.Boundary<T> maxLeft(AbstractBounds.Boundary<T> left1, AbstractBounds.Boundary<T> left2)
-