abstract class Cassandra::LoadBalancing::Policy
- Abstract
- Actual load balancing policies don’t need to extend this class, only implement its methods. This class exists for documentation purposes only.
Inherits
Object
Direct Known Subclasses
Methods
setup
(cluster)Allows policy to initialize with the cluster instance. This method is called once before connecting to the cluster.
- Void
- Return value of this method is ignored.
teardown
(cluster)Allows policy to release any external resources it might be holding.
This method is called once the cluster has been terminated after calling
Cluster#close
- Void
- Return value of this method is ignored.
host_up
(host)host_down
(host)host_found
(host)host_lost
(host)distance
(host)Returns a distance that determines how many connections (if any) the driver will open to the host.
plan
(keyspace, statement, options)Load balancing plan is used to determine the order in which hosts should be tried in case of a network failure.
- Note
- Hosts that should be ignored, must not be included in the Plan
inspect
Returns a console-friendly representation of this policy