Click or drag to resize
Cluster Class
Implementation of ICluster
Inheritance Hierarchy
SystemObject
  CassandraCluster

Namespace: Cassandra
Assembly: Cassandra (in Cassandra.dll) Version: 3.7.0
Syntax
C#
public class Cluster : ICluster, IDisposable

The Cluster type exposes the following members.

Methods
  NameDescription
Public methodAllHosts
Returns all known hosts of this cluster.
Public methodStatic memberBuilder
Creates a new Cluster.NewBuilder instance.

This is a shortcut for new Cluster.NewBuilder()

.
Public methodStatic memberBuildFrom
Build a new cluster based on the provided initializer.

Note that for building a cluster programmatically, Cluster.NewBuilder provides a slightly less verbose shortcut with NewBuilder#Build.

Also note that that all the contact points provided by initializer must share the same port.

Public methodConnect
Creates a new session on this cluster.
Public methodConnect(String)
Creates a new session on this cluster and using a keyspace an existing keyspace.
Public methodConnectAndCreateDefaultKeyspaceIfNotExists
Creates new session on this cluster, and sets it to default keyspace. If default keyspace does not exist then it will be created and session will be set to it. Name of default keyspace can be specified during creation of cluster object with Cluster.Builder().WithDefaultKeyspace("keyspace_name") method.
Public methodConnectAsync
Creates a new session on this cluster.
Public methodConnectAsync(String)
Creates a new session on this cluster and using a keyspace an existing keyspace.
Public methodDispose
Releases all resources used by the Cluster
Public methodGetHost
Get the host instance for a given Ip address.
Public methodGetReplicas(Byte)
Gets a collection of replicas for a given partitionKey. Backward-compatibility only, use GetReplicas(keyspace, partitionKey) instead.
Public methodGetReplicas(String, Byte)
Gets a collection of replicas for a given partitionKey on a given keyspace
Public methodRefreshSchema
Updates cluster metadata for a given keyspace or keyspace table
Public methodShutdown
Shutdown this cluster instance. This closes all connections from all the sessions of this * Cluster instance and reclaim all resources used by it.

This method has no effect if the cluster was already shutdown.

Public methodShutdownAsync
Top
Properties
  NameDescription
Public propertyConfiguration
Gets the cluster configuration.
Public propertyStatic memberMaxProtocolVersion
Gets or sets the maximum protocol version used by this driver.

While property value is maintained for backward-compatibility, use SetMaxProtocolVersion(ProtocolVersion) to set the maximum protocol version used by the driver.

Protocol version used can not be higher than MaxSupported.

Public propertyMetadata
Gets read-only metadata on the connected cluster.

This includes the know nodes (with their status as seen by the driver) as well as the schema definitions.

This method may trigger the creation of a connection if none has been established yet.

Top
Events
  NameDescription
Public eventHostAdded
Event that gets triggered when a new host is added to the cluster
Public eventHostRemoved
Event that gets triggered when a host has been removed from the cluster
Top
See Also