The store synchronising access to the ZooKeeper client.
The store synchronising access to the ZooKeeper client.
This has the effect of pushing a new InetSocketAddress or its string representation to be price to the set already in ZooKeeper.
This has the effect of pushing a new InetSocketAddress or its string representation to be price to the set already in ZooKeeper. A read operation is always performed first to avoid maintaining any state of the client side.
If the data is not available in the data that was read, a write operation is carried out. If the data is already there, the write operation is skipped to save time and bandwidth a Future is immediately completed.
The ZooKeeper path to add the address to.
A Future wrapping an optional operation response. If the address is already in the set no write operation is performed.
This method is shorthand syntax for retrieving the entire set of host:port pairs available on a ZooKeeper node.
This method is shorthand syntax for retrieving the entire set of host:port pairs available on a ZooKeeper node. It's used in conjunction with the default parsing convention defined.
The ZooKeeper path to read from.
A set of unique host:port combinations represented as a set of InetSocketAddress objects.
This is a simple shorthand method allowing users to get a reference to the hostname of the current machine.
This is a simple shorthand method allowing users to get a reference to the hostname of the current machine.
The purpose of this is to allow shorthand syntax for things like server.add(localAddress(somePort)){code},
effectively allowing applications to register as active and become discoverable via ZooKeeper.
The port to use in conjunction with the hostname of the current machine.
An InetSocketAddress matching the hostname of the current machine and a chosen port.
This method is used to parse the string of data obtained from a ZooKeeper path into a sequence of ports.
This method is used to parse the string of data obtained from a ZooKeeper path into a sequence of ports. It's highly opinionated about the format in which teh data should be and it will only work with our default.
Our format is "host:port*".
The data string fetched from ZooKeeper.
This is a shorthand method for a UTF-8 based write operation to a ZooKeeper path.
This is a shorthand method for a UTF-8 based write operation to a ZooKeeper path. It will simply overwrite the existing data on a path with the argument provided.
The encoding in use by this method is always UTF 8.
The ZooKeeper path to write to.
The string of data to write to the ZooKeeper path.
A Future wrapping the response of the write operation.
Registers a new set of addresses on a ZooKeeper node.
Registers a new set of addresses on a ZooKeeper node. This will overwrite any existing data on the path.
The ZooKeeper path to write to.
The InetSocketAddress to save as a sequence.
A Future wrapping the response of the write operation.
Registers a address on a ZooKeeper node.
Registers a address on a ZooKeeper node. This will overwrite any existing data on the path.
The ZooKeeper path to write to.
The InetSocketAddress to save as a sequence.
A Future wrapping the response of the write operation.
This will remove an address from a ZooKeeper node/path.
This will remove an address from a ZooKeeper node/path. This is useful when a server is going out of service or any other similar situation.
A read operation is always carried out no matter what to avoid maintaining any state of the client side. If the address to be removed is not found in the existing set, no write operation will be carried out.
The ZooKeeper path to write to.
The InetSocketAddress to remove from the existing set.
A Future wrapping an optional operation response. If the address is not in the set no write operation is performed.
The default connection timeout.
The default connection timeout. This is enforced when the ZooKeeper client connects to the ZooKeeper host.
This is a simple mixable trait for client applications to fetch ports from ZooKeeper during initialisation or register themselves on a path. In our eco-system, this is generally mixed in to objects extending TwitterServer or ClientBuilder.
The point is to allow very easy access to the local ZooKeeper node available in a Mesos deployment to fetch "the other" host:port pairs in the eco-system, allowing Thrift clients to auto-generate themselves with a trivial awaiting of a Future. The same mechanism can be used for any type of client.
This also allows applications to register themselves to a ZooKeeper path making them discoverable by other clients.