Was this page helpful?
ScyllaDB Python Driver is available under the Apache v2 License. ScyllaDB Python Driver is a fork of DataStax Python Driver. See Copyright here.
cassandra.metadata
- Schema and Ring Topology¶set() -> new empty set object set(iterable) -> new set object
Build an unordered collection of unique elements.
set() -> new empty set object set(iterable) -> new set object
Build an unordered collection of unique elements.
set() -> new empty set object set(iterable) -> new set object
Build an unordered collection of unique elements.
Holds a representation of the cluster schema and topology.
Returns a tuple (host, new), where host
is a Host
instance, and new
is a bool indicating whether
the host was newly added.
Returns a string that can be executed as a query in order to recreate the entire schema. The string is formatted to be human readable.
Find a host in the metadata for a specific endpoint. If a string inet address and port are passed,
iterate all hosts to match the broadcast_rpc_address
and
broadcast_rpc_port
attributes.
Same as get_host() but use host_id for lookup.
A representation of the schema for a single keyspace.
Returns a CQL query string that can be used to recreate just this keyspace, not including user-defined types and tables.
Returns a CQL query string that can be used to recreate the entire keyspace, including user-defined types and tables.
A user defined type, as created by CREATE TYPE
statements.
User-defined types were introduced in Cassandra 2.1.
Added in version 2.1.0.
Returns a CQL query that can be used to recreate this type.
If formatted is set to True
, extra whitespace will
be added to make the query more readable.
A user defined function, as created by CREATE FUNCTION
statements.
User-defined functions were introduced in Cassandra 2.2
Added in version 2.6.0.
Returns a CQL query that can be used to recreate this function.
If formatted is set to True
, extra whitespace will
be added to make the query more readable.
A user defined aggregate function, as created by CREATE AGGREGATE
statements.
Aggregate functions were introduced in Cassandra 2.2
Added in version 2.6.0.
Returns a CQL query that can be used to recreate this aggregate.
If formatted is set to True
, extra whitespace will
be added to make the query more readable.
A representation of the schema for a single table.
Returns a CQL query that can be used to recreate this table (index
creations are not included). If formatted is set to True
,
extra whitespace will be added to make the query human readable.
Returns a string of CQL queries that can be used to recreate this table along with all indexes on it. The returned string is formatted to be human readable.
A boolean indicating if this table can be represented as CQL in export
A list of ColumnMetadata
representing the components of
the primary key for this table.
For C* 3.0+. option_maps take a superset of map names, so if nothing changes structurally, new option maps can just be appended to the list.
A boolean indicating if this table can be represented as CQL in export
Returns a CQL query that can be used to recreate this table (index
creations are not included). If formatted is set to True
,
extra whitespace will be added to make the query human readable.
A representation of a single column in a table.
A representation of a secondary index on a column.
Returns a CQL query that can be used to recreate this index.
Returns a CQL query string that can be used to recreate this index.
A representation of a materialized view on a table
Returns a CQL query that can be used to recreate this function.
If formatted is set to True
, extra whitespace will
be added to make the query more readable.
A representation of a vertex on a table
A representation of an edge on a table
Information about the layout of the ring.
Abstract class representing a token.
A token for Murmur3Partitioner
.
token is an int or string representing the token.
A token for RandomPartitioner
.
A token for ByteOrderedPartitioner
.
token_string should be the string representation from the server.
alias of _ReplicationStrategy
Represent the replication factor of a keyspace.
Returns a string version of these replication options which are suitable for use in a CREATE KEYSPACE statement.
The replication factor for this keyspace.
For backward compatibility, this returns the
cassandra.metadata.ReplicationFactor.full_replicas
value of
cassandra.metadata.SimpleStrategy.replication_factor_info
.
Returns a string version of these replication options which are suitable for use in a CREATE KEYSPACE statement.
Returns a string version of these replication options which are suitable for use in a CREATE KEYSPACE statement.
Returns a dict
with the keys grouped per host. This can be
used to more accurately group by IN clause or to batch the keys per host.
If a valid replica is not found for a particular key it will be grouped under
NO_VALID_REPLICA
Example usage:
>>> result = group_keys_by_replica(
... session, "system", "peers",
... (("127.0.0.1", ), ("127.0.0.2", )))
Was this page helpful?
ScyllaDB Python Driver is available under the Apache v2 License. ScyllaDB Python Driver is a fork of DataStax Python Driver. See Copyright here.
cassandra
- Exceptions and Enumscassandra.cluster
- Clusters and Sessionscassandra.policies
- Load balancing and Failure Handling Policiescassandra.auth
- Authenticationcassandra.metadata
- Schema and Ring Topologycassandra.metrics
- Performance Metricscassandra.query
- Prepared Statements, Batch Statements, Tracing, and Row Factoriescassandra.pool
- Hosts and Connection Poolscassandra.protocol
- Protocol Featurescassandra.encoder
- Encoders for non-prepared Statementscassandra.decoder
- Data Return Formatscassandra.concurrent
- Utilities for Concurrent Statement Executioncassandra.connection
- Low Level Connection Infocassandra.util
- Utilitiescassandra.timestamps
- Timestamp Generationcassandra.io.asyncioreactor
- asyncio
Event Loopcassandra.io.asyncorereactor
- asyncore
Event Loopcassandra.io.eventletreactor
- eventlet
-compatible Connectioncassandra.io.libevreactor
- libev
Event Loopcassandra.io.geventreactor
- gevent
-compatible Event Loopcassandra.io.twistedreactor
- Twisted Event Loopcassandra.cqlengine.models
- Table models for object mappingcassandra.cqlengine.columns
- Column types for object mapping modelscassandra.cqlengine.query
- Query and filter model objectscassandra.cqlengine.connection
- Connection management for cqlenginecassandra.cqlengine.management
- Schema management for cqlenginecassandra.cqlengine.usertype
- Model classes for User Defined TypesOn this page
cassandra.metadata
- Schema and Ring Topologycql_keywords
cql_keywords_unreserved
cql_keywords_reserved
Metadata