Package org.apache.cassandra.locator
Class EndpointsForToken
- java.lang.Object
-
- org.apache.cassandra.locator.AbstractReplicaCollection<E>
-
- org.apache.cassandra.locator.Endpoints<EndpointsForToken>
-
- org.apache.cassandra.locator.EndpointsForToken
-
- All Implemented Interfaces:
java.lang.Iterable<Replica>
,ReplicaCollection<EndpointsForToken>
- Direct Known Subclasses:
EndpointsForToken.Builder
public class EndpointsForToken extends Endpoints<EndpointsForToken>
A ReplicaCollection where all Replica are required to cover a range that fully contains the token() 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
EndpointsForToken.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 EndpointsForToken.Builder
builder(Token token)
static EndpointsForToken.Builder
builder(Token token, int capacity)
static EndpointsForToken
copyOf(Token token, java.util.Collection<Replica> replicas)
static EndpointsForToken
empty(Token token)
EndpointsForToken.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 EndpointsForToken
of(Token token, Replica replica)
static EndpointsForToken
of(Token token, Replica... replicas)
EndpointsForToken
snapshot()
protected EndpointsForToken
snapshot(AbstractReplicaCollection.ReplicaList newList)
Token
token()
-
Methods inherited from class org.apache.cassandra.locator.Endpoints
append, byEndpoint, concat, contains, endpointList, endpoints, keep, select, selfIfPresent, without, withoutSelf
-
Methods inherited from class org.apache.cassandra.locator.AbstractReplicaCollection
collector, count, equals, filter, filter, filterLazily, filterLazily, get, hashCode, isEmpty, iterator, size, sorted, stream, subList, toString
-
-
-
-
Method Detail
-
token
public Token token()
-
newBuilder
public EndpointsForToken.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<EndpointsForToken>
-
snapshot
public EndpointsForToken snapshot()
- Specified by:
snapshot
in classAbstractReplicaCollection<EndpointsForToken>
-
snapshot
protected EndpointsForToken snapshot(AbstractReplicaCollection.ReplicaList newList)
-
builder
public static EndpointsForToken.Builder builder(Token token)
-
builder
public static EndpointsForToken.Builder builder(Token token, int capacity)
-
empty
public static EndpointsForToken empty(Token token)
-
of
public static EndpointsForToken of(Token token, Replica replica)
-
of
public static EndpointsForToken of(Token token, Replica... replicas)
-
copyOf
public static EndpointsForToken copyOf(Token token, java.util.Collection<Replica> replicas)
-
-