File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -315,19 +315,21 @@ class TokenAwarePolicy(LoadBalancingPolicy):
315315 This alters the child policy's behavior so that it first attempts to
316316 send queries to :attr:`~.HostDistance.LOCAL` replicas (as determined
317317 by the child policy) based on the :class:`.Statement`'s
318- :attr:`~.Statement.routing_key`. Once those hosts are exhausted, the
319- remaining hosts in the child policy's query plan will be used.
318+ :attr:`~.Statement.routing_key`. If :attr:`.shuffle_replicas` is
319+ truthy, these replicas will be yielded in a random order. Once those
320+ hosts are exhausted, the remaining hosts in the child policy's query
321+ plan will be used in the order provided by the child policy.
320322
321323 If no :attr:`~.Statement.routing_key` is set on the query, the child
322324 policy's query plan will be used as is.
323-
324- If :attr:`.shuffle_replicas` is truthy, :attr:`~.HostDistance.LOCAL`
325- replicas will be yielded in a random order, followed by the remaining
326- hosts in the order provided child policy's query plan.
327325 """
328326
329327 _child_policy = None
330328 _cluster_metadata = None
329+ shuffle_replicas = False
330+ """
331+ Yield local replicas in a random order.
332+ """
331333
332334 def __init__ (self , child_policy , shuffle_replicas = False ):
333335 self ._child_policy = child_policy
You can’t perform that action at this time.
0 commit comments