public static interface Session.State
This mostly exposes information on the connections maintained by a Session: which host it is connected to, how many connection is has for each host, etc...
Modifier and Type | Method and Description |
---|---|
Collection<Host> |
getConnectedHosts()
The hosts to which the session is currently connected (more precisely, at the time
this State has been grabbed).
|
int |
getInFlightQueries(Host host)
The number of queries that are currently being executed though a given host.
|
int |
getOpenConnections(Host host)
The number of open connections to a given host.
|
Session |
getSession()
The Session to which this State corresponds to.
|
Session getSession()
Collection<Host> getConnectedHosts()
Please note that this method really returns the hosts for which the session currently
holds a connection pool. A such, it's unlikely but not impossible for a host to be listed
in the output of this method but to have getOpenConnections
return 0, if the
pool itself is created but not connections have been successfully opened yet.
int getOpenConnections(Host host)
host
- the host to get open connections for.host
. If the session
is not connected to that host, 0 is returned.int getInFlightQueries(Host host)
This correspond to the number of queries that have been sent (by the session this
is a State of) to the Cassandra Host on one of its connection but haven't yet returned.
In that sense this provide a sort of measure of how busy the connections to that node
are (at the time the State
was grabbed at least).
host
- the host to get in-flight queries for.host
.Copyright © 2014. All rights reserved.