From 7616fbb9f66a7ff937e523151601e65c1eddb357 Mon Sep 17 00:00:00 2001 From: Jim Witschey Date: Thu, 19 Jan 2017 16:59:46 -0500 Subject: [PATCH] small documentation improvement --- cassandra/policies.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cassandra/policies.py b/cassandra/policies.py index 5b325bfd..9be0125f 100644 --- a/cassandra/policies.py +++ b/cassandra/policies.py @@ -315,19 +315,21 @@ class TokenAwarePolicy(LoadBalancingPolicy): This alters the child policy's behavior so that it first attempts to send queries to :attr:`~.HostDistance.LOCAL` replicas (as determined by the child policy) based on the :class:`.Statement`'s - :attr:`~.Statement.routing_key`. Once those hosts are exhausted, the - remaining hosts in the child policy's query plan will be used. + :attr:`~.Statement.routing_key`. If :attr:`.shuffle_replicas` is + truthy, these replicas will be yielded in a random order. Once those + hosts are exhausted, the remaining hosts in the child policy's query + plan will be used in the order provided by the child policy. If no :attr:`~.Statement.routing_key` is set on the query, the child policy's query plan will be used as is. - - If :attr:`.shuffle_replicas` is truthy, :attr:`~.HostDistance.LOCAL` - replicas will be yielded in a random order, followed by the remaining - hosts in the order provided child policy's query plan. """ _child_policy = None _cluster_metadata = None + shuffle_replicas = False + """ + Yield local replicas in a random order. + """ def __init__(self, child_policy, shuffle_replicas=False): self._child_policy = child_policy