Commit Graph

17 Commits (2e051c1c610496ccfc44389ff89eab49504d7176)

Author SHA1 Message Date
Xiang Li f5753f2f51 *: support lease Attach
Now we can attach keys to leases. And revoking the lease removes all
the attached keys of that lease.
2016-01-09 11:01:58 -08:00
Anthony Romano f9af744be3 lease: move storage.NoLease to lease package 2016-01-07 10:33:44 -08:00
Xiang Li 5dd3f91903 *: make backend outside kv
KV and lease will share the same backend. Thus we need to make
backend outside KV.
2016-01-05 19:55:29 -08:00
Anthony Romano 21a6ade53d storage: change type of WatchIDs from int64 to WatchID 2016-01-04 19:52:22 -08:00
Gyu-Ho Lee 556d4a6932 *: remove CancelFunc return for Watch. Use Cancel for watch. 2016-01-04 16:17:55 -08:00
Xiang Li 4336278b44 *: support put with lease 2016-01-04 15:54:06 -08:00
Gyu-Ho Lee 6540f47dfa *: WatchResponse for multiple Events with WatchID
storage/storagepb: remove watchID from Event

storage: add WatchResponse to watcher.go to wrap events, watchID

storage: watchableStore to use WatchResponse

storage: kv_test with WatchResponse

etcdserver/api/v3rpc: watch to receive storage.WatchResponse type
2016-01-03 16:32:48 -08:00
Xiang Li 807db7e2aa storage: rename watching -> watcher 2016-01-02 20:20:22 -08:00
Xiang Li ee0b3f42ed *: rename watcher to watchStream
Watcher vs Watching in storage pkg is confusing. Watcher should be named
as watchStream since it contains a channel as stream to send out events.
Then we can rename watching to watcher, which actually watches on a key
and send watched events through watchStream.

This commits renames watcher to watchStram.
2016-01-02 16:03:57 -08:00
Gyu-Ho Lee 7dd599b69d Merge pull request #4091 from gyuho/watch_events_slice
storage: watch events in slice
2015-12-31 23:54:08 -08:00
Gyu-Ho Lee 14a0268ebc storage: watchable_store_test.go events slice 2015-12-31 23:44:02 -08:00
Hitoshi Mitake 0b2d31f3bc storage: decouple default parameters and storage creation
newStore() uses constants for some important parameters
e.g. batchInerval. It is not suitable for other storage users
(e.g. tools/benchmark). This commit decouples the default parameters
from storage creation. etcd should use a newly added function
newDefaultStore() for creating a store with default parameters.
2015-12-31 22:28:59 +09:00
Gyu-Ho Lee d64eb94580 storage: clean up test variable names, minor typos in comments
This just changes variable name to be more consistent: `N` rather than `Size`.
And fix some minor grammatical errors.
2015-12-28 11:49:57 -08:00
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