Augments

  • LoadBalancingPolicy

Members

Array

localHostsArray

Constructor

new

DCAwareRoundRobinPolicy

([?String localDc])

A data-center aware Round-robin load balancing policy. This policy provides round-robin queries over the nodes of the local data center.

Parameters:
Name Type Description
localDc optional nullable String

local datacenter name. This value overrides the ‘localDataCenter’ Client option \ and is useful for cases where you have multiple execution profiles that you intend on using for routing requests to different data centers.

Methods

getDistance

(Host host)

Returns the distance depending on the datacenter.

Parameters:
Name Type Description
host Host

getOptions

()

Gets an associative array containing the policy options.

init

(Client client, HostMap hosts, function callback)

Initializes the load balancing policy.

Parameters:
Name Type Description
client Client
hosts HostMap
callback function

newQueryPlan

(String keyspace, ExecutionOptions or null executionOptions, function callback)

It returns an iterator that yields local nodes.

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.