Browse Source

Merge pull request #3731 from yichengq/storage-kv

storage: fix WatchableKV interface and refine comment
Yicheng Qin 10 years ago
parent
commit
8b08fff1e9
2 changed files with 5 additions and 5 deletions
  1. 4 4
      storage/kv.go
  2. 1 1
      storage/kv_test.go

+ 4 - 4
storage/kv.go

@@ -93,13 +93,13 @@ type Watcher interface {
 type WatchableKV interface {
 	KV
 
-	// Watcher watches the events happening or happened in etcd. The whole
-	// event history can be watched unless compacted.
+	// Watcher watches the events happening or happened on the given key
+	// or key prefix from the given startRev.
+	// The whole event history can be watched unless compacted.
 	// If `prefix` is true, watch observes all events whose key prefix could be the given `key`.
 	// If `startRev` <=0, watch observes events after currentRev.
-	// If `endRev` <=0, watch observes events until watch is cancelled.
 	//
 	// Canceling the watcher releases resources associated with it, so code
 	// should always call cancel as soon as watch is done.
-	Watcher(key []byte, prefix bool, startRev, endRev int64) (Watcher, CancelFunc)
+	Watcher(key []byte, prefix bool, startRev int64) (Watcher, CancelFunc)
 }

+ 1 - 1
storage/kv_test.go

@@ -730,7 +730,7 @@ func TestKVSnapshot(t *testing.T) {
 }
 
 func TestWatchableKVWatch(t *testing.T) {
-	s := newWatchableStore(tmpPath)
+	s := WatchableKV(newWatchableStore(tmpPath))
 	defer cleanup(s, tmpPath)
 
 	wa, cancel := s.Watcher([]byte("foo"), true, 0)