17 #ifndef __MESOS_ZOOKEEPER_GROUP_HPP__ 18 #define __MESOS_ZOOKEEPER_GROUP_HPP__ 61 return sequence == that.sequence;
66 return sequence != that.sequence;
71 return sequence < that.sequence;
76 return sequence <= that.sequence;
81 return sequence > that.sequence;
86 return sequence >= that.sequence;
116 : sequence(_sequence), label_(_label), cancelled_(cancelled) {}
118 const int32_t sequence;
125 Group(
const std::string& servers,
127 const std::string& znode,
142 const std::string&
data,
158 const std::set<Membership>& expected = std::set<Membership>());
174 const std::string& znode,
192 const std::string& data,
198 const std::set<Group::Membership>& expected);
203 void connected(int64_t sessionId,
bool reconnect);
204 void reconnecting(int64_t sessionId);
205 void expired(int64_t sessionId);
206 void updated(int64_t sessionId,
const std::string&
path);
207 void created(int64_t sessionId,
const std::string&
path);
208 void deleted(int64_t sessionId,
const std::string&
path);
211 void startConnection();
214 const std::string& data,
246 void retry(
const Duration& duration);
248 void timedout(int64_t sessionId);
253 void abort(
const std::string& message);
258 const std::string servers;
263 const std::string znode;
267 const ACL_vector acl;
294 : data(_data),
label(_label) {}
303 : membership(_membership) {}
311 : membership(_membership) {}
318 explicit Watch(
const std::set<Group::Membership>& _expected)
319 : expected(_expected) {}
320 std::set<Group::Membership> expected;
337 std::map<int32_t, process::Promise<bool>*> owned;
338 std::map<int32_t, process::Promise<bool>*> unowned;
351 #endif // __MESOS_ZOOKEEPER_GROUP_HPP__
Definition: zookeeper.hpp:115
Try< bool > update(const std::string &link, const Handle &parent, uint16_t protocol, const action::Mirror &mirror)
bool operator==(const Membership &that) const
Definition: group.hpp:59
Option< std::string > label() const
Definition: group.hpp:94
process::Future< Option< std::string > > data(const Membership &membership)
bool pending(int signal)
Definition: signals.hpp:50
process::Future< Option< int64_t > > session()
static const Duration RETRY_INTERVAL
Definition: group.hpp:184
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
Definition: duration.hpp:32
Group(const std::string &servers, const Duration &sessionTimeout, const std::string &znode, const Option< Authentication > &auth=None())
int32_t id() const
Definition: group.hpp:89
This interface specifies the public interface an event handler class must implement.
Definition: zookeeper.hpp:59
process::Future< bool > cancelled() const
Definition: group.hpp:105
Definition: authentication.hpp:33
Try< Nothing > initialize(const Flags &flags)
Initialized state for support of systemd functions in this file.
friend class GroupProcess
Definition: group.hpp:111
Definition: future.hpp:74
std::queue< Join * > joins
Definition: group.hpp:325
Protocol< PromiseRequest, PromiseResponse > promise
bool operator!=(const Membership &that) const
Definition: group.hpp:64
process::Future< std::set< Membership > > watch(const std::set< Membership > &expected=std::set< Membership >())
bool operator<=(const Membership &that) const
Definition: group.hpp:74
bool operator<(const Membership &that) const
Definition: group.hpp:69
process::Future< Membership > join(const std::string &data, const Option< std::string > &label=None())
std::queue< Watch * > watches
Definition: group.hpp:328
bool operator>=(const Membership &that) const
Definition: group.hpp:84
std::string error(const std::string &msg, uint32_t code)
std::queue< Data * > datas
Definition: group.hpp:327
process::Future< bool > cancel(const Membership &membership)
bool operator>(const Membership &that) const
Definition: group.hpp:79
Try< Nothing > create(const std::string &hierarchy, const std::string &cgroup, bool recursive=false)
Definition: process.hpp:505
GroupProcess * process
Definition: group.hpp:165
std::queue< Cancel * > cancels
Definition: group.hpp:326
Definition: group.hpp:169