Constructor

new

LoadBalancingPolicy

()

Base class for Load Balancing Policies

Methods

getDistance

(Host host)

Returns the distance assigned by this policy to the provided host.

Parameters:
Name Type Description
host Host

init

(Client client, HostMap hosts, function callback)

Initializes the load balancing policy, called after the driver obtained the information of the cluster.

Parameters:
Name Type Description
client Client
hosts HostMap
callback function

newQueryPlan

(String keyspace, queryOptions, function callback)

Returns an iterator with the hosts for a new query. Each new query will call this method. The first host in the result will then be used to perform the query.

Parameters:
Name Type Description
keyspace String

Name of the keyspace

queryOptions

options evaluated for this execution

callback function