ISession Interface |
Each session maintains multiple connections to the cluster nodes, provides policies to choose which node to use for each query (round-robin on all nodes of the cluster by default), and handles retries for failed query (when it makes sense), etc...
Session instances are thread-safe and usually a single instance is enough per application. However, a given session can only be set to one keyspace at a time, so one instance per keyspace is necessary.
Namespace: Dse
public interface ISession : IDisposable
The ISession type exposes the following members.
Name | Description | |
---|---|---|
BinaryProtocolVersion |
Gets the Cassandra native binary protocol version
| |
Cluster |
Gets the cluster information and state
| |
IsDisposed |
Determines if the object has been disposed.
| |
Keyspace |
Gets name of currently used keyspace.
| |
SessionName |
Session name. This will be autogenerated if it is not set with WithSessionName(String).
This is used as part of the metric bucket name, for example, which can be used to separate metric paths per session.
| |
UserDefinedTypes |
Gets the user defined type mappings
|
Name | Description | |
---|---|---|
BeginExecute(IStatement, AsyncCallback, Object) |
Begins asynchronous execute operation.
| |
BeginExecute(String, ConsistencyLevel, AsyncCallback, Object) |
Begins asynchronous execute operation
| |
BeginPrepare |
Begins asynchronous prepare operation
| |
ChangeKeyspace |
Switches to the specified keyspace.
| |
CreateKeyspace |
Creates new keyspace in current cluster.
| |
CreateKeyspaceIfNotExists |
Creates new keyspace in current cluster.
If keyspace with specified name already exists, then this method does nothing.
| |
DeleteKeyspace |
Deletes specified keyspace from current cluster.
If keyspace with specified name does not exist, then exception will be thrown.
| |
DeleteKeyspaceIfExists |
Deletes specified keyspace from current cluster.
If keyspace with specified name does not exist, then this method does nothing.
| |
EndExecute |
Ends asynchronous execute operation
| |
EndPrepare |
Ends asynchronous prepare operation
| |
Execute(String) |
Executes the provided query.
| |
Execute(IStatement) |
Executes the provided query.
| |
Execute(String, ConsistencyLevel) |
Executes the provided query.
| |
Execute(String, Int32) |
Executes the provided query.
| |
Execute(String, String) |
Executes the provided query with the provided execution profile.
The execution profile must have been added previously to the Cluster using WithExecutionProfiles(ActionIExecutionProfileOptions).
| |
Execute(IStatement, String) |
Executes the provided statement with the provided execution profile.
The execution profile must have been added previously to the Cluster using WithExecutionProfiles(ActionIExecutionProfileOptions).
| |
ExecuteAsync(IStatement) |
Executes a query asynchronously
| |
ExecuteAsync(IStatement, String) |
Executes a query asynchronously with the provided execution profile.
The execution profile must have been added previously to the Cluster using WithExecutionProfiles(ActionIExecutionProfileOptions).
| |
GetMetrics |
Retrieves the driver metrics for this session.
| |
Prepare(String) |
Prepares the provided query string.
| |
Prepare(String, IDictionaryString, Byte) |
Prepares the query string, sending the custom payload request.
| |
Prepare(String, String) |
Prepares the query on the provided keyspace.
| |
Prepare(String, String, IDictionaryString, Byte) |
Prepares the provided query string asynchronously on the provided keyspace, sending the custom payload
as part of the request.
| |
PrepareAsync(String) |
Prepares the provided query string asynchronously.
| |
PrepareAsync(String, IDictionaryString, Byte) |
Prepares the provided query string asynchronously, and sending the custom payload request.
| |
PrepareAsync(String, String) |
Prepares the query asynchronously on the provided keyspace.
| |
PrepareAsync(String, String, IDictionaryString, Byte) |
Prepares the provided query asynchronously on the provided keyspace, sending the custom payload
as part of the request.
| |
WaitForSchemaAgreement(IPEndPoint) | Obsolete. | |
WaitForSchemaAgreement(RowSet) | Obsolete. |
Name | Description | |
---|---|---|
CreateBatch | Overloaded. (Defined by SessionExtensions.) | |
CreateBatch(BatchType) | Overloaded. (Defined by SessionExtensions.) | |
GetState |
Gets a snapshot containing information on the connections pools held by this Client at the current time.
(Defined by Extensions.)The information provided in the returned object only represents the state at the moment this method was called and it's not maintained in sync with the driver metadata. | |
GetTableTEntity | Extension method used for backward-compatibility, use TableTEntity(ISession) constructor instead. Creates a new instance of the Linq IQueryProvider that represents a table in Cassandra using the mapping configuration provided. Fluent configuration or attributes can be used to define mapping information. |