me.prettyprint.cassandra.connection
Class ConcurrentHClientPool
java.lang.Object
me.prettyprint.cassandra.connection.ConcurrentHClientPool
- All Implemented Interfaces:
- HClientPool, PoolMetric
- Direct Known Subclasses:
- LatencyAwareHClientPool
public class ConcurrentHClientPool
- extends Object
- implements HClientPool
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConcurrentHClientPool
public ConcurrentHClientPool(CassandraHost host)
borrowClient
public HThriftClient borrowClient()
throws HectorException
- Specified by:
borrowClient
in interface HClientPool
- Throws:
HectorException
shutdown
public void shutdown()
- Controlled shutdown of pool. Go through the list of available clients
in the queue and call
HThriftClient.close()
on each. Toggles
a flag to indicate we are going into shutdown mode. Any subsequent calls
will throw an IllegalArgumentException.
- Specified by:
shutdown
in interface HClientPool
getCassandraHost
public CassandraHost getCassandraHost()
- Specified by:
getCassandraHost
in interface HClientPool
getName
public String getName()
- Specified by:
getName
in interface PoolMetric
getNumActive
public int getNumActive()
- Specified by:
getNumActive
in interface PoolMetric
getNumBeforeExhausted
public int getNumBeforeExhausted()
- Specified by:
getNumBeforeExhausted
in interface HClientPool
getNumBlockedThreads
public int getNumBlockedThreads()
- Specified by:
getNumBlockedThreads
in interface PoolMetric
getNumIdle
public int getNumIdle()
- Specified by:
getNumIdle
in interface PoolMetric
isExhausted
public boolean isExhausted()
- Specified by:
isExhausted
in interface HClientPool
getMaxActive
public int getMaxActive()
- Specified by:
getMaxActive
in interface HClientPool
getIsActive
public boolean getIsActive()
- Specified by:
getIsActive
in interface PoolMetric
getStatusAsString
public String getStatusAsString()
- Specified by:
getStatusAsString
in interface HClientPool
releaseClient
public void releaseClient(HThriftClient client)
throws HectorException
- Specified by:
releaseClient
in interface HClientPool
- Throws:
HectorException
Copyright © 2011. All Rights Reserved.