Simple accessor that will guarantee a client is initialised before it is used.
Simple accessor that will guarantee a client is initialised before it is used. It's not the cheapest to maintain due to the inherent synchronisation required by maintaining global state.
However, for its purpose, a reference to this client is required only in the initialisation of clients and its generally to cheap to matter.
A reference to the global ZooKeeper client guaranteed by this store.
The default way to serialise an InetSocketAddress to a string.
The default way to serialise an InetSocketAddress to a string. This method will be used by all other primitive definitions inside this project meaning users can easily override this to enforce their own conventions.
JSON serialisation or any other form of serialization could easily be used to store and retrieve data from a ZooKeeper path. The data in question is only intended for sequences of host:port pairs.
The InetSocketAddress to serialise to a string.
The string representation of the InetSocketAddress that will be stored as bytes in ZooKeeper.
The connection timeout used to enforce a timeout when connection to the ZooKeeper host.
This is a ZooKeeper client store for accessors using ZooKeeperConf traits to read/write from ZooKeeper. Its sole purpose is to centralise access to ZooKeeper hosts and not necessitate access to multiple clients.
Using a single global client object with a synchronized access pattern and just-in-time init we can solve the problem of localhost Mesos based deployments. In a Mesos environment the ZooKeeper host is always fixed and every client application can easily talk to the same node to obtain data.
Users can easily override all the default implementation details and assumptions this store has and roll out their own communication instance with ZooKeeper. For now, this is mostly tailored to our Mesos deployment mechanism.