Class: LoadBalancingPolicy

policies/loadBalancing~ LoadBalancingPolicy

Constructor

new LoadBalancingPolicy()

Base class for Load Balancing Policies

Methods

getDistance(host)

Returns the distance assigned by this policy to the provided host.
Parameters:
Name Type Description
host Host

init(client, hosts, 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(keyspace, queryOptions, 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