me.prettyprint.cassandra.connection
Class RoundRobinBalancingPolicy
java.lang.Object
me.prettyprint.cassandra.connection.RoundRobinBalancingPolicy
- All Implemented Interfaces:
- Serializable, LoadBalancingPolicy
public class RoundRobinBalancingPolicy
- extends Object
- implements LoadBalancingPolicy
Implements a RoundRobin balancing policy based off the contents
of the active HClientPool. If a pool is shutdown by another
thread in the midst of the selection process, we return the pool
at position 0
- Author:
- zznate
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RoundRobinBalancingPolicy
public RoundRobinBalancingPolicy()
getPool
public HClientPool getPool(Collection<HClientPool> pools,
Set<CassandraHost> excludeHosts)
- Description copied from interface:
LoadBalancingPolicy
- Retrieves a pool from the collection of
pools excluding excludeHosts.
- Specified by:
getPool in interface LoadBalancingPolicy
- Parameters:
pools - collection of all available poolsexcludeHosts - excluded pools
- Returns:
- a pool based on this load balancing policy
createConnection
public HClientPool createConnection(HClientFactory clientFactory,
CassandraHost host)
- Description copied from interface:
LoadBalancingPolicy
- Creates a connection pool for
host.
- Specified by:
createConnection in interface LoadBalancingPolicy
- Parameters:
clientFactory - an instance of HClientFactoryhost - an instance of CassandraHost representing the host this pool will represent
- Returns:
- a connection pool
Copyright © 2012. All Rights Reserved.