Class Bounds<T extends RingPosition<T>>

  • All Implemented Interfaces:
    java.io.Serializable

    public class Bounds<T extends RingPosition<T>>
    extends AbstractBounds<T>
    AbstractBounds containing both its endpoints: [left, right]. Used by "classic" by-key range scans.
    See Also:
    Serialized Form
    • Constructor Detail

      • Bounds

        public Bounds​(T left,
                      T right)
    • Method Detail

      • split

        public Pair<AbstractBounds<T>,​AbstractBounds<T>> split​(T position)
        Description copied from class: AbstractBounds
        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.
        Specified by:
        split in class AbstractBounds<T extends RingPosition<T>>
      • intersects

        public boolean intersects​(Bounds<T> that)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isInBounds

        public static <T extends RingPosition<T>> boolean isInBounds​(T token,
                                                                     java.lang.Iterable<Bounds<T>> bounds)
      • makeRowBounds

        public static Bounds<PartitionPosition> makeRowBounds​(Token left,
                                                              Token right)
        Compute a bounds of keys corresponding to a given bounds of token.
      • getNonOverlappingBounds

        public static <T extends RingPosition<T>> java.util.Set<Bounds<T>> getNonOverlappingBounds​(java.lang.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