17 #ifndef __MESOS_ZOOKEEPER_WATCHER_HPP__ 18 #define __MESOS_ZOOKEEPER_WATCHER_HPP__ 22 #include <glog/logging.h> 41 : pid(_pid), reconnect(false) {}
47 const std::string&
path)
override 49 if (type == ZOO_SESSION_EVENT) {
50 if (state == ZOO_CONNECTED_STATE) {
56 }
else if (state == ZOO_CONNECTING_STATE) {
65 }
else if (state == ZOO_EXPIRED_SESSION_STATE) {
71 LOG(FATAL) <<
"Unhandled ZooKeeper state (" << state <<
")" 72 <<
" for ZOO_SESSION_EVENT";
74 }
else if (type == ZOO_CHILD_EVENT) {
76 }
else if (type == ZOO_CHANGED_EVENT) {
78 }
else if (type == ZOO_CREATED_EVENT) {
80 }
else if (type == ZOO_DELETED_EVENT) {
83 LOG(FATAL) <<
"Unhandled ZooKeeper event (" << type <<
")" 84 <<
" in state (" << state <<
")";
93 #endif // __MESOS_ZOOKEEPER_WATCHER_HPP__
void process(int type, int state, int64_t sessionId, const std::string &path) override
Definition: watcher.hpp:43
void expired(const std::shared_ptr< lambda::CallableOnce< Future< T >(const Future< T > &)>> &f, const std::shared_ptr< Latch > &latch, const std::shared_ptr< Promise< T >> &promise, const std::shared_ptr< Option< Timer >> &timer, const Future< T > &future)
Definition: future.hpp:1521
void dispatch(const PID< T > &pid, void(T::*method)())
Definition: dispatch.hpp:174
This interface specifies the public interface an event handler class must implement.
Definition: zookeeper.hpp:59
ProcessWatcher(const process::PID< T > &_pid)
Definition: watcher.hpp:40
A "process identifier" used to uniquely identify a process when dispatching messages.
Definition: pid.hpp:289
Try< uint32_t > type(const std::string &path)
Definition: watcher.hpp:37