24 #ifndef __MESOS_ZOOKEEPER_HPP__
25 #define __MESOS_ZOOKEEPER_HPP__
29 #include <zookeeper.h>
46 class ZooKeeperProcess;
66 const std::string& path) = 0;
164 int authenticate(
const std::string& scheme,
const std::string& credentials);
201 const std::string& path,
202 const std::string& data,
203 const ACL_vector& acl,
206 bool recursive =
false);
227 int remove(
const std::string& path,
int version);
247 int exists(
const std::string& path,
bool watch, Stat*
stat);
268 const std::string& path,
290 const std::string& path,
292 std::vector<std::string>* results);
312 int set(
const std::string& path,
const std::string& data,
int version);
319 std::string
message(
int code)
const;
Definition: zookeeper.hpp:115
bool retryable(int code)
returns whether or not the specified return code implies the operation can be retried "as is" (i...
int create(const std::string &path, const std::string &data, const ACL_vector &acl, int flags, std::string *result, bool recursive=false)
create a node synchronously.
virtual ~Watcher()
Definition: zookeeper.hpp:68
int authenticate(const std::string &scheme, const std::string &credentials)
authenticate synchronously.
ZooKeeperProcess * process
Definition: zookeeper.hpp:333
int64_t getSessionId()
get the current session id.
int getState()
get the state of the zookeeper connection.
ZooKeeper(const std::string &servers, const Duration &sessionTimeout, Watcher *watcher)
instantiate new ZooKeeper client.
Definition: duration.hpp:32
int set(const std::string &path, const std::string &data, int version)
sets the data associated with a node.
This interface specifies the public interface an event handler class must implement.
Definition: zookeeper.hpp:59
process::Future< Version > version()
Definition: version.hpp:32
int exists(const std::string &path, bool watch, Stat *stat)
checks the existence of a node in zookeeper synchronously.
Duration getSessionTimeout() const
get the current session timeout.
Try< hashmap< std::string, uint64_t > > stat(const std::string &hierarchy, const std::string &cgroup, const std::string &file)
#define flags
Definition: decoder.hpp:18
virtual void process(int type, int state, int64_t sessionId, const std::string &path)=0
int getChildren(const std::string &path, bool watch, std::vector< std::string > *results)
lists the children of a node synchronously.
Try< uint32_t > type(const std::string &path)
std::string message(int code) const
return a message describing the return code.