Class RangesAtEndpoint

    • Method Detail

      • endpoints

        public java.util.Set<InetAddressAndPort> endpoints()
        Returns:
        a Set of the endpoints of the contained Replicas. Iteration order is maintained where there is a 1:1 relationship between endpoint and Replica Typically this collection offers O(1) access methods, and this is true for all but ReplicaList.
      • ranges

        public java.util.Set<Range<Token>> ranges()
        Returns:
        a set of all unique Ranges This method is threadsafe, though it is not synchronised
      • byRange

        public java.util.Map<Range<Token>,​Replica> byRange()
        Returns:
        a map of all Ranges, to their owning Replica instance This method is threadsafe, though it is not synchronised
      • contains

        public boolean contains​(Replica replica)
        Returns:
        true iff a Replica in this collection is equal to the provided Replica. Typically this method is expected to take O(1) time, and this is true for all but ReplicaList.
      • contains

        public boolean contains​(Range<Token> range,
                                boolean isFull)
      • unwrap

        public RangesAtEndpoint unwrap()
        Returns:
        if there are no wrap around ranges contained in this RangesAtEndpoint, return self; otherwise, return a RangesAtEndpoint covering the same logical portions of the ring, but with those ranges unwrapped
      • toDummyList

        public static RangesAtEndpoint toDummyList​(java.util.Collection<Range<Token>> ranges)
        Use of this method to synthesize Replicas is almost always wrong. In repair it turns out the concerns of transient vs non-transient are handled at a higher level, but eventually repair needs to ask streaming to actually move the data and at that point it doesn't have a great handle on what the replicas are and it doesn't really matter. Streaming expects to be given Replicas with each replica indicating what type of data (transient or not transient) should be sent. So in this one instance we can lie to streaming and pretend all the replicas are full and use a dummy address and it doesn't matter because streaming doesn't rely on the address for anything other than debugging and full is a valid value for transientness because streaming is selecting candidate tables from the repair/unrepaired set already.
        Parameters:
        ranges -
        Returns: