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 classEndpointsForToken.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.Builderbuilder(Token token)static EndpointsForToken.Builderbuilder(Token token, int capacity)static EndpointsForTokencopyOf(Token token, java.lang.Iterable<Replica> replicas)static EndpointsForTokencopyOf(Token token, java.util.Collection<Replica> replicas)static EndpointsForTokenempty(Token token)Replicalookup(InetAddressAndPort endpoint)static EndpointsForTokennatural(Keyspace keyspace, Token token)static EndpointsForTokennatural(AbstractReplicationStrategy replicationStrategy, Token token)static EndpointsForTokennatural(TableMetadata table, Token token)EndpointsForToken.BuildernewBuilder(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 EndpointsForTokenof(Token token, Replica replica)static EndpointsForTokenof(Token token, Replica... replicas)static EndpointsForTokenpending(java.lang.String keyspace, Token token)static EndpointsForTokenpending(Keyspace keyspace, Token token)static EndpointsForTokenpending(TableMetadata table, Token token)EndpointsForTokensnapshot()protected EndpointsForTokensnapshot(AbstractReplicaCollection.ReplicaList newList)Tokentoken()-
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
-
token
public Token token()
-
newBuilder
public EndpointsForToken.Builder newBuilder(int initialCapacity)
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<EndpointsForToken>
-
snapshot
public EndpointsForToken snapshot()
- Specified by:
snapshotin classAbstractReplicaCollection<EndpointsForToken>
-
snapshot
protected EndpointsForToken snapshot(AbstractReplicaCollection.ReplicaList newList)
-
lookup
public Replica lookup(InetAddressAndPort endpoint)
-
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)
-
copyOf
public static EndpointsForToken copyOf(Token token, java.lang.Iterable<Replica> replicas)
-
natural
public static EndpointsForToken natural(Keyspace keyspace, Token token)
-
natural
public static EndpointsForToken natural(AbstractReplicationStrategy replicationStrategy, Token token)
-
natural
public static EndpointsForToken natural(TableMetadata table, Token token)
-
pending
public static EndpointsForToken pending(TableMetadata table, Token token)
-
pending
public static EndpointsForToken pending(Keyspace keyspace, Token token)
-
pending
public static EndpointsForToken pending(java.lang.String keyspace, Token token)
-
-