public static enum TokenAwarePolicy.ReplicaOrdering extends Enum<TokenAwarePolicy.ReplicaOrdering>
Enum Constant and Description |
---|
NEUTRAL
Return the replicas in the exact same order in which they appear in the child policy's query
plan.
|
RANDOM
Return replicas in a different, random order for each query plan.
|
TOPOLOGICAL
Order replicas by token ring topology, i.e.
|
Modifier and Type | Method and Description |
---|---|
static TokenAwarePolicy.ReplicaOrdering |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static TokenAwarePolicy.ReplicaOrdering[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final TokenAwarePolicy.ReplicaOrdering TOPOLOGICAL
This strategy is the only one guaranteed to order replicas in a deterministic and constant way. This increases the effectiveness of server-side row caching (especially at consistency level ONE), but is more heavily impacted by hotspots, since the primary replica is always tried first.
public static final TokenAwarePolicy.ReplicaOrdering RANDOM
This strategy fans out writes and thus can alleviate hotspots caused by "fat" partitions, but its randomness makes server-side caching less efficient.
public static final TokenAwarePolicy.ReplicaOrdering NEUTRAL
This is the only strategy that fully respects the child policy's replica ordering. Use it
when it is important to keep that order intact (e.g. when using the LatencyAwarePolicy
).
public static TokenAwarePolicy.ReplicaOrdering[] values()
for (TokenAwarePolicy.ReplicaOrdering c : TokenAwarePolicy.ReplicaOrdering.values()) System.out.println(c);
public static TokenAwarePolicy.ReplicaOrdering valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2012–2018. All rights reserved.