me.prettyprint.cassandra.connection
Interface LoadBalancingPolicy

All Superinterfaces:
Serializable
All Known Implementing Classes:
DynamicLoadBalancingPolicy, LeastActiveBalancingPolicy, RoundRobinBalancingPolicy

public interface LoadBalancingPolicy
extends Serializable

Default interface for all load balancing policies.


Method Summary
 HClientPool createConnection(HClientFactory clientFactory, CassandraHost host)
          Creates a connection pool for host.
 HClientPool getPool(Collection<HClientPool> pools, Set<CassandraHost> excludeHosts)
          Retrieves a pool from the collection of pools excluding excludeHosts.
 

Method Detail

getPool

HClientPool getPool(Collection<HClientPool> pools,
                    Set<CassandraHost> excludeHosts)
Retrieves a pool from the collection of pools excluding excludeHosts.

Parameters:
pools - collection of all available pools
excludeHosts - excluded pools
Returns:
a pool based on this load balancing policy

createConnection

HClientPool createConnection(HClientFactory clientFactory,
                             CassandraHost host)
Creates a connection pool for host.

Parameters:
clientFactory - an instance of HClientFactory
host - an instance of CassandraHost representing the host this pool will represent
Returns:
a connection pool


Copyright © 2012. All Rights Reserved.