Namespace Dse
Classes
AggregateMetadata
Describes a CQL aggregate.
AlreadyExistsException
Exception thrown when a query attemps to create a keyspace or table that already exists.
AtomicMonotonicTimestampGenerator
A timestamp generator that guarantees monotonically increasing timestamps among all client threads and logs warnings when timestamps drift in the future.
AtomicMonotonicWinApiTimestampGenerator
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+.
AuthenticationException
Indicates an error during the authentication phase while connecting to a node.
BatchStatement
A statement that groups a number of BoundStatement and / or SimpleStatement so they get executed as a batch.
BigIntegerTypeAdapter
BoundStatement
Represents a prepared statement with the parameter values set, ready for execution.
A BoundStatement can be created from a PreparedStatement instance using theBind()
method and can be executed using a ISession instance.
PreparedStatement
Builder
Helper class to build Cluster instances.
BusyPoolException
Represents a client-side error indicating that all connections to a certain host have reached the maximum amount of in-flight requests supported.
CassandraConnectionStringBuilder
ClientOptions
Additional options of the .net Cassandra driver.
Cluster
Implementation of ICluster
ColumnDesc
Represents the information for a given data type
Configuration
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, ...).
ConstantReconnectionPolicy
A reconnection policy that waits a constant time between each reconnection attempt.
ConstantSpeculativeExecutionPolicy
A ISpeculativeExecutionPolicy that schedules a given number of speculative executions, separated by a fixed delay.
CqlColumn
CustomColumnInfo
DataCollectionMetadata
Describes a table or materialized view in Cassandra
DCAwareRoundRobinPolicy
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.
DecimalTypeAdapter
DefaultRetryPolicy
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.
Diagnostics
Provides a set of methods and properties related to logging in the driver.
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 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
following cases:
- 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_BATCH
and 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.
DriverException
Top level class for exceptions thrown by the driver.
DriverInternalError
An unexpected error happened internally. This should never be raise and indicates an unexpected behavior (either in the driver or in Cassandra).
DseCluster
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.
DseClusterBuilder
Helper class to build DseCluster instances.
DseConfiguration
Represents the configuration of a DseCluster.
DseLoadBalancingPolicy
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.
DynamicCompositeTypeAdapter
EC2MultiRegionTranslator
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
ExecutionException
ExecutionInfo
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.
ExponentialReconnectionPolicy
A reconnection policy that waits exponentially longer between each reconnection attempt (but keeps a constant delay once a maximum delay is reached).
Extensions
Provides C# extension methods for interfaces and classes within the root namespace.
FallthroughRetryPolicy
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.
FixedReconnectionPolicy
Represents a reconnection policy that is possible to specify custom reconnection delays for each attempt.
FunctionFailureException
Specifies a User defined function execution failure.
FunctionMetadata
Describes a CQL function.
Host
Represents a Cassandra node.
HostsEventArgs
IdempotenceAwareRetryPolicy
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.
IndexMetadata
A representation of a secondary index in Cassandra
InvalidConfigurationInQueryException
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.
InvalidQueryException
Indicates a syntactically correct but invalid query.
InvalidTypeException
Exception that is thrown when the driver expected a type and other was provided
IsBootstrappingException
KeyspaceMetadata
ListColumnInfo
LocalDate
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.
LocalTime
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.
Logger
Represents a driver Logger
LoggingRetryPolicy
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 propagate the cassandra exception). The logging is done at the Info
level.
MapColumnInfo
MaterializedViewMetadata
Describes a materialized view in Cassandra.
Metadata
Keeps metadata on the connected cluster, including known nodes and schema definitions.
MetadataSyncOptions
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.
MetricsExtensions
Extension methods to integrate App.Metrics with the DataStax Enterprise C# Driver.
MonitorReportingOptions
Options related to Monitor Reporting.
NoHostAvailableException
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
NoneAuthProvider
A provider that provides no authentication capability.
This is only useful as a placeholder when no authentication is to be used.
NoSpeculativeExecutionPolicy
A ISpeculativeExecutionPolicy that never schedules speculative executions.
NullTypeAdapter
OperationTimedOutException
Exception that thrown on a client-side timeout, when the client didn't hear back from the server within ReadTimeoutMillis.
OverloadedException
PlainTextAuthProvider
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.
Policies
Represents the policies configured for a ICluster instance.
PoolingOptions
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.
Each of these parameters can be separately set for Local and Remote hosts. For Ignored hosts, the default for all those settings is 0 and cannot be changed.
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:
PreparedQueryNotFoundException
PreparedStatement
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).
PreparedStatementIdMismatchException
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.
When this exception is thrown, it means that the PreparedStatement object with the ID that matches Id should not be used anymore.
ProtocolErrorException
ProtocolOptions
Options of the Cassandra native binary protocol.
QueryExecutionException
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, ...).
QueryOptions
Options related to defaults for individual queries.
QueryProtocolOptions
QueryTimeoutException
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.
QueryTrace
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 sessions
and events
table in the system_traces
keyspace and can be
retrieve manually using the trace identifier (the one returned by TraceId).
QueryTrace.Event
A trace event.
A query trace is composed of a list of trace events.
QueryValidationException
An exception indicating that a query cannot be executed because it is incorrect syntactically, invalid, unauthorized or any other reason.
ReadFailureException
A Server failure (non-timeout) during a read query.
ReadTimeoutException
A server timeout during a read query.
RegularStatement
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.
ReplicationStrategies
Provides utility methods to build replication strategies when creating a keyspace
RequestInvalidException
Exception that indicates that the request is not valid.
RetryDecision
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.
RetryLoadBalancingPolicy
RetryLoadBalancingPolicyEventArgs
RoundRobinPolicy
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.
RoutingKey
Routing key using to determine the node for each partition
Row
Represents an CQL row
RowSet
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.
RowSetMetadata
Represents the information of columns and other state values associated with a RowSet
SchemaChangedEventArgs
ServerErrorException
Session
SetColumnInfo
SimpleStatement
A simple IStatement implementation built directly from a query string.
SocketOptions
Options to configure low-level socket options for the connections kept to the Cassandra hosts.
SSLOptions
Defines the SSL/TLS options to connect to a ssl enabled Cassandra host
Statement
Base class for statements that contains the options.
SyntaxError
Indicates a syntax error in a query.
TableColumn
Represents a table column information
TableMetadata
Describes a Cassandra table
TableOptions
TokenAwarePolicy
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:
ToManyConnectionsPerHost
TraceRetrievalException
Exception thrown if a query trace cannot be retrieved.
TruncateException
Error during a truncation operation.
TupleColumnInfo
Represents the information associated with a tuple column.
TypeAdapters
TypeAdapters are deprecated and will be removed in future versions. Use TypeSerializer<T> instead.
Backwards compatibility only.
UdtColumnInfo
Represents the type information associated with a User Defined Type
UdtMap
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.
UdtMap<T>
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.
UdtMappingDefinitions
Allows configuration of user defined types.
UnauthorizedException
Indicates that a query cannot be performed due to the authorisation restrictions of the logged user.
UnavailableException
Exception thrown when the coordinator knows there is not enough replica alive to perform a query with the requested consistency level.
Unset
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.
WriteFailureException
Represents a server-side failure (non-timeout) during a write query.
WriteTimeoutException
Represents a server timeout during a write operation.
Structs
Duration
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.
TimeUuid
Represents a v1 uuid
Interfaces
IAddressTranslator
Translates IP addresses received from Cassandra nodes into locally queryable addresses.
IAuthenticator
Handles SASL authentication with Cassandra servers. A server which requires
authentication responds to a startup message with an challenge in the form of
an 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.
IAuthProvider
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.
IAuthProviderNamed
Represents a IAuthProvider that is dependant on the name provided by Cassandra.
ICluster
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.
IColumnInfo
Specifies the type information associated with collections, maps, udts and other Cassandra types
IDseCluster
Represents a DSE cluster client that contains information and known state of a DSE cluster.
IDseSession
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.
IExecutionProfile
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);
IExecutionProfileBuilder
Builder that offers a fluent API to build execution profile instances.
IExecutionProfileOptions
Utility builder that is used to add Execution Profiles to a Cluster instance. See WithExecutionProfiles(Action<IExecutionProfileOptions>).
IExtendedRetryPolicy
A policy that extends IRetryPolicy providing an additional method to handle unexpected errors.
IFrameCompressor
Defines the methods for frame compression and decompression
IInitializer
Initializer for Cluster instances.
If you want to create a
new 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.
ILoadBalancingPolicy
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.
IReconnectionPolicy
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
IReconnectionSchedule
on 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.
IReconnectionSchedule
Schedules reconnection attempts to a node.
IRetryPolicy
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.
ISession
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.
ISessionState
Represents the state of a ISession.
Exposes information on the connections maintained by a Client at a specific time.
ISpeculativeExecutionPlan
Represents a plan that governs speculative executions for a given query.
ISpeculativeExecutionPolicy
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.
IStatement
An executable query. This represents either a SimpleStatement, a BoundStatement or a BoundStatement along with the query options (consistency level, whether to trace the query, ...).
ITimestampGenerator
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().
ITypeAdapter
DEPRECATED, use TypeSerializer<T> instead. Represents a adapter to convert a Cassandra type to a CLR type.
Enums
BatchType
The type of batch to use
ColumnTypeCode
Specifies a Cassandra data type of a field
CompressionType
Compression supported by the Cassandra binary protocol.
ConsistencyLevel
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.
DataCollectionMetadata.SortOrder
Specifies sort order of the clustering keys
HostDistance
The distance to a Cassandra node as assigned by a ILoadBalancingPolicy relative to the ICluster instance.
The distance assigned to a host influences how many connections the driver maintains towards this host.
HostsEventArgs.Kind
IndexMetadata.IndexKind
Describes the possible kinds of indexes
KeyType
Describes the type of key.
This enum is going to be deprecated in future releases, use PartitionKeys, ClusteringKeys and Indexes for a more accurate representation of a table or view keys and indexes.
ProtocolVersion
Specifies the different protocol versions and provides methods (via extension methods) to check whether a feature is supported in an specific version
QueryProtocolOptions.QueryFlags
RetryDecision.RetryDecisionType
The type of retry decisions.