class Cassandra::Cluster
Cluster represents a cassandra cluster. It serves as a
session factory
factory and a collection of metadata.
Inherits
Object
Extends
Forwardable
Methods
name
Return cluster’s name
find_replicas
(keyspace, statement)Return replicas for a given statement and keyspace
- Note
- an empty list is returned when statement/keyspace information is not enough to determine replica list.
register
(listener)Register a cluster state listener. State listener will start receiving notifications about topology and schema changes
unregister
(listener)Unregister a cluster state listener. State listener will stop receiving notifications about topology and schema changes
each_host
(&block) aliased as: hostsYield or enumerate each member of this cluster
host
(address)Find a host by its address
has_host?
(address)Determine if a host by a given address exists
each_keyspace
(&block) aliased as: keyspacesYield or enumerate each keyspace defined in this cluster
keyspace
(name)Find a keyspace by name
has_keyspace?
(name)Determine if a keyspace by a given name exists
refresh_schema_async
refresh_schema
Synchronously refresh schema metadata
connect_async
(keyspace = nil)Asynchronously create a new session, optionally scoped to a keyspace
connect
(keyspace = nil)Synchronously create a new session, optionally scoped to a keyspace
close_async
Asynchronously closes all sessions managed by this cluster
close
Synchronously closes all sessions managed by this cluster