Cassandra v1.0.0-beta.5 Cassandra.Cluster

Represents a cassandra cluster. It serves as a Session factory and a collection of metadata.

It always keeps a control connection open to one of cluster hosts to get notified about topological and status changes in the cluster, and keeps its metadata is sync.

Summary

Functions

Returns replications containing partition_key of keyspace

Returns list of cluster hosts matching given list if ips

Returns list of clusters Cassandra.Hosts

Starts a Cluster process without links (outside of a supervision tree)

Starts a Cluster process linked to the current process

Returns list of clusters up Cassandra.Hosts

Functions

find_replicas(cluster, keyspace, partition_key)

Returns replications containing partition_key of keyspace

host(cluster, ips)

Returns list of cluster hosts matching given list if ips

hosts(cluster)

Returns list of clusters Cassandra.Hosts

start(options \\ [])

Starts a Cluster process without links (outside of a supervision tree).

See start_link/1 for more information.

start_link(options \\ [])

Starts a Cluster process linked to the current process.

options is the keyword list of options:

  • :contact_points - The initial list host of addresses. Note that the entire list of cluster members will be discovered automatically once a connection to any hosts from the original list is successful. (default: ["127.0.0.1"])
  • :port - Cassandra native protocol port (default: 9042)
  • :connection_timeout - connection timeout in milliseconds (defult: 5000)
  • :timeout - request execution timeout in milliseconds (default: :infinity)

Return values

It returns {:ok, pid} when connection to one of contact_points established and metadata fetched, on any error it returns {:error, reason}.

up_hosts(cluster)

Returns list of clusters up Cassandra.Hosts