removed unused old methods send_get_request and send_del_request
removed unnecessary comments
This commit is contained in:
lampayan 2016-06-22 09:51:46 +02:00
parent 8ae3a250dd
commit 366f10506c
4 changed files with 4 additions and 30 deletions

View File

@ -135,8 +135,6 @@ namespace etcd
protected: protected:
pplx::task<Response> send_get_request(web::http::uri_builder & uri);
pplx::task<Response> send_del_request(web::http::uri_builder & uri);
pplx::task<Response> send_put_request(web::http::uri_builder & uri, std::string const & key, std::string const & value); pplx::task<Response> send_put_request(web::http::uri_builder & uri, std::string const & key, std::string const & value);
web::http::client::http_client client; web::http::client::http_client client;

View File

@ -34,16 +34,6 @@ etcd::Client::Client(std::string const & address)
watchServiceStub= Watch::NewStub(channel); watchServiceStub= Watch::NewStub(channel);
} }
pplx::task<etcd::Response> etcd::Client::send_get_request(web::http::uri_builder & uri)
{
return Response::create(client.request(web::http::methods::GET, uri.to_string()));
}
pplx::task<etcd::Response> etcd::Client::send_del_request(web::http::uri_builder & uri)
{
return Response::create(client.request(web::http::methods::DEL, uri.to_string()));
}
pplx::task<etcd::Response> etcd::Client::send_put_request(web::http::uri_builder & uri, std::string const & key, std::string const & value) pplx::task<etcd::Response> etcd::Client::send_put_request(web::http::uri_builder & uri, std::string const & key, std::string const & value)
{ {
std::string data = key + "=" + value; std::string data = key + "=" + value;

View File

@ -1,10 +1,3 @@
/*
* Transaction.hpp
*
* Created on: Jun 21, 2016
* Author: ubuntu
*/
#ifndef V3_SRC_TRANSACTION_HPP_ #ifndef V3_SRC_TRANSACTION_HPP_
#define V3_SRC_TRANSACTION_HPP_ #define V3_SRC_TRANSACTION_HPP_
@ -38,6 +31,6 @@ private:
std::string key; std::string key;
}; };
} /* namespace etcdv3 */ }
#endif /* V3_SRC_TRANSACTION_HPP_ */ #endif

View File

@ -1,10 +1,3 @@
/*
* Transaction.cpp
*
* Created on: Jun 21, 2016
* Author: ubuntu
*/
#include "v3/include/Transaction.hpp" #include "v3/include/Transaction.hpp"
using etcdserverpb::Compare; using etcdserverpb::Compare;
@ -50,10 +43,10 @@ void etcdv3::Transaction::init_compare(int old_index, Compare::CompareResult res
* get key on failure * get key on failure
*/ */
void etcdv3::Transaction::setup_basic_failure_operation(std::string const& key) { void etcdv3::Transaction::setup_basic_failure_operation(std::string const& key) {
std::unique_ptr<RangeRequest> get_request(new RangeRequest()); //then this can be just a raw pointer std::unique_ptr<RangeRequest> get_request(new RangeRequest());
get_request->set_key(key); get_request->set_key(key);
RequestOp* req_failure = txn_request.add_failure(); RequestOp* req_failure = txn_request.add_failure();
req_failure->set_allocated_request_range(get_request.release()); //why not get()? req_failure->set_allocated_request_range(get_request.release());
} }
/** /**