4 Commits

Author SHA1 Message Date
Gyu-Ho Lee
28d0e473a7 storage: add more tests for synced, unsynced for watchable store
This adds more tests on functions that updates synced and unsynced in watchable
store. Preparatory change for https://github.com/coreos/etcd/issues/3848.
2015-12-21 20:20:08 -08:00
Gyu-Ho Lee
ff2e8b55ae storage: add tests for unsafeAddWatching
This adds map operation tests for unsafeAddWatching, which
could have been failed without https://github.com/coreos/etcd/pull/3939.
It tests if unsafeAddWatching is correctly updating synced map.
2015-12-02 14:18:07 -08:00
Yicheng Qin
deb1da5f57 storage: add watch ID to identify watchings
One watcher includes multiple watchings, and their events are
sent out through one channel. For the received event, user would like to
know which watching it belongs to.

Introduce a watch ID. When watching on some key, user will get a watch
ID. The watch ID is attached to all events that is observed by this
watch.
2015-11-21 11:19:17 -08:00
Gyu-Ho Lee
48aebd9b09 storage: use map for watchableStore synced
This is for coreos#3859 switching slice to map for synced watchings.
For a large amount of synced watchings, map implementation performs better.
When putting 1 million watchers on the same key and canceling them one by
one: original implementation takes 9m7.268221091s, while the one with map
takes only 430.531637ms.
2015-11-21 00:42:09 -08:00