com.websudos.phantom.zookeeper

ClusterStore

trait ClusterStore extends AnyRef

This is a simple implementation that will allow for singleton synchronisation of Cassandra clusters and sessions. Connector traits may be mixed in to any number of Cassandra tables, but at runtime, the cluster, session or ZooKeeper client must be the same.

The ClusterStore serves as a sync point for the ZooKeeperClient, Cassandra Cluster and Cassandra session triplet. All it needs as external information is the keySpace used by the Cassandra connection.

It will perform the following sequence of actions in order: - It will read a known environment variable, named TEST_ZOOKEEPER_CONNECTOR to find the IP:PORT combo for the master ZooKeeper coordinator node. - If the combo is not found, it will try to use the default ZooKeeper master address, namely localhost:2181. - It will then try to connect to the ZooKeeper master and fetch the data from the "/cassandra" path. - On that path, it expects to find a sequence of IP:PORT combos in the following format: "ip1:host1, ip2:host2, ip3:host3, ...". - It will fetch the ports, parse them into their equivalent java.net.InetSocketAddress instance. - With that sequence of InetSocketAddress connections, it will spawn a Cassandra Load Balancer cluster configuration. - This will work with any number of Cassandra nodes present in ZooKeeper, the connection manager will load balance over all Cassandra IPs found in ZooKeeper. - After the cluster is spawned, the Store will attempt to create the keySpace if necessary, using a Cassandra Compare-and-Set query. - It will then feed the keySpace into the Cassandra session to obtain a final, directly usable values where queries can execute.

The initialisation process is entirely synchronised, using the JVM handle before to ensure only the first thread trying to read a Cassandra Session will cause the initialisation process to start. Any thread thereafter will simply read the initialised ready-to-use version. Any attempt to read values directly before they are initialised will throw an EmptyClusterStoreException.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ClusterStore
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def parsePorts(data: String): Seq[InetSocketAddress]

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. var _session: Session

    Attributes
    protected[this]
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def cluster: Cluster

    Annotations
    @throws( ... )
  10. var clusterStore: Cluster

    Attributes
    protected[this]
  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  15. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  16. def hostnamePortPairs: Future[Seq[InetSocketAddress]]

  17. def initStore(keySpace: String, address: InetSocketAddress): Unit

  18. def isInited: Boolean

  19. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  20. lazy val logger: Logger

  21. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  22. final def notify(): Unit

    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  24. def session: Session

    Annotations
    @throws( ... )
  25. def setInited(value: Boolean): Unit

  26. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  27. def toString(): String

    Definition Classes
    AnyRef → Any
  28. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. def zkClient: ZkClient

    Annotations
    @throws( ... )
  32. var zkClientStore: ZkClient

    Attributes
    protected[this]

Inherited from AnyRef

Inherited from Any

Ungrouped