diff --git a/etcd/Client.hpp b/etcd/Client.hpp index eb5f143..60e4bad 100644 --- a/etcd/Client.hpp +++ b/etcd/Client.hpp @@ -223,7 +223,7 @@ namespace etcd * @param value is the new value to be set * @param old_index is the expected index of the original value */ - pplx::task modify_if(std::string const & key, std::string const & value, int old_index, int ttl = 0); + pplx::task modify_if(std::string const & key, std::string const & value, int64_t old_index, int ttl = 0); /** * Modifies an existing key only if it has a specific modification index value. Fails if the key @@ -233,7 +233,7 @@ namespace etcd * @param old_index is the expected index of the original value * @param leaseId is the lease attached to the key */ - pplx::task modify_if(std::string const & key, std::string const & value, int old_index, int64_t leaseId); + pplx::task modify_if(std::string const & key, std::string const & value, int64_t old_index, int64_t leaseId); /** * Removes a single key. The key has to point to a plain, non directory entry. @@ -254,7 +254,7 @@ namespace etcd * @param key is the key to be deleted * @param old_index is the expected index of the existing value */ - pplx::task rm_if(std::string const & key, int old_index); + pplx::task rm_if(std::string const & key, int64_t old_index); /** * Gets a directory listing of the directory identified by the key. @@ -333,7 +333,7 @@ namespace etcd * @param fromIndex the first index we are interested in * @param recursive if true watch a whole subtree */ - pplx::task watch(std::string const & key, int fromIndex, bool recursive = false); + pplx::task watch(std::string const & key, int64_t fromIndex, bool recursive = false); /** * Watches for changes of a range of keys inside [key, range_end). @@ -362,7 +362,7 @@ namespace etcd * @param range_end is the end of key range to be removed. * @param fromIndex the first index we are interested in */ - pplx::task watch(std::string const & key, std::string const &range_end, int fromIndex); + pplx::task watch(std::string const & key, std::string const &range_end, int64_t fromIndex); /** * Grants a lease. @@ -450,7 +450,7 @@ namespace etcd * @param value is the new value to set. */ pplx::task proclaim(std::string const &name, int64_t lease_id, - std::string const &key, int revision, std::string const &value); + std::string const &key, int64_t revision, std::string const &value); /** * Get the current leader proclamation. @@ -497,7 +497,7 @@ namespace etcd * @param revision is the created revision of key-value returned by @campaign@ */ pplx::task resign(std::string const &name, int64_t lease_id, - std::string const &key, int revision); + std::string const &key, int64_t revision); private: #if defined(WITH_GRPC_CHANNEL_CLASS) diff --git a/etcd/SyncClient.hpp b/etcd/SyncClient.hpp index e978464..50b3a1e 100644 --- a/etcd/SyncClient.hpp +++ b/etcd/SyncClient.hpp @@ -51,11 +51,11 @@ namespace etcd Response modify(std::string const & key, std::string const & value, int64_t leaseId); Response modify_if(std::string const & key, std::string const & value, std::string const & old_value, int ttl = 0); Response modify_if(std::string const & key, std::string const & value, std::string const & old_value, int64_t leaseId); - Response modify_if(std::string const & key, std::string const & value, int old_index, int ttl = 0); - Response modify_if(std::string const & key, std::string const & value, int old_index, int64_t leaseId); + Response modify_if(std::string const & key, std::string const & value, int64_t old_index, int ttl = 0); + Response modify_if(std::string const & key, std::string const & value, int64_t old_index, int64_t leaseId); Response rm(std::string const & key); Response rm_if(std::string const & key, std::string const & old_value); - Response rm_if(std::string const & key, int old_index); + Response rm_if(std::string const & key, int64_t old_index); Response ls(std::string const & key); Response ls(std::string const & key, size_t const limit); Response ls(std::string const & key, std::string const &range_end); @@ -71,13 +71,13 @@ namespace etcd Response campaign(std::string const &name, int64_t lease_id, std::string const &value); Response proclaim(std::string const &name, int64_t lease_id, - std::string const &key, int revision, std::string const &value); + std::string const &key, int64_t revision, std::string const &value); Response leader(std::string const &name); std::unique_ptr observe(std::string const &name, std::function callback, const bool once = false); Response resign(std::string const &name, int64_t lease_id, - std::string const &key, int revision); + std::string const &key, int64_t revision); /** * Watches for changes of a key or a subtree. Please note that if you watch e.g. "/testdir" and @@ -97,8 +97,8 @@ namespace etcd * @param fromIndex the first index we are interested in * @param recursive if true watch a whole subtree */ - Response watch(std::string const & key, int fromIndex, bool recursive = false); - Response watch(std::string const & key, std::string const &range_end, int fromIndex); + Response watch(std::string const & key, int64_t fromIndex, bool recursive = false); + Response watch(std::string const & key, std::string const &range_end, int64_t fromIndex); protected: Client client; diff --git a/etcd/v3/Action.hpp b/etcd/v3/Action.hpp index 46c1785..9c99e41 100644 --- a/etcd/v3/Action.hpp +++ b/etcd/v3/Action.hpp @@ -30,8 +30,8 @@ namespace etcdv3 { ActionParameters(); bool withPrefix; - int revision; - int old_revision; + int64_t revision; + int64_t old_revision; int64_t lease_id = 0; // no lease int ttl; int limit; diff --git a/src/Client.cpp b/src/Client.cpp index 7f5a700..15a20ef 100644 --- a/src/Client.cpp +++ b/src/Client.cpp @@ -472,7 +472,7 @@ pplx::task etcd::Client::modify_if(std::string const & key, std: return Response::create(call); } -pplx::task etcd::Client::modify_if(std::string const & key, std::string const & value, int old_index, int ttl) +pplx::task etcd::Client::modify_if(std::string const & key, std::string const & value, int64_t old_index, int ttl) { etcdv3::ActionParameters params; params.auth_token.assign(this->auth_token); @@ -500,7 +500,7 @@ pplx::task etcd::Client::modify_if(std::string const & key, std: return Response::create(call); } -pplx::task etcd::Client::modify_if(std::string const & key, std::string const & value, int old_index, int64_t leaseid) +pplx::task etcd::Client::modify_if(std::string const & key, std::string const & value, int64_t old_index, int64_t leaseid) { etcdv3::ActionParameters params; params.auth_token.assign(this->auth_token); @@ -538,7 +538,7 @@ pplx::task etcd::Client::rm_if(std::string const & key, std::str return Response::create(call); } -pplx::task etcd::Client::rm_if(std::string const & key, int old_index) +pplx::task etcd::Client::rm_if(std::string const & key, int64_t old_index) { etcdv3::ActionParameters params; params.auth_token.assign(this->auth_token); @@ -640,7 +640,7 @@ pplx::task etcd::Client::watch(std::string const & key, bool rec return Response::create(call); } -pplx::task etcd::Client::watch(std::string const & key, int fromIndex, bool recursive) +pplx::task etcd::Client::watch(std::string const & key, int64_t fromIndex, bool recursive) { etcdv3::ActionParameters params; params.auth_token.assign(this->auth_token); @@ -669,7 +669,7 @@ pplx::task etcd::Client::watch(std::string const & key, std::str return Response::create(call); } -pplx::task etcd::Client::watch(std::string const & key, std::string const & range_end, int fromIndex) +pplx::task etcd::Client::watch(std::string const & key, std::string const & range_end, int64_t fromIndex) { etcdv3::ActionParameters params; params.auth_token.assign(this->auth_token); @@ -835,7 +835,7 @@ pplx::task etcd::Client::campaign( pplx::task etcd::Client::proclaim( std::string const &name, int64_t lease_id, - std::string const &key, int revision, std::string const &value) { + std::string const &key, int64_t revision, std::string const &value) { etcdv3::ActionParameters params; params.auth_token.assign(this->auth_token); params.name = name; @@ -871,7 +871,7 @@ std::unique_ptr etcd::Client::observe( } pplx::task etcd::Client::resign( - std::string const &name, int64_t lease_id, std::string const &key, int revision) { + std::string const &name, int64_t lease_id, std::string const &key, int64_t revision) { etcdv3::ActionParameters params; params.auth_token.assign(this->auth_token); params.name = name; diff --git a/src/SyncClient.cpp b/src/SyncClient.cpp index 55c60e3..cd068c3 100644 --- a/src/SyncClient.cpp +++ b/src/SyncClient.cpp @@ -78,12 +78,12 @@ etcd::Response etcd::SyncClient::modify_if(std::string const & key, std::string CHECK_EXCEPTIONS(client.modify_if(key, value, old_value, leaseId).get()); } -etcd::Response etcd::SyncClient::modify_if(std::string const & key, std::string const & value, int old_index, int ttl) +etcd::Response etcd::SyncClient::modify_if(std::string const & key, std::string const & value, int64_t old_index, int ttl) { CHECK_EXCEPTIONS(client.modify_if(key, value, old_index, ttl).get()); } -etcd::Response etcd::SyncClient::modify_if(std::string const & key, std::string const & value, int old_index, int64_t leaseId) +etcd::Response etcd::SyncClient::modify_if(std::string const & key, std::string const & value, int64_t old_index, int64_t leaseId) { CHECK_EXCEPTIONS(client.modify_if(key, value, old_index, leaseId).get()); } @@ -98,7 +98,7 @@ etcd::Response etcd::SyncClient::rm_if(std::string const & key, std::string cons CHECK_EXCEPTIONS(client.rm_if(key, old_value).get()); } -etcd::Response etcd::SyncClient::rm_if(std::string const & key, int old_index) +etcd::Response etcd::SyncClient::rm_if(std::string const & key, int64_t old_index) { CHECK_EXCEPTIONS(client.rm_if(key, old_index).get()); } @@ -161,7 +161,7 @@ etcd::Response etcd::SyncClient::campaign(std::string const &name, int64_t lease } etcd::Response etcd::SyncClient::proclaim(std::string const &name, int64_t lease_id, - std::string const &key, int revision, + std::string const &key, int64_t revision, std::string const &value) { CHECK_EXCEPTIONS(client.proclaim(name, lease_id, key, revision, value).get()); @@ -180,7 +180,7 @@ std::unique_ptr etcd::SyncClient::observe( } etcd::Response etcd::SyncClient::resign(std::string const &name, int64_t lease_id, - std::string const &key, int revision) + std::string const &key, int64_t revision) { CHECK_EXCEPTIONS(client.resign(name, lease_id, key, revision).get()); } @@ -190,7 +190,7 @@ etcd::Response etcd::SyncClient::watch(std::string const & key, bool recursive) CHECK_EXCEPTIONS(client.watch(key, recursive).get()); } -etcd::Response etcd::SyncClient::watch(std::string const & key, int fromIndex, bool recursive) +etcd::Response etcd::SyncClient::watch(std::string const & key, int64_t fromIndex, bool recursive) { CHECK_EXCEPTIONS(client.watch(key, fromIndex, recursive).get()); } @@ -205,7 +205,7 @@ etcd::Response etcd::SyncClient::watch(std::string const & key, std::string cons CHECK_EXCEPTIONS(client.watch(key, range_end).get()); } -etcd::Response etcd::SyncClient::watch(std::string const & key, std::string const &range_end, int fromIndex) +etcd::Response etcd::SyncClient::watch(std::string const & key, std::string const &range_end, int64_t fromIndex) { CHECK_EXCEPTIONS(client.watch(key, range_end, fromIndex).get()); }