Exception thrown when a query attemps to create a keyspace or table that already exists.
Indicates an error during the authentication phase while connecting to a node.
A prepared statement with values bound to the bind variables.
Once a BoundStatement has values for all the variables of the PreparedStatement it has been created from, it can executed (through Session#execute).
The values of a BoundStatement can be set by either index or name. When setting them by name, names follow the case insensitivity rules explained in ColumnDefinitions. Noteworthily, if multiple bind variables correspond to the same column (as would be the case if you prepare
Helper class to build Cluster instances.
Additional options of the .net Cassandra driver.
Informations and known state of a Cassandra cluster.
This is the main entry point of the driver. A simple example of access to a Cassandra cluster would be:
Cluster cluster = Cluster.Builder.AddContactPoint("192.168.0.1").Build(); Session session = Cluster.Connect("db1"); foreach (var row in session.execute("SELECT * FROM table1")) //do something ...
A cluster object maintains a permanent connection to one of the cluster node that it uses solely to maintain informations on the state and current topology of the cluster. Using the connection, the driver will discover all the nodes composing the cluster as well as new nodes joining the cluster.
The configuration of the cluster. This handle setting:
A reconnection policy that waits a constant time between each reconnection attempt.
A data-center aware Round-robin load balancing policy.
This policy provides round-robin queries over the node of the local datacenter. It also includes in the query plans returned a configurable number of hosts in the remote datacenters, but those are always tried after the local nodes. In other words, this policy guarantees that no host in a remote datacenter will be queried unless no host in the local datacenter can be reached.
If used with a single datacenter, this policy is equivalent to the
The default retry policy.
This policy retries queries in only two cases:
This retry policy is conservative in that it will never retry with a different consistency level than the one of the initial operation.
In some cases, it may be convenient to use a more aggressive retry policy like DowngradingConsistencyRetryPolicy.
A retry policy that sometimes retry with a lower consistency level than the one initially requested.
BEWARE: This policy may retry queries using a lower consistency level than the one initially requested. By doing so, it may break consistency guarantees. In other words, if you use this retry policy, there is cases (documented below) where a read at
This policy : the same retries than the DefaultRetryPolicy policy. But on top of that, it also retries in the following cases:
The reasoning behing this retry policy is the following one. If, based on the information the Cassandra coordinator node returns, retrying the operation with the initally requested consistency has a change to succeed, do it. Otherwise, if based on these informations we know the initially requested consistency level cannot be achieve currently, then:
Top level class for exceptions thrown by the driver.
An unexpected error happened internally. This should never be raise and indicates a bug (either in the driver or in Cassandra).
A reconnection policy that waits exponentially longer between each reconnection attempt (but keeps a constant delay once a maximum delay is reached).
A retry policy that never retry (nor ignore).
All of the methods of this retry policy unconditionally return RetryPolicy.RetryDecision#rethrow. If this policy is used, retry will have to be implemented in business code.
A Cassandra node. This class keeps the informations the driver maintain on a given Cassandra node.
A specific invalid query exception that indicates that the query is invalid because of some configuration problem.
This is generally throw by query that manipulate the schema (CREATE and ALTER) when the required configuration options are invalid.
Indicates a syntactically correct but invalid query.
A retry policy that wraps another policy, logging the decision made by its sub-policy.
Note that this policy only log the Ignore and Retry decisions (since Rethrow decisions just amount to propate the cassandra exception). The logging is done at the Info level.
Keeps metadata on the connected cluster, including known nodes and schema definitions.
Exception thrown when a query cannot be performed because no host are available. This exception is thrown if
Policies configured for a Cluster instance.
Options related to connection pooling.
The driver uses connections in an asynchronous way. Meaning that multiple requests can be submitted on the same connection at the same time. This means that the driver only needs to maintain a relatively small number of connections to each Cassandra host. These options allow to control how many connections are kept exactly.
For each host, the driver keeps a core amount of connections open at all time (PoolingOptions#getCoreConnectionsPerHost). If the utilisation of those connections reaches a configurable threshold (PoolingOptions#getMaxSimultaneousRequestsPerConnectionTreshold), more connections are created up to a configurable maximum number of connections (PoolingOptions#getMaxConnectionPerHost). Once more than core connections have been created, connections in excess are reclaimed if the utilisation of opened connections drops below the configured threshold (PoolingOptions#getMinSimultaneousRequestsPerConnectionTreshold).
Each of these parameters can be separately set for
Represents a prepared statement, a query with bound variables that has been prepared (pre-parsed) by the database.
A prepared statement can be executed once concrete values has been provided for the bound variables. The pair of a prepared statement and values for its bound variables is a BoundStatement and can be executed (by Session#Execute).
Options of the Cassandra __native__ binary protocol.
An executable query.
This represents either a Statement or a BoundStatement along with the query options (consistency level, whether to trace the query, ...).
Exception related to the execution of a query. This correspond to the exception that Cassandra throw when a (valid) query cannot be executed (TimeoutException, UnavailableException, ...).
A Cassandra timeout during a query. Such an exception is returned when the query has been tried by Cassandra but cannot be achieved with the requested consistency level within the rpc timeout set for Cassandra.
A trace event.
A query trace is composed of a list of trace events.
An exception indicating that a query cannot be executed because it is incorrect syntactically, invalid, unauthorized or any other reason.
|ReadOnlyDictionary TKey, TValue|
A Cassandra timeout during a read query.
A Round-robin load balancing policy.
This policy queries nodes in a round-robin fashion. For a given query, if an host fail, the next one (following the round-robin order) is tried, until all hosts have been tried.
This policy is not datacenter aware and will include every known Cassandra host in its round robin algorithm. If you use multiple datacenter this will be inefficient and you will want to use the DCAwareRoundRobinPolicy load balancing policy instead.
This provider allows to programmatically define authentication information that will then apply to all hosts.
Note that it is not safe to add new info to this provider once a Cluster instance has been created using this provider.
Options to configure low-level socket options for the connections kept to the Cassandra hosts.
Indicates a syntax error in a query.
A wrapper load balancing policy that add token awareness to a child policy.
This policy encapsulates another policy. The resulting policy works in the following way:
Do note that only replica for which the child policy
Exception thrown if a query trace cannot be retrieved.
Error during a truncation operation.
Indicates that a query cannot be performed due to the authorisation restrictions of the logged user.
Exception thrown when the coordinator knows there is not enough replica alive to perform a query with the requested consistency level.
A Cassandra timeout during a write query.
Initializer for Cluster instances.
If you want to create a new
But it is also possible to implement a custom
The policy that decides which Cassandra hosts to contact for each new query. For efficiency purposes, the policy is expected to exclude down hosts from query plans.
Policy that decides how often the reconnection to a dead node is attempted. Each time a node is detected dead (because a connection error occurs), a new
Schedules reconnection attempts to a node.
A policy that defines a default behavior to adopt when a request returns a TimeoutException or an UnavailableException. Such policy allows to centralize the handling of query retries, allowing to minimize the need for exception catching/handling in business code.
Compression supported by the Cassandra binary protocol.
The type of retry decisions.