Commit Graph

72 Commits

Author SHA1 Message Date
Tao He 23a44f54da Fixes test cases
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-01-10 14:23:36 +08:00
Tao He 0624711824 Fixes test cases
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-01-10 14:14:07 +08:00
Tao He 8cbc70aafb Enable keys() to list elements without fetching values from server
Signed-off-by: Tao He <sighingnow@gmail.com>
2023-01-10 14:04:07 +08:00
Tao He c7f17cdf0d Fixes the descirption in the docs, and revisit the order of test cases.
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-10-18 09:21:06 +08:00
Tao He 1e72df7ca3 Add test cases and documentation to show that binary data as key/value works well.
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-10-18 00:52:01 +08:00
Tao He 1fb5abac28
Implements the "etcdctl lease list" functionality (#174)
* Implements the "etcdctl lease list" functionalities.
* LeaseLeases requires etcd >= 3.3

Signed-off-by: Tao He <sighingnow@gmail.com>
2022-10-13 00:04:18 +08:00
Tao He ab255467d0
Taking error code from grpc. (#172)
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-10-09 10:25:50 +08:00
Tao He 1108d986a7
Add transaction tests and documentations (#164)
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-09-27 11:31:06 +08:00
Tao He 39be27e021
Add a sync variant of lock on async client. (#163)
Resolves #139.

Lock is special, as it may cause the thread resources (in the pplx
thread pool) to be exhausted.

Signed-off-by: Tao He <sighingnow@gmail.com>
2022-09-20 21:20:58 +08:00
Tao He ed7ab08ef7 Limit C++ flags to this library itself.
Resolves #159.

Signed-off-by: Tao He <sighingnow@gmail.com>
2022-09-20 20:11:10 +08:00
Tao He e5f1167c69 Implements the timeout feature to the etcd client.
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-05-22 22:57:38 +08:00
Tao He 8da8946409 Refactor the implementation of sync-client and async-client.
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-05-22 21:42:06 +08:00
Tao He bd4ec37ff4 Use int64_t for etcd revisions/indexes.
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-04-21 18:52:34 +08:00
Tao He 680e8ad5c6 Replace Tabs in sources and README with spaces.
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-04-08 20:49:56 +08:00
Tao He 56c7189f92 Revisit the watcher's reconnect functionality.
Address #73, #76, #117 and #118.

Signed-off-by: Tao He <sighingnow@gmail.com>
2022-04-08 19:55:31 +08:00
Tao He 345380a83a
Allow specifying the auth token TTL when auth with password. (#109)
* Allow specifying the auth token TTL when auth with password.
* Fixes.

Resolves #107.

Signed-off-by: Tao He <sighingnow@gmail.com>
2021-12-22 14:30:45 +08:00
Tao He 6a0b6696e5 Fixes the hardcode language standard in CMakeLists.txt.
Signed-off-by: Tao He <sighingnow@gmail.com>
2021-12-22 10:16:38 +08:00
Matthew Fioravante bfb56be151
Expose key version in etcd::Value (#97) 2021-10-27 12:49:34 +08:00
Matthew Fioravante 1118222b3d
Make revision numbers 64 bit to match proto spec (#96)
* Make Response::index() 64 bit

* make compact_revision 64 bit

* Make input revision params 64 bit

* make Transaction mod revision 64 bit

* Make Value created and modified index 64 bit

* Fix tests
2021-10-27 10:51:49 +08:00
Tao He 6eed82a766
Fixes memory leak in shutting down gRPC streams. (#88)
* Fixes memory leak in shutting down gRPC streams.

Resolve #86.

Signed-off-by: Tao He <sighingnow@gmail.com>
2021-09-23 14:51:29 +08:00
Tao He cda80854eb
Implements "v3election.proto" APIs. (#84)
Resolves #81.

Signed-off-by: Tao He <sighingnow@gmail.com>
2021-09-16 00:46:21 +08:00
Tao He 116b49b784
Lint source code, improve the quality and readability. (#82)
* Lint the source first, prepare for implementing #81.

Signed-off-by: Tao He <sighingnow@gmail.com>
2021-09-15 14:59:55 +08:00
Tao He efcecb7731 Add a "head" method on the client the retrieve the latest revision.
Signed-off-by: Tao He <sighingnow@gmail.com>
2021-06-16 17:10:32 +08:00
Tao He e80709418b Avoid including protobuf & grpc headers in our interface files.
Signed-off-by: Tao He <sighingnow@gmail.com>
2021-05-27 22:10:24 +08:00
Tao He eab29edaf0 Fixes unused warnings.
Signed-off-by: Tao He <sighingnow@gmail.com>
2021-05-25 13:29:36 +08:00
Tao He 9e77fdb2ee
Fixes lock, and the underlying keepalive implmentation. (#60)
* Fixes lock, and the underlying keepalive implmentation.

The previous implementation is buggy when a lot of locks happen at the same time,
as the cpprestsdk's threadpool use a fixed number of thread for posix platform:

https://github.com/microsoft/cpprestsdk/blob/master/Release/src/pplx/threadpool.cpp#L198

Signed-off-by: Tao He <sighingnow@gmail.com>
2021-05-21 18:05:35 +08:00
Tao He b3ce183889
Expose the etcdv3::detail::string_plus_one method. (#56)
Signed-off-by: Tao He <sighingnow@gmail.com>
2021-04-08 10:33:39 +08:00
Tao He 3e30c4c61d
Optimize the implementation of error handling in keep alive. (#54)
Signed-off-by: Tao He <sighingnow@gmail.com>
2021-04-07 23:20:33 +08:00
Tao He cee938fb0a Use UTF-8 char U+0000 as terminate charactor.
Allow setting range end as `NULL`, see also #50.

Signed-off-by: Tao He <sighingnow@gmail.com>
2021-04-07 15:08:51 +08:00
Tao He 52d757f14a Make the watcher test more stable on CI.
Signed-off-by: Tao He <sighingnow@gmail.com>
2021-04-07 09:39:15 +08:00
Tao He 62a846d798
Handling (or checking) possible failure in lease's KeepAlive. (#53)
* Handling (or checking) possible failure in lease's KeepAlive.
* Add documentation.
* Enhance documentations.

Signed-off-by: Tao He <sighingnow@gmail.com>
2021-04-02 17:15:27 +08:00
Tao He 27e6e2ac11
Watch on range by specifying `rang_end`. (#52)
Follow-up work on #51, and fixes #50.

Signed-off-by: Tao He <sighingnow@gmail.com>
2021-04-02 01:34:58 +08:00
Tao He 1b24751b9d
List/delete/watch on exact range. (#51)
Signed-off-by: Tao He <sighingnow@gmail.com>
2021-04-01 14:50:50 +08:00
Tao He 03baacf9ea
Support secure transport and certificate-based authentication. (#42)
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2021-02-07 01:35:37 +08:00
Tao He 692840cb58 Support ubuntu 18.04 (boost-1.65), and test it in CI. 2021-01-30 14:43:16 +08:00
Tao He 6962030db8 Implements "KeepAlive" feature, and enhance "lock" with a lease.
Signed-off-by: Tao He <sighingnow@gmail.com>
2021-01-10 23:39:50 +08:00
Tao He e286c36926 Fixes for windows (vcpkg environment) compatibility.
Signed-off-by: Tao He <sighingnow@gmail.com>
2020-12-20 00:19:47 +08:00
Tao He dd1f106150 Make "CancelWatch()" thread-safe and happen only once, fixes the potential assert failure in gRPC routines.
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2020-10-15 19:56:23 +08:00
Tao He 7fe755ae53 Make sure a cancalable watch must be a successful watch.
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2020-10-12 13:19:23 +08:00
Tao He eb284103e0 Auto and watch functionalities on SyncClient.
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2020-10-10 20:17:32 +08:00
Tao He 0fb4f2887d Implements etcd v3 authentication.
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2020-10-10 20:17:32 +08:00
Tao He 65271bb92d Enhance tests and improve documents about about build & install.
Should fixes #2, #4.

Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2020-10-01 01:47:43 +08:00
Tao He 12f59ca48e Enable github CI.
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2020-09-30 15:26:58 +08:00
Tao He 60ffe62b26 Update accumulated changes.
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2020-09-30 00:32:00 +08:00
Tao He 4e9d17c188 Update protobuf, implments lock, fixes watch and improves txn (#1) 2020-09-30 00:32:00 +08:00
Arches 0c52135bf8 Deleted junk files
Added #include <grpc/support/log.h> since this is where GPR_ASSERT is now defined.
2016-12-13 11:14:49 +01:00
Arches e37cb46922 First commit 2016-08-29 16:14:57 +02:00
arches 888946b589 Added new interface for leasegrant and leaseId in add, set, modify, modify_if 2016-07-13 07:56:43 -04:00
arches 93f8131e83 put deleted keys in values() when prefix = true. 2016-07-13 06:46:56 -04:00
arches 82034a87db Updated makefiles 2016-07-13 05:54:27 -04:00