diff options
author | Zuul <zuul@review.opendev.org> | 2022-10-12 08:35:27 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-10-12 08:35:27 +0000 |
commit | 1a76dd61999f9341ed6e7fbf601c030a5ea85c0d (patch) | |
tree | 9435c79cfca0351595d83bcbc687b9750e336975 | |
parent | cb0392ca6b91999c093f458da01c17bd4e4820f8 (diff) | |
parent | c0f6cc0fe5a0ebf43368aab3e8897a0eac0ab489 (diff) | |
download | tooz-1a76dd61999f9341ed6e7fbf601c030a5ea85c0d.tar.gz |
Merge "Enable watch functionality for Etcd3Driver"3.2.0
-rw-r--r-- | tooz/drivers/etcd3gw.py | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/tooz/drivers/etcd3gw.py b/tooz/drivers/etcd3gw.py index b1ad633..08f348d 100644 --- a/tooz/drivers/etcd3gw.py +++ b/tooz/drivers/etcd3gw.py @@ -163,7 +163,8 @@ class Etcd3Lock(locking.Lock): return False -class Etcd3Driver(coordination.CoordinationDriverWithExecutor): +class Etcd3Driver(coordination.CoordinationDriverCachedRunWatchers, + coordination.CoordinationDriverWithExecutor): """An etcd based driver. This driver uses etcd provide the coordination driver semantics and @@ -248,18 +249,6 @@ class Etcd3Driver(coordination.CoordinationDriverWithExecutor): lock.heartbeat() return min(self.lock_timeout, self.membership_timeout) - def watch_join_group(self, group_id, callback): - raise tooz.NotImplemented - - def unwatch_join_group(self, group_id, callback): - raise tooz.NotImplemented - - def watch_leave_group(self, group_id, callback): - raise tooz.NotImplemented - - def unwatch_leave_group(self, group_id, callback): - raise tooz.NotImplemented - def _encode_group_id(self, group_id): return _encode(self._prefix_group(group_id)) @@ -449,3 +438,11 @@ class Etcd3Driver(coordination.CoordinationDriverWithExecutor): group[1]['key'][len(self.GROUP_PREFIX):-1] for group in groups] return coordination.CoordinatorResult( self._executor.submit(_get_groups)) + + @staticmethod + def watch_elected_as_leader(group_id, callback): + raise tooz.NotImplemented + + @staticmethod + def unwatch_elected_as_leader(group_id, callback): + raise tooz.NotImplemented |