Package org.apache.cassandra.locator
Class EndpointsForRange
- java.lang.Object
-
- org.apache.cassandra.locator.AbstractReplicaCollection<E>
-
- org.apache.cassandra.locator.Endpoints<EndpointsForRange>
-
- org.apache.cassandra.locator.EndpointsForRange
-
- All Implemented Interfaces:
java.lang.Iterable<Replica>
,ReplicaCollection<EndpointsForRange>
- Direct Known Subclasses:
EndpointsForRange.Builder
public class EndpointsForRange extends Endpoints<EndpointsForRange>
A ReplicaCollection where all Replica are required to cover a range that fully contains the range() defined in the builder(). Endpoints are guaranteed to be unique; on construction, this is enforced unless optionally silenced (in which case only the first occurrence makes the cut).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EndpointsForRange.Builder
-
Nested 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EndpointsForRange.Builder
builder(Range<Token> range)
static EndpointsForRange.Builder
builder(Range<Token> range, int capacity)
static EndpointsForRange
copyOf(java.util.Collection<Replica> replicas)
static EndpointsForRange
empty(Range<Token> range)
EndpointsForToken
forToken(Token token)
EndpointsForRange.Builder
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 EndpointsForRange
of(Replica replica)
static EndpointsForRange
of(Replica... replicas)
Range<Token>
range()
EndpointsForRange
snapshot()
-
Methods inherited from class org.apache.cassandra.locator.Endpoints
append, byEndpoint, concat, contains, contains, endpoint, endpointList, endpoints, keep, select, selfIfPresent, without, withoutSelf
-
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, toString
-
-
-
-
Method Detail
-
newBuilder
public EndpointsForRange.Builder newBuilder(int initialCapacity)
Description copied from class:AbstractReplicaCollection
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;- Specified by:
newBuilder
in classAbstractReplicaCollection<EndpointsForRange>
-
forToken
public EndpointsForToken forToken(Token token)
-
snapshot
public EndpointsForRange snapshot()
- Specified by:
snapshot
in classAbstractReplicaCollection<EndpointsForRange>
-
builder
public static EndpointsForRange.Builder builder(Range<Token> range)
-
builder
public static EndpointsForRange.Builder builder(Range<Token> range, int capacity)
-
empty
public static EndpointsForRange empty(Range<Token> range)
-
of
public static EndpointsForRange of(Replica replica)
-
of
public static EndpointsForRange of(Replica... replicas)
-
copyOf
public static EndpointsForRange copyOf(java.util.Collection<Replica> replicas)
-
-