Skip to content
This repository was archived by the owner on May 3, 2022. It is now read-only.

ClusterInformation

Otávio Santana edited this page Mar 31, 2014 · 8 revisions

The ClusterInformation's class is how Easy-Cassandra know about infrastructure of application. You may specify:

  • hosts: You may inform all ip of Cassandra's nodes that you are using in your applications
  • keySpace: the name of key space
  • user: user to acess Cassandra, if you are using autorization resource in Cassandra.
  • password: the password to acess cassandra, if if you are using autorization resource in Cassandra.
  • port: the port to communicate to Cassandra, the default is 9042.

If you start Cassandra without have created the keyspace and column family, the Easy-Cassnadra will create it to you. To do that you have some options:

  • replicaStrategy: The replica placement strategy determines how replicas for a keyspace are distributed across the cluster. The default is SIMPLES_TRATEGY.

  • replicaFactor: The replica factor, the total number of replicas across the cluster. This option is used if you either choice SIMPLES_TRATEGY, on replicaStrategy, or don't set.

  • customQuery: if the keyspace has not been created, Easy-Cassandra will use this query. This option is required when you set CUSTOM_STRATEGY on replicaStrategy. On begin of your query you must define 'IF NOT EXISTS'. For example:

    `CREATE KEYSPACE IF NOT EXISTS javabahia WITH replication = {'class': 'SimpleStrategy' , 'replication_factor': 3};`
    

Instead of:

  `CREATE KEYSPACE  javabahia WITH replication = {'class': 'SimpleStrategy' , 'replication_factor': 3};`
  • dataCenter: inform the replica factor to each datacenter that you want.

Clone this wiki locally