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
30c880dd05
Document the `client.observe()` API.
...
Resolves #148 .
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-10-24 14:53:10 +08:00
Tao He
2f15c45d4e
Protect the timer to avoid "cancel" and "refresh" happens at the same time. ( #179 )
...
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-10-24 10:29:38 +08:00
Tao He
9f09066b47
Fixes the timeout parameter and some improvements to find non-standard installed deps. ( #178 )
...
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-10-17 13:18:36 +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
bbcab86eab
Fixes the format of comment lines
...
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-10-10 23:31:39 +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
c81f3fb211
Watcher: add constructors to accept the wait callback. ( #169 )
...
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-09-29 15:18:15 +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
2ed6cacce9
Add more variants for etcd::Watcher's constructor. ( #144 )
...
* Add more variants for etcd::Watcher's constructor.
* Use ASAN for testing on CI.
* Revert "Use ASAN for testing on CI."
This reverts commit 6ccc2161da .
2022-07-19 20:42:44 +08:00
Tao He
7c9b9e5699
Enable grpc timeout support in keepalive's refresh.
...
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-05-24 00:20:55 +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
9a5267286b
Use a explicit copy constructor as we noticed stack-buffer-overflow inside the copy ctor when ASAN is enabled
...
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-04-24 10:30:10 +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
f70255c8b0
Revert "Add support to re-activate watcher from wait_callback in watcher async wait."
...
This reverts commit 0467c0eef3 .
2022-04-08 19:55:31 +08:00
Tao He
d4975f84b3
Return complete meta information of HEAD. ( #123 )
...
* Return complete meta information of HEAD.
* Fixes the CI by revisiting the LD_LIBRARY_PATH.
Signed-off-by: Tao He <sighingnow@gmail.com>
2022-04-06 16:01:49 +08:00
David Pastor
0467c0eef3
Add support to re-activate watcher from wait_callback in watcher async wait.
...
Returns wait result when cancelling watcher.
2022-03-29 19:39:04 +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
405383c0ba
Add a new API to `client.observe()` that accepts a callback.
...
Resolves #108 .
Signed-off-by: Tao He <sighingnow@gmail.com>
2021-12-22 10:30:46 +08:00
Tao He
0d672ffa1c
Accept an `grpc::ChannelArguments` argument in client's constructors. ( #104 )
...
* Accept an `grpc::ChannelArguments` argument in client's constructors.
Resolves #103 .
* Backwards compatibility with Ubuntu 18.04.
Signed-off-by: Tao He <sighingnow@gmail.com>
2021-11-09 00:31:59 +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
d29e05545d
Implements the put action.
...
Signed-off-by: Tao He <sighingnow@gmail.com>
2021-10-12 10:17:25 +08:00
Matthew Fioravante
e9db91b335
Allow changing Transaction key ( #93 )
...
* Allow changing Transaction key
* Fixes the compilation errors.
Signed-off-by: Matthew Fioravante <fmatthew5876@gmail.com>
Co-authored-by: Tao He <sighingnow@gmail.com>
2021-10-08 11:12:35 +08:00
Tao He
b99dc2024e
Include compact revision for cancelled watch response. ( #91 )
...
Signed-off-by: Tao He <sighingnow@gmail.com>
2021-09-28 11:24:11 +08:00
Tao He
a949dec288
Add an optional `target_name_override` to support multiple-endpoints with SSL. ( #89 )
...
Resolves #87 .
Signed-off-by: Tao He <sighingnow@gmail.com>
2021-09-24 02:41:46 +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
230ebfd08b
Avoid duplicate const string tags. ( #62 )
...
On behalf of Asplund, Rickard, thanks!
Signed-off-by: Tao He <sighingnow@gmail.com>
2021-05-28 23:22:32 +08:00
Tao He
4dda2db5a1
Compatible with older version of gRPC.
...
Signed-off-by: Tao He <sighingnow@gmail.com>
2021-05-27 23:13:04 +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
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
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
rockeet
9339b6dee4
class Value: remove unused code ( #48 )
2021-03-29 18:53:56 +08:00
Tao He
c9f82b46d4
Allows specify a lease TTL for lock.
...
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2021-02-08 11:07:23 +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
d2e35ceb47
Reduce the dependency interface to avoid include all generated protobuf/grpc files. ( #41 )
...
Add CMake config files to make it looks as a cmake module.
Fixes https://github.com/etcd-cpp-apiv3/etcd-cpp-apiv3/issues/37 .
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2021-02-06 17:16:58 +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
e5c804416c
Protect implicit keepalive maps using a lexical scoped lock.
...
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2021-01-12 01:11:35 +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
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
3305a19d15
Drop the Interceptor-based implementation to be compatible with ealier version of gRPC (pre-0.17.0).
...
Signed-off-by: Tao He <linzhu.ht@alibaba-inc.com>
2020-10-10 20:17:32 +08:00