public class HConnectionManager extends Object
| Constructor and Description |
|---|
HConnectionManager(String clusterName,
CassandraHostConfigurator cassandraHostConfigurator) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addCassandraHost(CassandraHost cassandraHost)
Returns true if the host was successfully added.
|
void |
addListener(String listenerName,
ConnectionManagerListener listener)
adds a listener in order to execute some operations when a status of a host changes
|
long |
createClock() |
void |
doAddNodes() |
Collection<HClientPool> |
getActivePools() |
String |
getClusterName() |
Set<CassandraHost> |
getDownedHosts() |
Set<CassandraHost> |
getHosts() |
List<String> |
getStatusPerPool() |
Set<CassandraHost> |
getSuspendedCassandraHosts()
Returns a Set of
CassandraHost which are in the suspended status |
HOpTimer |
getTimer() |
void |
operateWithFailover(Operation<?> op) |
void |
removeAllListeners()
removes all listeners from the connectionManager
|
boolean |
removeCassandraHost(CassandraHost cassandraHost)
Remove the
CassandraHost from the pool, bypassing retry service. |
void |
removeListener(String listenerName)
removes a listener from the connectionManager
|
void |
setCassandraHostRetryDelay(int retryDelay) |
void |
setTimer(HOpTimer timer) |
void |
shutdown() |
boolean |
suspendCassandraHost(CassandraHost cassandraHost)
Remove the
HClientPool referenced by the CassandraHost from
the active host pools. |
boolean |
unsuspendCassandraHost(CassandraHost cassandraHost)
The opposite of suspendCassandraHost, places the pool back into selection
|
public HConnectionManager(String clusterName, CassandraHostConfigurator cassandraHostConfigurator)
public void doAddNodes()
public boolean addCassandraHost(CassandraHost cassandraHost)
cassandraHost - public boolean removeCassandraHost(CassandraHost cassandraHost)
CassandraHost from the pool, bypassing retry service. This
would be called on a host that is known to be going away. Gracefully shuts down
the underlying connections via HClientPool.shutdown(). This method
will also:
CassandraHostRetryService if contained thereincassandraHost - public boolean suspendCassandraHost(CassandraHost cassandraHost)
HClientPool referenced by the CassandraHost from
the active host pools. This does not shut down the pool, only removes it as a candidate from
future operations.cassandraHost - public boolean unsuspendCassandraHost(CassandraHost cassandraHost)
cassandraHost - public Set<CassandraHost> getSuspendedCassandraHosts()
CassandraHost which are in the suspended statuspublic Set<CassandraHost> getHosts()
public void operateWithFailover(Operation<?> op) throws HectorException
HectorExceptionpublic HOpTimer getTimer()
public void setTimer(HOpTimer timer)
public void addListener(String listenerName, ConnectionManagerListener listener)
listenerName - - a name identifier for the listenerlistener - - a ConnectionManagerListener listenerpublic void removeListener(String listenerName)
listenerName - - the name of the listener to removepublic void removeAllListeners()
public Set<CassandraHost> getDownedHosts()
public Collection<HClientPool> getActivePools()
public long createClock()
public String getClusterName()
public void shutdown()
public void setCassandraHostRetryDelay(int retryDelay)
Copyright © 2014. All Rights Reserved.