Class Metadata
Keeps metadata on the connected cluster, including known nodes and schema definitions.
Inheritance
Implements
Inherited Members
Namespace: Dse
Assembly: Dse.dll
Syntax
public class Metadata : IDisposable
Properties
ClusterName
Returns the name of currently connected cluster.
Declaration
public string ClusterName { get; }
Property Value
Type | Description |
---|---|
System.String | the Cassandra name of currently connected cluster. |
IsDbaas
Determines whether the cluster is provided as a service (DataStax Astra).
Declaration
public bool IsDbaas { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
AllHosts()
Returns all known hosts of this cluster.
Declaration
public ICollection<Host> AllHosts()
Returns
Type | Description |
---|---|
System.Collections.Generic.ICollection<Host> | collection of all known hosts of this cluster. |
AllReplicas()
Declaration
public IEnumerable<IPEndPoint> AllReplicas()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.Net.IPEndPoint> |
CheckSchemaAgreementAsync()
Initiates a schema agreement check.
Schema changes need to be propagated to all nodes in the cluster. Once they have settled on a common version, we say that they are in agreement.
This method does not perform retries so MaxSchemaAgreementWaitSeconds does not apply.
Declaration
public Task<bool> CheckSchemaAgreementAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | True if schema agreement was successful and false if it was not successful. |
Dispose()
Declaration
public void Dispose()
GetAggregate(String, String, String[])
Gets the definition associated with a aggregate from Cassandra
Declaration
public AggregateMetadata GetAggregate(string keyspace, string name, string[] signature)
Parameters
Type | Name | Description |
---|---|---|
System.String | keyspace | |
System.String | name | |
System.String[] | signature |
Returns
Type | Description |
---|---|
AggregateMetadata | The aggregate metadata or null if not found. |
GetFunction(String, String, String[])
Gets the definition associated with a User Defined Function from Cassandra
Declaration
public FunctionMetadata GetFunction(string keyspace, string name, string[] signature)
Parameters
Type | Name | Description |
---|---|---|
System.String | keyspace | |
System.String | name | |
System.String[] | signature |
Returns
Type | Description |
---|---|
FunctionMetadata | The function metadata or null if not found. |
GetHost(IPEndPoint)
Declaration
public Host GetHost(IPEndPoint address)
Parameters
Type | Name | Description |
---|---|---|
System.Net.IPEndPoint | address |
Returns
Type | Description |
---|---|
Host |
GetKeyspace(String)
Returns metadata of specified keyspace.
Declaration
public KeyspaceMetadata GetKeyspace(string keyspace)
Parameters
Type | Name | Description |
---|---|---|
System.String | keyspace | the name of the keyspace for which metadata should be returned. |
Returns
Type | Description |
---|---|
KeyspaceMetadata | the metadata of the requested keyspace or |
GetKeyspaces()
Returns a collection of all defined keyspaces names.
Declaration
public ICollection<string> GetKeyspaces()
Returns
Type | Description |
---|---|
System.Collections.Generic.ICollection<System.String> | a collection of all defined keyspaces names. |
GetMaterializedView(String, String)
Returns the view metadata for the provided view name in the keyspace.
Declaration
public MaterializedViewMetadata GetMaterializedView(string keyspace, string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | keyspace | name of the keyspace within specified view is defined. |
System.String | name | name of view. |
Returns
Type | Description |
---|---|
MaterializedViewMetadata | a MaterializedViewMetadata for the view in the specified keyspace. |
GetReplicas(Byte[])
Declaration
public ICollection<Host> GetReplicas(byte[] partitionKey)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | partitionKey |
Returns
Type | Description |
---|---|
System.Collections.Generic.ICollection<Host> |
GetReplicas(String, Byte[])
Get the replicas for a given partition key and keyspace
Declaration
public ICollection<Host> GetReplicas(string keyspaceName, byte[] partitionKey)
Parameters
Type | Name | Description |
---|---|---|
System.String | keyspaceName | |
System.Byte[] | partitionKey |
Returns
Type | Description |
---|---|
System.Collections.Generic.ICollection<Host> |
GetTable(String, String)
Returns TableMetadata for specified table in specified keyspace.
Declaration
public TableMetadata GetTable(string keyspace, string tableName)
Parameters
Type | Name | Description |
---|---|---|
System.String | keyspace | name of the keyspace within specified table is defined. |
System.String | tableName | name of table for which metadata should be returned. |
Returns
Type | Description |
---|---|
TableMetadata | a TableMetadata for the specified table in the specified keyspace. |
GetTables(String)
Returns names of all tables which are defined within specified keyspace.
Declaration
public ICollection<string> GetTables(string keyspace)
Parameters
Type | Name | Description |
---|---|---|
System.String | keyspace | the name of the keyspace for which all tables metadata should be returned. |
Returns
Type | Description |
---|---|
System.Collections.Generic.ICollection<System.String> | an ICollection of the metadata for the tables defined in this keyspace. |
GetUdtDefinition(String, String)
Gets the definition associated with a User Defined Type from Cassandra
Declaration
public UdtColumnInfo GetUdtDefinition(string keyspace, string typeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | keyspace | |
System.String | typeName |
Returns
Type | Description |
---|---|
UdtColumnInfo |
GetUdtDefinitionAsync(String, String)
Gets the definition associated with a User Defined Type from Cassandra
Declaration
public Task<UdtColumnInfo> GetUdtDefinitionAsync(string keyspace, string typeName)
Parameters
Type | Name | Description |
---|---|---|
System.String | keyspace | |
System.String | typeName |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<UdtColumnInfo> |
RefreshSchema(String, String)
Updates the keyspace and token information
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)
Updates the keyspace and token information
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 |
Events
HostsEvent
Declaration
public event HostsEventHandler HostsEvent
Event Type
Type | Description |
---|---|
HostsEventHandler |
SchemaChangedEvent
Declaration
public event SchemaChangedEventHandler SchemaChangedEvent
Event Type
Type | Description |
---|---|
SchemaChangedEventHandler |