com.h3c.util.persistence.cassandra

## Class KeySpaceConfig

- java.lang.Object
- - com.h3c.util.persistence.cassandra.KeySpaceConfig

-     public class KeySpaceConfig
      extends Object

  POJO class for Cassandra Configuration

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `KeySpaceConfig()`
    `KeySpaceConfig(String KeyspaceName)` Constructor that reads configuration from file Cluster Name and replication factor are taken from file.
    `KeySpaceConfig(String ClusterName, String KeyspaceName, String Seeds)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getCluster()` Get the cluster Name
    `String` | `getKeyspace()` Get the Keyspace name
    `static String` | `getLockAppName()` Gets the Application Name.
    `static LockService` | `getlockService()` Gets the LockService instance
    `Integer` | `getReplicationFactor()` Gets the ReplicationFactor based on seeds in Cassandra Config ReplicationFactor = (no.
    `String` | `getSeeds()` Get Seeds
    `void` | `setCluster(String ClusterName)` Set the Cluster Name
    `void` | `setKeyspace(String KeyspaceName)` Set the Keyspace name
    `void` | `setReplicationFactor(Integer replicationFactor)` Sets the ReplicationFactor
    `void` | `setSeeds(String Seeds)` Method to set the seed list in the Cassandra Config Seeds should be given as a list for eg: 192.168.56.101:9160, 192.168.56.102:9160,

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### KeySpaceConfig

          public KeySpaceConfig(String ClusterName,
                        String KeyspaceName,
                        String Seeds)

    - #### KeySpaceConfig

          public KeySpaceConfig(String KeyspaceName)

      Constructor that reads configuration from file Cluster Name and replication factor are taken from file. Seeds is set to "127.0.0.1:9160" because we don't allow applications to talk to other nodes.
      Parameters:
        `KeyspaceName` - Name for keyspace

    - #### KeySpaceConfig

          public KeySpaceConfig()

  - ### Method Detail

    - #### getCluster

          public String getCluster()

      Get the cluster Name
      Returns:
        Name of the cluster

    - #### getKeyspace

          public String getKeyspace()

      Get the Keyspace name
      Returns:
        Name of the Keyspace

    - #### getSeeds

          public String getSeeds()

      Get Seeds
      Returns:
        Seed IP addresses

    - #### getLockAppName

          public static String getLockAppName()

      Gets the Application Name. Used in LockManager
      Returns:
        App Name

    - #### getlockService

          public static LockService getlockService()

      Gets the LockService instance
      Returns:
        LockService instance.

    - #### setCluster

          public void setCluster(String ClusterName)

      Set the Cluster Name
      Parameters:
        `ClusterName` - Name of the cluster

    - #### setKeyspace

          public void setKeyspace(String KeyspaceName)

      Set the Keyspace name
      Parameters:
        `KeyspaceName` - Name of the keyspace

    - #### setSeeds

          public void setSeeds(String Seeds)

      Method to set the seed list in the Cassandra Config
      Seeds should be given as a list for eg: 192.168.56.101:9160, 192.168.56.102:9160,
      Parameters:
        `Seeds` - list of Node IP address sets.

    - #### getReplicationFactor

          public Integer getReplicationFactor()

      Gets the ReplicationFactor based on seeds in Cassandra Config ReplicationFactor = (no. of seeds / 2) +1
      Returns:
        replicationFactor for this keyspace

    - #### setReplicationFactor

          public void setReplicationFactor(Integer replicationFactor)

      Sets the ReplicationFactor
      Parameters:
        `replicationFactor` - replication factor for this keyspace

Copyright © 2014. All Rights Reserved.