Describes a CQL aggregate.
Exception thrown when a query attemps to create a keyspace or table that already exists.
A timestamp generator that guarantees monotonically increasing timestamps among all client threads and logs warnings when timestamps drift in the future.
A timestamp generator that guarantees monotonically increasing timestamps among all client threads and logs warnings when timestamps drift in the future, using Win API high precision GetSystemTimePreciseAsFileTime() method call available in Windows 8+ and Windows Server 2012+.
Indicates an error during the authentication phase while connecting to a node.
Represents a prepared statement with the parameter values set, ready for execution.A BoundStatement can be created from a PreparedStatement instance using the
Bind()method and can be executed using a ISession instance. PreparedStatement
Helper class to build Cluster instances.
Represents a client-side error indicating that all connections to a certain host have reached the maximum amount of in-flight requests supported.
Additional options of the .net Cassandra driver.
Implementation of ICluster
Represents the information for a given data type
The configuration of the cluster. It configures the following:
- Cassandra binary protocol level configuration (compression).
- Connection pooling configurations.
- low-level tcp configuration options (tcpNoDelay, keepAlive, ...).
A reconnection policy that waits a constant time between each reconnection attempt.
A ISpeculativeExecutionPolicy that schedules a given number of speculative executions, separated by a fixed delay.
Describes a table or materialized view in Cassandra
A data-center aware Round-robin load balancing policy.
This policy provides round-robin queries over the node of the local datacenter. Currently, it also includes in the query plans returned a configurable number of hosts in the remote datacenters (which are always tried after the local nodes) but this functionality will be removed in the next major version of the driver. See the comments on DCAwareRoundRobinPolicy(String, Int32) for more information.
The default retry policy.
This policy retries queries in only two cases:
- On a read timeout, if enough replica replied but data was not retrieved.
- On a write timeout, if we timeout while writting the distributed log used by batch statements.
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.
Provides a set of methods and properties related to logging in the driver.
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 are cases (documented below) where a read at
Quorum may not see a preceding write at
Quorum. Do not use this policy unless you have understood the
cases where this can happen and are OK with that. It is also highly
recommended to always wrap this policy into LoggingRetryPolicy
to log the occurrences of such consistency break. This policy behaves in the
same way as the DefaultRetryPolicy policy, except for the
- On a read timeout: if the number of replica that responded is greater than one but lower than is required by the requested consistency level, the operation is retried at a lower consistency level.
- On a write timeout: if the operation is an
UNLOGGED_BATCHand at least one replica acknowledged the write, the operation is retried at a lower consistency level. Furthermore, for other operation, if at least one replica acknowledged the write, the timeout is ignored.
- On an unavailable exception: if at least one replica is alive, the operation is retried at a lower consistency level.
The reasoning behind this retry policy is the following one. If, based on the information the Cassandra coordinator node returns, retrying the operation with the initially 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:
- For writes, ignore the exception (thus silently failing the consistency requirement) if we know the write has been persisted on at least one replica.
- For reads, try reading at a lower consistency level (thus silently failing the consistency requirement).
In other words, this policy : the idea that if the requested consistency level cannot be achieved, the next best thing for writes is to make sure the data is persisted, and that reading something is better than reading nothing, even if there is a risk of reading stale data.
Top level class for exceptions thrown by the driver.
An unexpected error happened internally. This should never be raise and indicates an unexpected behavior (either in the driver or in Cassandra).
Information and known state of a DSE cluster.
This is the main entry point of the DSE driver. It extends the CQL driver's ICluster instance with DSE-specific features.
Helper class to build DseCluster instances.
Represents the configuration of a DseCluster.
A load balancing policy designed to run against DSE cluster.
For most executions, the query plan will be determined by the child load balancing policy. Except for some cases, like graph analytics queries, for which it uses the preferred analytics graph server previously obtained by driver as first host in the query plan.
An IAddressTranslator implementation for multi-region EC2 deployments where clients are also deployed in EC2 in order to optimizes network costs, as Amazon charges more for communication over public IPs.
Its distinctive feature is that it translates addresses according to the location of the server host:
- Addresses in different EC2 regions (than the client) are unchanged
- Addresses in the same EC2 region are translated to private IPs
Basic information on the execution of a query.
This provides the following information on the execution of a (successful) query:
- The list of Cassandra hosts tried in order (usually just one, unless a node has been tried but was dead/in error or a timeout provoked a retry (which depends on the RetryPolicy)).
- The consistency level achieved by the query (usually the one asked, though some specific RetryPolicy may allow this to be different).
- The query trace recorded by Cassandra if tracing had been set for the query.
A reconnection policy that waits exponentially longer between each reconnection attempt (but keeps a constant delay once a maximum delay is reached).
Provides C# extension methods for interfaces and classes within the root namespace.
A retry policy that never retry (nor ignore).
All of the methods of this retry policy unconditionally return Rethrow(). If this policy is used, retry will have to be implemented in business code.
Represents a reconnection policy that is possible to specify custom reconnection delays for each attempt.
Specifies a User defined function execution failure.
Describes a CQL function.
Represents a Cassandra node.
A retry policy that avoids retrying non-idempotent statements.
In case of write timeouts this policy will always return Rethrow() if the statement is considered non-idempotent (see IsIdempotent). For all other cases, this policy delegates the decision to the child policy.
A representation of a secondary index in Cassandra
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.
Exception that is thrown when the driver expected a type and other was provided
A date without a time-zone in the ISO-8601 calendar system. LocalDate is an immutable date-time object that represents a date, often viewed as year-month-day. This class is implemented to match the Date representation CQL string literals.
A time without a time-zone in the ISO-8601 calendar system, such as 10:30:05. LocalTime is an immutable date-time object that represents a time, often viewed as hour-minute-second. Time is represented to nanosecond precision. For example, the value "13:45.30.123456789" can be stored in a LocalTime.
Represents a driver Logger
A retry policy that wraps another policy, logging the decision made by its sub-policy.
Note that this policy only log the
Retry decisions (since
decisions just amount to propagate the cassandra exception). The logging is done at the
Describes a materialized view in Cassandra.
Keeps metadata on the connected cluster, including known nodes and schema definitions.
See the api reference for WithMetadataSyncOptions(MetadataSyncOptions) for an explanation of the Metadata synchronization feature. See the api reference for the properties of this class in order to know what the default values are.
Extension methods to integrate App.Metrics with the DataStax Enterprise C# Driver.
Options related to Monitor Reporting.
Exception thrown when a query cannot be performed because no host are available. This exception is thrown if
- either there is no host live in the cluster at the moment of the query
- all host that have been tried have failed due to a connection problem
A provider that provides no authentication capability.
This is only useful as a placeholder when no authentication is to be used.
A ISpeculativeExecutionPolicy that never schedules speculative executions.
Exception that thrown on a client-side timeout, when the client didn't hear back from the server within ReadTimeoutMillis.
A simple IAuthProvider implementation.
This provider allows to programmatically define authentication information that will then apply to all hosts. The PlainTextAuthenticator instances it returns support SASL authentication using the PLAIN mechanism for version 2 or above of the CQL native protocol.
Represents the policies configured for a ICluster instance.
Represents the options related to connection pooling.
For each host selected by the load balancing policy, the driver keeps a core amount of connections open at all times (GetCoreConnectionsPerHost(HostDistance)). If the use of those connections reaches a configurable threshold (GetMaxSimultaneousRequestsPerConnectionTreshold(HostDistance)), more connections are created up to the configurable maximum number of connections (GetMaxConnectionPerHost(HostDistance)).
The driver uses connections in an asynchronous manner and multiple requests can be submitted on the same connection at the same time without waiting for a response. This means that the driver only needs to maintain a relatively small number of connections to each Cassandra host. The PoolingOptions allows you to to control how many connections are kept per host.
The default amount of connections depend on the Cassandra version of the Cluster, as newer versions of Cassandra (2.1 and above) support a higher number of in-flight requests.
For Cassandra 2.1 and above, the default amount of connections per host are:
For older Cassandra versions (1.2 and 2.0), the default amount of connections per host are:
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).
This exception is thrown when the driver attempts to re-prepare a statement and the returned prepared statement's ID is different than the one on the existing PreparedStatement.
Options of the Cassandra native binary protocol.
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, ...).
Options related to defaults for individual queries.
A server timeout during a query. Such an exception is returned when the query has been tried by a server coordinator but cannot be achieved with the requested consistency level within the rpc timeout set at server level.
The Cassandra trace for a query.
The trace is generated by Cassandra when query tracing is enabled for the query. The trace itself is stored in
Cassandra in the
events table in the
system_traces keyspace and can be
retrieve manually using the trace identifier (the one returned by TraceId).
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.
A Server failure (non-timeout) during a read query.
A server timeout during a read query.
A non-prepared CQL statement. This class represents a query string along with query options. This class can be extended but SimpleStatement is provided to build a IStatement directly from its query string.
Provides utility methods to build replication strategies when creating a keyspace
Exception that indicates that the request is not valid.
A retry decision to adopt on a Cassandra exception (read/write timeout or unavailable exception).
There is three possible decision:
- Rethrow: no retry should be attempted and an exception should be thrown
- Retry: the operation will be retried. The consistency level of the retry should be specified.
- Ignore: no retry should be attempted and the exception should be ignored. In that case, the operation that triggered the Cassandra exception will return an empty result set.
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.
Routing key using to determine the node for each partition
Represents an CQL row
Represents the result of a query returned by the server.
The retrieval of the rows of a RowSet is generally paged (a first page of result is fetched and the next one is only fetched once all the results of the first page have been consumed). The size of the pages can be configured either globally through SetPageSize(Int32) or per-statement with SetPageSize(Int32). Though new pages are automatically and transparently fetched when needed, it is possible to force the retrieval of the next page early through FetchMoreResults() and FetchMoreResultsAsync().
The RowSet dequeues Row items while iterated. After a full enumeration of this instance, following enumerations will be empty, as all rows have been dequeued.
Represents the information of columns and other state values associated with a RowSet
A simple IStatement implementation built directly from a query string.
Options to configure low-level socket options for the connections kept to the Cassandra hosts.
Defines the SSL/TLS options to connect to a ssl enabled Cassandra host
Base class for statements that contains the options.
Indicates a syntax error in a query.
Represents a table column information
Describes a Cassandra table
A wrapper load balancing policy that adds token awareness to a child policy.
This policy encapsulates another policy. The resulting policy works in the following way:
Exception thrown if a query trace cannot be retrieved.
Error during a truncation operation.
Represents the information associated with a tuple column.
TypeAdapters are deprecated and will be removed in future versions. Use TypeSerializer<T> instead.
Backwards compatibility only.
Represents the type information associated with a User Defined Type
Represents a map between a user defined type in Cassandra and a .NET Type, with data on how to map field names in the UDT to .NET property names.
Represents a map between a UDT in Cassandra and a .NET Type, including data on how to map from UDT field names to Properties on the .NET Type.
Allows configuration of user defined types.
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.
The Unset class represents a unspecified value.
In Cassandra 2.2 and above, when executing a UPDATE or INSERT query, a parameter can be unset. Designed to avoid tombstones, setting a parameter value to Unset will make Cassandra to ignore it.
The Unset type is a singleton class, which means only one Unset object exists. The Unset.Value member represents the sole Unset object.
Represents a server-side failure (non-timeout) during a write query.
Represents a server timeout during a write operation.
Represents a duration. A duration stores separately months, days, and seconds due to the fact that the number of days in a month varies, and a day can have 23 or 25 hours if a daylight saving is involved.
Represents a v1 uuid
Translates IP addresses received from Cassandra nodes into locally queryable addresses.
Handles SASL authentication with Cassandra servers. A server which requires
authentication responds to a startup message with an challenge in the form of
AuthenticateMessage. Authenticator implementations should be
able to respond to that challenge and perform whatever authentication
negotiation is required by the server. The exact nature of that negotiation
is specific to the configuration of the server.
Provides IAuthenticator instances for use when connecting to Cassandra nodes. See PlainTextAuthProvider for an implementation which uses SASL PLAIN mechanism to authenticate using username/password strings.
Represents a IAuthProvider that is dependant on the name provided by Cassandra.
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.
Specifies the type information associated with collections, maps, udts and other Cassandra types
Represents a DSE cluster client that contains information and known state of a DSE cluster.
Represents an ISession suitable for querying a DataStax Enterprise (DSE) Cluster.
Session instances are designed to be long-lived, thread-safe and usually a single instance is enough per application.
An execution profile. See the documentation of WithExecutionProfiles(Action<IExecutionProfileOptions>) for an explanation on how to create these profiles and add them to the cluster.
You can use these profiles via their name (that is set when adding them to the cluster through WithExecutionProfiles(Action<IExecutionProfileOptions>)) with the multiple driver APIs that execute requests (LINQ, Mapper and Session). Example with ExecuteAsync(IStatement, String):
var rowSet = await session.ExecuteAsync(new SimpleStatement("SELECT * FROM keyspace.table"), "profile1").ConfigureAwait(false);
Builder that offers a fluent API to build execution profile instances.
Utility builder that is used to add Execution Profiles to a Cluster instance. See WithExecutionProfiles(Action<IExecutionProfileOptions>).
A policy that extends IRetryPolicy providing an additional method to handle unexpected errors.
Defines the methods for frame compression and decompression
Initializer for Cluster instances.
If you want to create a
Cluster instance programmatically, then it is advised to use
But it is also possible to
implement a custom
Initializer that retrieve initialization from
a web-service or from a configuration file for instance.
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
IReconnectionSchedule instance is created (through the
IReconnectionScheduleon that node will be cancelled and a new one will be created (in effect, the driver reset the scheduler). The default ExponentialReconnectionPolicy policy is usually adequate.
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.
A session holds connections to a Cassandra cluster, allowing it to be queried.
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.
Represents the state of a ISession.
Exposes information on the connections maintained by a Client at a specific time.
Represents a plan that governs speculative executions for a given query.
The policy that decides if the driver will send speculative queries to the next hosts when the current host takes too long to respond. only idempotent statements will be speculatively retried, see IsIdempotent for more information.
Represents client-side, microsecond-precision query timestamps.
Given that Apache Cassandra uses those timestamps to resolve conflicts, implementations should generate monotonically increasing timestamps for successive invocations of Next().
DEPRECATED, use TypeSerializer<T> instead. Represents a adapter to convert a Cassandra type to a CLR type.
The type of batch to use
Specifies a Cassandra data type of a field
Compression supported by the Cassandra binary protocol.
Consistency refers to how up-to-date and synchronized a row of Cassandra data is on all of its replicas. When selecting, the consistency level specifies how many replicas must respond to a read request before returning data to the client application. When updating, inserting or deleting the consistency level specifies the number of replicas on which the write must succeed before returning an acknowledgment to the client application.
Specifies sort order of the clustering keys
The distance assigned to a host influences how many connections the driver maintains towards this host.
Describes the possible kinds of indexes
Describes the type of key.
Specifies the different protocol versions and provides methods (via extension methods) to check whether a feature is supported in an specific version
The type of retry decisions.