Class: Metadata

Metadata

Constructor

new Metadata(options, controlConnection)

Represents cluster and schema information. The metadata class acts as a internal state of the driver.
Parameters:
Name Type Description
options ClientOptions
controlConnection ControlConnection Control connection used to retrieve information.

Methods

clearPrepared()

Clears the internal state related to the prepared statements. Following calls to the Client using the prepare flag will re-prepare the statements.

getAggregate(keyspaceName, name, signature, callback)

Gets a definition of CQL aggregate for a given name and signature.

When trying to retrieve the same aggregate definition concurrently, it will query once and invoke all callbacks with the retrieved information.

Parameters:
Name Type Description
keyspaceName String Name of the keyspace
name String Name of the aggregate
signature Array.<String> | Array.<{code, info}> Array of types of the parameters.
callback function The callback with the err as a first parameter and the Aggregate as second parameter.

getAggregates(keyspaceName, name, callback)

Gets the definition of CQL aggregate for a given name.

When trying to retrieve the same aggregates definition concurrently, it will query once and invoke all callbacks with the retrieved information.

Parameters:
Name Type Description
keyspaceName String Name of the keyspace
name String Name of the Function
callback function The callback with the err as a first parameter and the array of Aggregate as second parameter.

getFunction(keyspaceName, name, signature, callback)

Gets a definition of CQL function for a given name and signature.

When trying to retrieve the same function definition concurrently, it will query once and invoke all callbacks with the retrieved information.

Parameters:
Name Type Description
keyspaceName String Name of the keyspace
name String Name of the Function
signature Array.<String> | Array.<{code, info}> Array of types of the parameters.
callback function The callback with the err as a first parameter and the SchemaFunction as second parameter.

getFunctions(keyspaceName, name, callback)

Gets the definition of CQL functions for a given name.

When trying to retrieve the same function definition concurrently, it will query once and invoke all callbacks with the retrieved information.

Parameters:
Name Type Description
keyspaceName String Name of the keyspace
name String Name of the Function
callback function The callback with the err as a first parameter and the array of SchemaFunction as second parameter.

getReplicas(keyspaceName, tokenBuffer) → {Array}

Gets the host list representing the replicas that contain such partition.
Parameters:
Name Type Description
keyspaceName String
tokenBuffer Buffer
Returns:
Type
Array

getTable(keyspaceName, name, callback)

Gets the definition of a table.

When trying to retrieve the same table definition concurrently, it will query once and invoke all callbacks with the retrieved information.

Parameters:
Name Type Description
keyspaceName String Name of the keyspace
name String Name of the Table
callback function The callback with the err as a first parameter and the TableMetadata as second parameter.

getTrace(traceId, callback)

Gets the trace session 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.
Parameters:
Name Type Description
traceId Uuid Identifier of the trace session.
callback function The callback with the err as first parameter and the query trace as second parameter

getUdt(keyspaceName, name, callback)

Gets the definition of an user defined type.

When trying to retrieve the same udt definition concurrently, it will query once and invoke all callbacks with the retrieved information.

Parameters:
Name Type Description
keyspaceName String Name of the keyspace
name String Name of the UDT
callback function