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

getOptions

()

Gets an associative array containing the policy options.

newQueryPlan

(String keyspace, ExecutionOptions or null executionOptions, 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.

executionOptions ExecutionOptions or null

The information related to the execution of the request.

callback function

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