Enum TokenAwarePolicy.ReplicaOrdering

    • Enum Constant Detail

      • TOPOLOGICAL

        public static final TokenAwarePolicy.ReplicaOrdering TOPOLOGICAL
        Order replicas by token ring topology, i.e. always return the "primary" replica first, then the second, etc., according to the placement of replicas around the token ring.

        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.

      • RANDOM

        public static final TokenAwarePolicy.ReplicaOrdering RANDOM
        Return replicas in a different, random order for each query plan. This is the default strategy.

        This strategy fans out writes and thus can alleviate hotspots caused by "fat" partitions, but its randomness makes server-side caching less efficient.

      • NEUTRAL

        public static final TokenAwarePolicy.ReplicaOrdering NEUTRAL
        Return the replicas in the exact same order in which they appear in the child policy's query plan.

        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).

    • Method Detail

      • values

        public static TokenAwarePolicy.ReplicaOrdering[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (TokenAwarePolicy.ReplicaOrdering c : TokenAwarePolicy.ReplicaOrdering.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static TokenAwarePolicy.ReplicaOrdering valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null