Augments

  • LoadBalancingPolicy

Constructor

new

TokenAwarePolicy

(LoadBalancingPolicy childPolicy)

A wrapper load balancing policy that add token awareness to a child policy.

Parameters:
Name Type Description
childPolicy LoadBalancingPolicy

Methods

newQueryPlan

(String keyspace, QueryOptions queryOptions, function callback)

Returns the hosts to use for a new query. The returned plan will return local replicas first, if replicas can be determined, followed by the plan of the child policy.

Parameters:
Name Type Description
keyspace String

Name of currently logged keyspace at Client level.

queryOptions QueryOptions

Options related to this query execution.

callback function

The function to be invoked with the error as first parameter and the host iterator as second parameter.