Class: TokenAwarePolicy

policies/loadBalancing~ TokenAwarePolicy

Constructor

new TokenAwarePolicy(childPolicy)

A wrapper load balancing policy that add token awareness to a child policy.
Parameters:
Name Type Description
childPolicy LoadBalancingPolicy

Extends

  • LoadBalancingPolicy

Methods

newQueryPlan(keyspace, queryOptions, callback)

Returns the hosts to use for a new query. The returned plan will first return replicas (whose HostDistance for the child policy is local) for the query if it can determine them is not. Following what it will return the plan of the child policy.
Parameters:
Name Type Description
keyspace String Name of the keyspace
queryOptions
callback function