Class 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.
Inheritance
System.Object
DseCluster
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Dse
Assembly: Dse.dll
Syntax
public class DseCluster : IInternalDseCluster, IDseCluster, IInternalCluster, ICluster, IDisposable
Examples
IDseCluster cluster = DseCluster.Builder().AddContactPoint("192.168.0.1").Build();
IDseSession session = cluster.Connect("ks1");
foreach (Row row in session.Execute(query))
{
//do something...
}
Properties
Configuration
Declaration
public DseConfiguration Configuration { get; }
Property Value
Declaration
public Metadata Metadata { get; }
Property Value
Methods
AllHosts()
Returns all known hosts of this cluster.
Declaration
public ICollection<Host> AllHosts()
Returns
Type |
Description |
System.Collections.Generic.ICollection<Host> |
|
AnyOpenConnections(Host)
Declaration
public bool AnyOpenConnections(Host host)
Parameters
Type |
Name |
Description |
Host |
host |
|
Returns
Type |
Description |
System.Boolean |
|
Builder()
Declaration
public static DseClusterBuilder Builder()
Returns
Connect()
Declaration
public IDseSession Connect()
Returns
Connect(String)
Creates a new IDseSession for this cluster to a specific keyspaces.
Declaration
public IDseSession Connect(string keyspace)
Parameters
Type |
Name |
Description |
System.String |
keyspace |
|
Returns
ConnectAsync()
Asynchronously creates a new session on this cluster.
Declaration
public Task<IDseSession> ConnectAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task<IDseSession> |
|
ConnectAsync(String)
Asynchronously creates a new session on this cluster and using a keyspace an existing keyspace.
Declaration
public Task<IDseSession> ConnectAsync(string keyspace)
Parameters
Type |
Name |
Description |
System.String |
keyspace |
Case-sensitive keyspace name to use
|
Returns
Type |
Description |
System.Threading.Tasks.Task<IDseSession> |
|
Dispose()
Declaration
GetHost(IPEndPoint)
Get a host instance for a given endpoint.
Declaration
public Host GetHost(IPEndPoint address)
Parameters
Type |
Name |
Description |
System.Net.IPEndPoint |
address |
|
Returns
GetReplicas(String, Byte[])
Gets a collection of replicas for a given partitionKey on a given keyspace.
Declaration
public ICollection<Host> GetReplicas(string keyspace, byte[] partitionKey)
Parameters
Type |
Name |
Description |
System.String |
keyspace |
The keyspace name.
|
System.Byte[] |
partitionKey |
Byte array representing the partition key.
|
Returns
Type |
Description |
System.Collections.Generic.ICollection<Host> |
|
GetResolvedEndpoints()
Declaration
public IReadOnlyDictionary<string, IEnumerable<IPEndPoint>> GetResolvedEndpoints()
Returns
Type |
Description |
System.Collections.Generic.IReadOnlyDictionary<System.String, System.Collections.Generic.IEnumerable<System.Net.IPEndPoint>> |
|
OnInitializeAsync()
Declaration
public Task<bool> OnInitializeAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
OnShutdownAsync(Int32)
Declaration
public Task<bool> OnShutdownAsync(int timeoutMs = -1)
Parameters
Type |
Name |
Description |
System.Int32 |
timeoutMs |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
RefreshSchema(String, String)
Declaration
public bool RefreshSchema(string keyspace = null, string table = null)
Parameters
Type |
Name |
Description |
System.String |
keyspace |
|
System.String |
table |
|
Returns
Type |
Description |
System.Boolean |
|
RefreshSchemaAsync(String, String)
Declaration
public Task<bool> RefreshSchemaAsync(string keyspace = null, string table = null)
Parameters
Type |
Name |
Description |
System.String |
keyspace |
|
System.String |
table |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Boolean> |
|
Shutdown(Int32)
Declaration
public void Shutdown(int timeoutMs = -1)
Parameters
Type |
Name |
Description |
System.Int32 |
timeoutMs |
|
ShutdownAsync(Int32)
Declaration
public Task ShutdownAsync(int timeout = -1)
Parameters
Type |
Name |
Description |
System.Int32 |
timeout |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Events
HostAdded
Represents an event that is triggered when a new host is added to the cluster.
Declaration
public event Action<Host> HostAdded
Event Type
Type |
Description |
System.Action<Host> |
|
HostRemoved
Represents an event that is triggered when a new host is decommissioned from the cluster.
Declaration
public event Action<Host> HostRemoved
Event Type
Type |
Description |
System.Action<Host> |
|
Explicit Interface Implementations
ICluster.Configuration
Declaration
Configuration ICluster.Configuration { get; }
Returns
ICluster.Connect()
Declaration
ISession ICluster.Connect()
Returns
ICluster.Connect(String)
Declaration
ISession ICluster.Connect(string keyspace)
Parameters
Type |
Name |
Description |
System.String |
keyspace |
|
Returns
ICluster.ConnectAsync()
Declaration
Task<ISession> ICluster.ConnectAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task<ISession> |
|
ICluster.ConnectAsync(String)
Declaration
Task<ISession> ICluster.ConnectAsync(string keyspace)
Parameters
Type |
Name |
Description |
System.String |
keyspace |
|
Returns
Type |
Description |
System.Threading.Tasks.Task<ISession> |
|
ICluster.GetReplicas(Byte[])
Declaration
ICollection<Host> ICluster.GetReplicas(byte[] partitionKey)
Parameters
Type |
Name |
Description |
System.Byte[] |
partitionKey |
|
Returns
Type |
Description |
System.Collections.Generic.ICollection<Host> |
|
Implements
System.IDisposable