From 895484ec2a56b8e0cae65ed406e515be6aa8146f Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Thu, 14 May 2015 21:40:36 -0700 Subject: [PATCH] store: WatchRange -> WatchTree Signed-off-by: Andrea Luzzardi --- discovery/kv/kv.go | 2 +- pkg/store/consul.go | 2 +- pkg/store/etcd.go | 2 +- pkg/store/store.go | 2 +- pkg/store/zookeeper.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/discovery/kv/kv.go b/discovery/kv/kv.go index 8f6420a7ca..d5167a33ec 100644 --- a/discovery/kv/kv.go +++ b/discovery/kv/kv.go @@ -71,7 +71,7 @@ func (s *Discovery) Fetch() ([]*discovery.Entry, error) { // Watch is exported func (s *Discovery) Watch(callback discovery.WatchCallback) { - s.store.WatchRange(s.prefix, "", s.heartbeat, func(kv ...*store.KVEntry) { + s.store.WatchTree(s.prefix, "", s.heartbeat, func(kv ...*store.KVEntry) { // Traduce byte array entries to discovery.Entry entries, _ := discovery.CreateEntries(convertToStringArray(kv)) callback(entries) diff --git a/pkg/store/consul.go b/pkg/store/consul.go index 37ef86e8db..6b02b93dbf 100644 --- a/pkg/store/consul.go +++ b/pkg/store/consul.go @@ -211,7 +211,7 @@ func (s *Consul) waitForChange(key string) <-chan uint64 { } // WatchRange triggers a watch on a range of values at "directory" -func (s *Consul) WatchRange(prefix string, filter string, heartbeat time.Duration, callback WatchCallback) error { +func (s *Consul) WatchTree(prefix string, filter string, heartbeat time.Duration, callback WatchCallback) error { fprefix := s.normalize(prefix) // We get the last index first diff --git a/pkg/store/etcd.go b/pkg/store/etcd.go index eb4bcfd76d..1f070e37af 100644 --- a/pkg/store/etcd.go +++ b/pkg/store/etcd.go @@ -216,7 +216,7 @@ func (s *Etcd) DeleteTree(prefix string) error { } // WatchRange triggers a watch on a range of values at "directory" -func (s *Etcd) WatchRange(prefix string, filter string, _ time.Duration, callback WatchCallback) error { +func (s *Etcd) WatchTree(prefix string, filter string, _ time.Duration, callback WatchCallback) error { prefix = normalize(prefix) watchChan := make(chan *etcd.Response) stopChan := make(chan bool) diff --git a/pkg/store/store.go b/pkg/store/store.go index 2fec94e237..d51ad24e87 100644 --- a/pkg/store/store.go +++ b/pkg/store/store.go @@ -60,7 +60,7 @@ type Store interface { DeleteTree(prefix string) error // Watch key namespaces - WatchRange(prefix string, filter string, heartbeat time.Duration, callback WatchCallback) error + WatchTree(prefix string, filter string, heartbeat time.Duration, callback WatchCallback) error // Cancel watch key range CancelWatchRange(prefix string) error diff --git a/pkg/store/zookeeper.go b/pkg/store/zookeeper.go index cda538c6df..78eff7bc6a 100644 --- a/pkg/store/zookeeper.go +++ b/pkg/store/zookeeper.go @@ -161,7 +161,7 @@ func (s *Zookeeper) DeleteTree(prefix string) error { } // WatchRange triggers a watch on a range of values at "directory" -func (s *Zookeeper) WatchRange(prefix string, filter string, _ time.Duration, callback WatchCallback) error { +func (s *Zookeeper) WatchTree(prefix string, filter string, _ time.Duration, callback WatchCallback) error { fprefix := normalize(prefix) _, _, eventChan, err := s.client.ChildrenW(fprefix) if err != nil {