Class Metadata
Keeps metadata on the connected cluster, including known nodes and schema
definitions.
Assembly: Cassandra.dll
public class Metadata : IDisposable
Properties
Returns the name of currently connected cluster.
Declaration
public string ClusterName { get; }
Property Value
Type |
Description |
string |
the Cassandra name of currently connected cluster.
|
Determines whether the cluster is provided as a service (DataStax Astra).
Declaration
public bool IsDbaas { get; }
Property Value
Methods
Returns all known hosts of this cluster.
Declaration
public ICollection<Host> AllHosts()
Returns
Type |
Description |
ICollection<Host> |
collection of all known hosts of this cluster.
|
Declaration
public IEnumerable<IPEndPoint> AllReplicas()
Returns
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 |
Task<bool> |
True if schema agreement was successful and false if it was not successful.
|
Declaration
Gets the definition associated with a aggregate from Cassandra
Declaration
public AggregateMetadata GetAggregate(string keyspace, string name, string[] signature)
Parameters
Returns
Gets the definition associated with a User Defined Function from Cassandra
Declaration
public FunctionMetadata GetFunction(string keyspace, string name, string[] signature)
Parameters
Returns
Declaration
public Host GetHost(IPEndPoint address)
Parameters
Returns
Returns metadata of specified keyspace.
Declaration
public KeyspaceMetadata GetKeyspace(string keyspace)
Parameters
Type |
Name |
Description |
string |
keyspace |
the name of the keyspace for which metadata should be
returned.
|
Returns
Type |
Description |
KeyspaceMetadata |
the metadata of the requested keyspace or null if
* keyspace is not a known keyspace.
|
Returns a collection of all defined keyspaces names.
Declaration
public ICollection<string> GetKeyspaces()
Returns
Returns the view metadata for the provided view name in the keyspace.
Declaration
public MaterializedViewMetadata GetMaterializedView(string keyspace, string name)
Parameters
Type |
Name |
Description |
string |
keyspace |
name of the keyspace within specified view is defined.
|
string |
name |
name of view.
|
Returns
Declaration
public ICollection<Host> GetReplicas(byte[] partitionKey)
Parameters
Type |
Name |
Description |
byte[] |
partitionKey |
|
Returns
Get the replicas for a given partition key and keyspace
Declaration
public ICollection<Host> GetReplicas(string keyspaceName, byte[] partitionKey)
Parameters
Type |
Name |
Description |
string |
keyspaceName |
|
byte[] |
partitionKey |
|
Returns
Returns TableMetadata for specified table in specified keyspace.
Declaration
public TableMetadata GetTable(string keyspace, string tableName)
Parameters
Type |
Name |
Description |
string |
keyspace |
name of the keyspace within specified table is defined.
|
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.
|
Returns names of all tables which are defined within specified keyspace.
Declaration
public ICollection<string> GetTables(string keyspace)
Parameters
Type |
Name |
Description |
string |
keyspace |
the name of the keyspace for which all tables metadata should be
returned.
|
Returns
Type |
Description |
ICollection<string> |
an ICollection of the metadata for the tables defined in this
keyspace.
|
Gets the definition associated with a User Defined Type from Cassandra
Declaration
public UdtColumnInfo GetUdtDefinition(string keyspace, string typeName)
Parameters
Returns
Gets the definition associated with a User Defined Type from Cassandra
Declaration
public Task<UdtColumnInfo> GetUdtDefinitionAsync(string keyspace, string typeName)
Parameters
Returns
Updates the keyspace and token information
Declaration
public bool RefreshSchema(string keyspace = null, string table = null)
Parameters
Returns
Updates the keyspace and token information
Declaration
public Task<bool> RefreshSchemaAsync(string keyspace = null, string table = null)
Parameters
Returns
Declaration
public void ShutDown(int timeoutMs = -1)
Parameters
Type |
Name |
Description |
int |
timeoutMs |
|
Events
Declaration
public event HostsEventHandler HostsEvent
Event Type
Declaration
public event SchemaChangedEventHandler SchemaChangedEvent
Event Type
Implements