Interface ISessionState
Represents the state of a ISession.
Exposes information on the connections maintained by a Client at a specific time.
Namespace: Cassandra
Assembly: Cassandra.dll
Syntax
public interface ISessionState
Methods
GetConnectedHosts()
The hosts to which the ISession is connected to, at the time this state was obtained.
Please note that this method really returns the hosts for which the session currently holds a connection pool. As such, it's unlikely but not impossible for a host to be listed in the output of this method but to have GetOpenConnections(Host) return 0, if the pool itself is created but no connections have been successfully opened yet.
Declaration
IReadOnlyCollection<Host> GetConnectedHosts()
Returns
Type | Description |
---|---|
IReadOnlyCollection<Host> |
GetInFlightQueries(Host)
The number of queries that are currently being executed through a given host.
This corresponds to the number of queries that have been sent (by the session this is a State of) to the server Host on one of its connections but haven't yet returned. In that sense this provides a sort of measure of how busy the connections to that node are (at the time the state was obtained at least).
Declaration
int GetInFlightQueries(Host host)
Parameters
Type | Name | Description |
---|---|---|
Host | host | The host to get in-flight queries for. |
Returns
Type | Description |
---|---|
int | The number of executing queries to Host at the time the state was obtained. |
GetOpenConnections(Host)
The number of open connections to a given host.
Declaration
int GetOpenConnections(Host host)
Parameters
Type | Name | Description |
---|---|---|
Host | host | The host to get open connections for. |
Returns
Type | Description |
---|---|
int | The number of open connections to {@code host}. If the session is not connected to that host, 0 is returned. |