Package org.apache.cassandra.locator
Class RangesAtEndpoint
java.lang.Object
org.apache.cassandra.locator.AbstractReplicaCollection<RangesAtEndpoint>
org.apache.cassandra.locator.RangesAtEndpoint
- All Implemented Interfaces:
Iterable<Replica>,ReplicaCollection<RangesAtEndpoint>
- Direct Known Subclasses:
RangesAtEndpoint.Builder
A ReplicaCollection for Ranges occurring at an endpoint. All Replica will be for the same endpoint,
and must be unique Ranges (though overlapping ranges are presently permitted, these should probably not be permitted to occur)
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.cassandra.locator.AbstractReplicaCollection
AbstractReplicaCollection.ReplicaList, AbstractReplicaCollection.ReplicaMap<K> -
Field Summary
Fields inherited from class org.apache.cassandra.locator.AbstractReplicaCollection
EMPTY_LIST, list -
Method Summary
Modifier and TypeMethodDescriptionstatic RangesAtEndpoint.Builderbuilder(InetAddressAndPort endpoint) static RangesAtEndpoint.Builderbuilder(InetAddressAndPort endpoint, int capacity) byRange()collector(InetAddressAndPort endpoint) static RangesAtEndpointconcat(RangesAtEndpoint replicas, RangesAtEndpoint extraReplicas) booleanbooleanstatic RangesAtEndpointstatic RangesAtEndpointempty(InetAddressAndPort endpoint) endpoint()static booleanisDummyList(RangesAtEndpoint ranges) newBuilder(int initialCapacity) construct a new Builder of our own type, so that we can concatenate TODO: this isn't terribly pretty, but we need sometimes to select / merge two Endpoints of unknown type;static RangesAtEndpointstatic RangesAtEndpointonlyFull()ranges()snapshot()protected RangesAtEndpointstatic RangesAtEndpointtoDummyList(Collection<Range<Token>> ranges) Use of this method to synthesize Replicas is almost always wrong.unwrap()Methods inherited from class org.apache.cassandra.locator.AbstractReplicaCollection
anyMatch, asList, collector, count, equals, filter, filter, filterLazily, filterLazily, forEach, get, hashCode, isEmpty, iterator, size, sorted, stream, subList, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
spliterator
-
Method Details
-
endpoint
-
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
- Returns:
- a set of all unique Ranges This method is threadsafe, though it is not synchronised
-
byRange
- Returns:
- a map of all Ranges, to their owning Replica instance This method is threadsafe, though it is not synchronised
-
snapshot
-
snapshot
- Specified by:
snapshotin classAbstractReplicaCollection<RangesAtEndpoint>
-
newBuilder
Description copied from class:AbstractReplicaCollectionconstruct a new Builder of our own type, so that we can concatenate TODO: this isn't terribly pretty, but we need sometimes to select / merge two Endpoints of unknown type;- Specified by:
newBuilderin classAbstractReplicaCollection<RangesAtEndpoint>
-
contains
- 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.
-
onlyFull
-
onlyTransient
-
contains
-
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
-
collector
public static Collector<Replica,RangesAtEndpoint.Builder, collectorRangesAtEndpoint> (InetAddressAndPort endpoint) -
builder
-
builder
-
empty
-
of
-
of
-
copyOf
-
toDummyList
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:
-
isDummyList
-
concat
- Returns:
- concatenate two DISJOINT collections together
-