Commit Graph

37 Commits

Author SHA1 Message Date
Alexandre Beslic 6a92628ddb Add ErrKeyModified error to etcd and zookeeper
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-27 08:09:33 -07:00
Alexandre Beslic 97e54273e3 Add Zookeeper CAS
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-26 20:12:31 -07:00
Victor Vieux 44d7437ef0 Merge pull request #849 from abronan/cas_return_last_index
Return last index on CAS operation
2015-05-26 15:57:20 -07:00
Alexandre Beslic 142030f65d Fix comment
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-26 15:03:03 -07:00
Alexandre Beslic dedb0ed906 Fix zookeeper watch that was triggered only once
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-26 14:59:38 -07:00
Alexandre Beslic 1040ec06e4 Return last index on CAS operation
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-26 10:39:26 -07:00
Alexandre Beslic 86b144859a Add FIXME for the leader value staying set although all machines are gone
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-21 18:30:54 -07:00
Alexandre Beslic 055551a0c8 Enhance zookeeper lock with value support
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-21 11:19:38 -07:00
Andrea Luzzardi 78839ba4ea store: Improved locking API and added mocks.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-19 20:14:28 -07:00
Alexandre Beslic b8d72c291d Cleanup, fix Integration tests and use of a single global Session in Consul
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 15:27:39 -07:00
Alexandre Beslic f81de46ab4 Fix Consul and etcd with latest changes, use etcd v2.0.11 for integration tests, remove call to SyncCluster for now (breaks the integration tests)
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 10:25:31 -07:00
Alexandre Beslic 4408a9cc8c Add Ephemeral for Consul, Zookeeper and Etcd (Etcd abd Consul are using TTLs in the background)
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 10:25:31 -07:00
Andrea Luzzardi f49ca7e20f store: Mock stores can now be created
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi 3e4e74c5a1 store: Close channels in case of errors in Watch/WatchTree.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-15 13:37:51 -07:00
Andrea Luzzardi c77f7332a0 store: Fixes to etcd and zk WatchTree
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-15 13:37:51 -07:00
Andrea Luzzardi 7d7e4aee13 store: Watch: Use channels instead of callbacks.
This gets rid of `CancelWatch*` functions and its usage is much simpler.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-15 13:37:51 -07:00
Andrea Luzzardi 60cfbc89c2 store: fix gofmt
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-15 00:23:38 -07:00
Andrea Luzzardi 0f61855877 store: Get rid of "discovery" log messages
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 22:35:14 -07:00
Andrea Luzzardi a897fa04d5 store: Watch/WatchTree: Removed unused params
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 22:25:26 -07:00
Andrea Luzzardi f87505e2e7 store: KVEntry -> KVPair
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 22:00:27 -07:00
Andrea Luzzardi 895484ec2a store: WatchRange -> WatchTree
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 21:58:02 -07:00
Andrea Luzzardi 1d3aa013db store: DeleteRange -> DeleteTree
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 21:58:02 -07:00
Andrea Luzzardi 6f41eabdae store: GetRange -> List
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 21:58:02 -07:00
Andrea Luzzardi bd18f27bda store: Refactor Atomic operations to use KVEntry.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 21:58:02 -07:00
Andrea Luzzardi 93ad39c079 store: Use KVEntry in Get() for consistency with GetRange()
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 21:58:02 -07:00
Andrea Luzzardi d4bdb10d35 store: Make KVEntry a struct rather than an interface.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 21:58:02 -07:00
Andrea Luzzardi 23481131c4 store: Add a channel to lock that is closed if our lock is lost or an error.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 17:35:57 -07:00
Andrea Luzzardi 250a17e954 Merge pull request #780 from abronan/improve_helpers
Refactor helpers for storage key formatting
2015-05-14 17:02:58 -07:00
Andrea Luzzardi 9d055d6bf8 pkg/store: Pass Options as pointer, not value.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-13 19:00:39 -07:00
Alexandre Beslic ccf6e37c16 Refactor helpers to be more meaningful and flexible for future store usage
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-13 18:02:48 -07:00
Andrea Luzzardi f4bd5834fa store: Improved Lock support.
- New interface: `store.CreateLock` returns a `Locker` interface with
  `Lock` and `Unlock` functions.
- Consul: New locking implementation leveraging helper lock
  implementation that comes with the go library.
- ZK: Lock support using the library helpers.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-13 16:15:19 -07:00
Victor Vieux 0b45fa5154 user varargs in store the watch callback
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
2015-05-13 15:42:44 -07:00
Madhu Venugopal 0130c2262d GetRange and WatchRange to return {key,value,index} tuple
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-13 11:24:03 -07:00
Alexandre Beslic 6f67ca3a58 replace variadic method options for simple Config struct, correct Consul Watch method
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-12 14:00:55 -07:00
Alexandre Beslic 8909dfda63 Fix zookeeper watch methods with key being formatted twice before given to GetRange
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-11 19:07:21 -07:00
Alexandre Beslic d333da5284 remove log info for default case in SetOptions
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-11 17:49:40 -07:00
Alexandre Beslic 59e1e9b942 Change existing discovery backends to 'kv' using metatada storage backends in the store package
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-11 17:23:55 -07:00