Commit d1ce3bba authored by Vishal's avatar Vishal

Initial commit

parent cd63d3af
KVServer @ 466ce622
Subproject commit 466ce6225632c0b6be4a7fb45671c528bb5b4972
#include <fstream>
#include "unistd.h"
#include <iostream>
#include <memory>
#include <string>
#include <grpc/support/log.h>
#include <grpcpp/grpcpp.h>
#include <thread>
#include "keyvaluepackage.grpc.pb.h"
#include "helper.h"
#include <chrono>
#include <ctime>
using grpc::Channel;
using grpc::ClientAsyncResponseReader;
using grpc::ClientContext;
using grpc::CompletionQueue;
using grpc::Status;
using keyvaluepackage::KV;
using keyvaluepackage::GetKeyRequest;
using keyvaluepackage::Reply;
using keyvaluepackage::PutKeyRequest;
using keyvaluepackage::DelKeyRequest;
std::fstream myfile;
std::chrono::time_point<std::chrono::system_clock> start, end;
class GreeterClient {
public:
explicit GreeterClient(std::shared_ptr <Channel> channel)
: stub_(KV::NewStub(channel)) {}
void GET(const std::string& k)
{
GetKeyRequest request;
request.set_key(k);
AsyncClientCall* call = new AsyncClientCall;
call->response_reader = stub_->PrepareAsyncGET(&call->context,request,&cq_);
call->response_reader->StartCall();
call->response_reader->Finish(&call->reply,&call->status,(void *)call);
return;
}
void PUT(const std::string& k,const std::string& k2)
{
PutKeyRequest request;
request.set_key(k);
request.set_value(k2);
AsyncClientCall* call = new AsyncClientCall;
call->response_reader = stub_->PrepareAsyncPUT(&call->context,request,&cq_);
call->response_reader->StartCall();
call->response_reader->Finish(&call->reply,&call->status,(void *)call);
}
void DEL(const std::string& k)
{
DelKeyRequest request;
request.set_key(k);
AsyncClientCall* call = new AsyncClientCall;
call->response_reader = stub_->PrepareAsyncDEL(&call->context,request,&cq_);
call->response_reader->StartCall();
call->response_reader->Finish(&call->reply,&call->status,(void *)call);
}
void AsyncCompleteRpc() {
void* got_tag;
bool ok = false;
// Block until the next result is available in the completion queue "cq".
while (cq_.Next(&got_tag, &ok)) {
// The tag in this example is the memory location of the call object
AsyncClientCall* call = static_cast<AsyncClientCall*>(got_tag);
// Verify that the request was completed successfully. Note that "ok"
// corresponds solely to the request for updates introduced by Finish().
GPR_ASSERT(ok);
if (call->status.ok())
{
// std::cout<<call->reply.key()<<" "<<call->reply.value()<<std::endl;
myfile.open("per.txt",myfile.out);
end = std::chrono::system_clock::now();
std::chrono::duration<double> elapsed_seconds = end - start;
myfile << std::to_string(elapsed_seconds.count());
myfile.close();
}
else
std::cout << "RPC failed" << std::endl;
// Once we're complete, deallocate the call object.
delete call;
}
}
private:
// struct for keeping state and data information
struct AsyncClientCall {
// Container for the data we expect from the server.
keyvaluepackage::Reply reply;
// Context for the client. It could be used to convey extra information to
// the server and/or tweak certain RPC behaviors.
ClientContext context;
// Storage for the status of the RPC upon completion.
Status status;
std::unique_ptr<ClientAsyncResponseReader<keyvaluepackage::Reply>> response_reader;
};
// Out of the passed in Channel comes the stub, stored here, our view of the
// server's exposed services.
std::unique_ptr<KV::Stub> stub_;
// The producer-consumer queue we use to communicate asynchronously with the
// gRPC runtime.
CompletionQueue cq_;
};
int main(int argc, char** argv) {
struct conf configData= print();
GreeterClient greeter(grpc::CreateChannel(
"localhost:"+ std::to_string(configData.port), grpc::InsecureChannelCredentials()));
std::thread thread = std::thread(&GreeterClient::AsyncCompleteRpc, &greeter);
std::string s1,s2,user;
std::string a;
//start
start = std::chrono::system_clock::now();
while (std::cin>>a)
{
// std::cout<<"1 For get"<<std::endl;
// std::cout<<"2 For put"<<std::endl;
// std::cout<<"3 For del"<<std::endl;
if(a=="1")
{
std::cin>>user;
greeter.GET(user);
} else if(a=="2")
{
std::cin>>s1>>s2;
greeter.PUT(s1,s2);
} else if(a=="3")
{
std::cin>>s1;
greeter.DEL(s1);
} else
{
std::cout<<"Please start a client again(Ctrl + C) and give a valid input"<<std::endl;
break;
}
}//10000 -> request
//end
//response =(end-start)/10000
//end-start= 10000/(end-start)
end = std::chrono::system_clock::now();
std::chrono::duration<double> elapsed_seconds = end - start;
// std::cout << "finished computation at " << std::ctime(&end_time)
// << "elapsed time: " << elapsed_seconds.count() << "s\n";
int total=10000;
double throughput=total/(elapsed_seconds.count());
double response=elapsed_seconds.count()/total;
// std::cout<<throughput<<" "<<response<<std::endl;
thread.join();
return 0;
}
#include <bits/stdc++.h>
#include "mutex"
#include "vector"
#include "helper.h"
#include "unistd.h"
#include <iostream>
#include <memory>
#include <string>
#include <thread>
#include "unordered_map"
#include <grpc/support/log.h>
#include <grpcpp/grpcpp.h>
#include "unordered_map"
#include "utility"
#include "keyvaluepackage.grpc.pb.h"
#include <iterator>
#include <set>
#include <list>
#include <fstream>
using grpc::Server;
using grpc::ServerAsyncResponseWriter;
using grpc::ServerBuilder;
using grpc::ServerCompletionQueue;
using grpc::ServerContext;
using grpc::Status;
using keyvaluepackage::KV;
using keyvaluepackage::GetKeyRequest;
using keyvaluepackage::Reply;
using keyvaluepackage::PutKeyRequest;
using keyvaluepackage::DelKeyRequest;
std::mutex door;
std::unordered_map<std::string,std::pair<int,std::string>> keyFeqValue;
std::set<std::pair<int,std::string>> feqKeq;
int NUM_OF_RECORD;
std::mutex m,serverlck;
std::list<std::pair<std::string, std::string>> cacheLRU;
std::unordered_map<std::string, std::list<std::pair<std::string, std::string>>::iterator> cacheLRUMap;
int cacheLRU_size = 100;
std::pair<int, int> search_key(int file_number, std::string key) {
std::fstream myfile;
std::string file_name = std::to_string(file_number).append(".txt");
myfile.open(file_name, myfile.out| myfile.in);
myfile.seekg(0, myfile.end);
int file_length = myfile.tellg();
// std::cout << file_length << '\n';
int num_records = file_length / 513;
char key_record[257];
char val_record[257];
key_record[256] = '\0';
val_record[256] = '\0';
char status[1];
std::string my_key;
std::string my_val;
int last_empty_record = -1;
bool flag = false;
myfile.seekg(0, myfile.beg);
int key_line_index = -1;
// std::cout << num_records;
for (int i = 0; i < num_records; i++) {
my_key = "";
my_val = "";
myfile.read(status, 1);
// myfile.seekg(1, myfile.cur);
myfile.read(key_record, 256);
// myfile.seekg(256, myfile.cur);
myfile.read(val_record, 256);
// myfile.seekg(256, myfile.cur);
for(int j = 0; j < 256; j++) {
if (key_record[j] == ' ') break;
// std::cout << key_record[j];
my_key += key_record[j];
}
for(int j = 0; j < 256; j++) {
if (val_record[j] == ' ') break;
my_val += val_record[j];
}
if (status[0] == '1') {
if (my_key == key) {
// found record.
// std::cout << "hahsdasd";
key_line_index = i;
break;
}
} else {
last_empty_record = i;
}
}
myfile.close();
return std::make_pair(key_line_index, last_empty_record);
}
std::pair<std::string, std::string> get_from_file(int file_number, std::string key) {
std::pair<int, int> search_result = search_key(file_number, key);
char key_record[257];
char val_record[257];
key_record[256] = '\0';
val_record[256] = '\0';
char status[1];
std::string my_key;
std::string my_val;
std::fstream myfile;
std::string file_name = std::to_string(file_number).append(".txt");
myfile.open(file_name, myfile.out| myfile.in);
if (search_result.first != -1) {
// std::cout << "hoora";
// found the entry
myfile.seekg(search_result.first * 513, myfile.beg);
myfile.read(status, 1);
// myfile.seekg(1, myfile.cur);
myfile.read(key_record, 256);
// myfile.seekg(256, myfile.cur);
// std::cout << myfile.tellg() << '\n';
myfile.read(val_record, 256);
// myfile.seekg(256, myfile.cur);
// std::cout << val_record[0] << '\n';
for(int j = 0; j < 256; j++) {
if (key_record[j] == ' ') break;
// std::cout << key_record[j];
my_key += key_record[j];
}
for(int j = 0; j < 256; j++) {
if (val_record[j] == ' ') break;
my_val += val_record[j];
}
myfile.close();
return std::make_pair(my_key, my_val);
}
myfile.close();
return std::make_pair("NULL", "NULL");
}
void put_to_file(int file_number, std::string key, std::string value) {
std::pair<int, int> search_result = search_key(file_number, key);
char key_record[257];
char val_record[257];
key_record[256] = '\0';
val_record[256] = '\0';
char status[1];
std::string my_key;
std::string my_val;
std::fstream myfile;
std::string file_name = std::to_string(file_number).append(".txt");
myfile.open(file_name, myfile.out| myfile.in);
if (search_result.first != -1) {
// std::cout << "hoora";
// found the entry
myfile.seekg(search_result.first * 513 + 256 + 1, myfile.beg);
std::string padding(256-value.size(), ' ');
myfile << value.c_str();
// myfile.write(value.c_str(), value.size());
myfile << padding.c_str();
} else {
if (search_result.second != -1) {
myfile.seekg(search_result.second * 513, myfile.beg);
} else {
myfile.seekg(0, myfile.end);
}
status[0] = '1';
myfile << status[0];
// myfile.write(status, 1);
std::string padding_1(256-key.size(), ' ');
myfile << key.c_str();
// myfile.write(key.c_str(), key.size());
myfile << padding_1.c_str();
// myfile.write(padding_1.c_str(), padding_1.size());
std::string padding_2(256-value.size(), ' ');
myfile << value.c_str();
// myfile.write(value.c_str(), value.size());
myfile << padding_2.c_str();
// myfile.write(padding_2.c_str(), padding_2.size());
}
myfile.close();
}
int del_from_file(int file_number, std::string key) {
std::pair<int, int> search_result = search_key(file_number, key);
char key_record[257];
char val_record[257];
key_record[256] = '\0';
val_record[256] = '\0';
char status[1];
std::string my_key;
std::string my_val;
std::fstream myfile;
std::string file_name = std::to_string(file_number).append(".txt");
myfile.open(file_name, myfile.out| myfile.in);
if (search_result.first != -1) {
// std::cout << "hoora";
// found the entry
myfile.seekg(search_result.first * 513, myfile.beg);
status[0] = '0';
myfile << status[0];
myfile.close();
return 0;
}
myfile.close();
return -1;
}
int create_files(int num_files) {
std::fstream myfile;
for (int i = 0; i < num_files; i++) {
myfile.open(std::to_string(i).append(".txt"), myfile.out);
if (myfile.fail()) {
// unsuccessful to create and open a file.
std::cout << "unsuccessful" << i << '\n';
return -1;
}
myfile.close();
}
return 0;
}
class ServerImpl final {
public:
~ServerImpl() {
server_->Shutdown();
// Always shutdown the completion queue after the server.
cq_[0]->Shutdown();
}
void Run(struct conf configData) {
NUM_OF_RECORD=configData.cache_size/512;
std::string server_address("0.0.0.0:"+ std::to_string(configData.port));
ServerBuilder builder;
// Listen on the given address without any authentication mechanism.
builder.AddListeningPort(server_address, grpc::InsecureServerCredentials());
// Register "service_" as the instance through which we'll communicate with
// clients. In this case it corresponds to an *asynchronous* service.
builder.RegisterService(&service_);
create_files(100);
// Get hold of the completion queue used for the asynchronous communication
// with the gRPC runtime.
for (int i = 0; i < configData.thread_pool; ++i) {
cq_.push_back( builder.AddCompletionQueue());
}
// Finally assemble the server.
server_ = builder.BuildAndStart();
std::cout << "Server listening on" << server_address << std::endl;
// Proceed to the server's main loop.
std::thread th[configData.thread_pool];
int arr[100];
for (int i = 0; i < configData.thread_pool; ++i) {
arr[i]=i;
if(configData.cache_replacement=="LRU")
th[i]=std::thread(&ServerImpl::HandleRpcsLRU, this,arr[i]);
else {
th[i] = std::thread(&ServerImpl::HandleRpcsLFU, this, arr[i]);
}
}
for (int i = 0; i < configData.thread_pool; ++i) {
th[i].join();
}
}
private:
// Class encompasing the state and logic needed to serve a request.
class CallDataLRU {
public:
CallDataLRU(KV::AsyncService * service, ServerCompletionQueue * cq, int type)
: service_(service), responder_(&ctx_), cq_(cq), status_(CREATE)
{
type_of_request = type;
// Invoke the serving logic right away.
Proceed();
}
std::pair<std::string, std::string> get_value(std::string key)
{
m.lock();
int sum = 0;
int file_number = -1;
for (char ch:key) {
sum += ch;
}
file_number = sum % 100;
std::string fetched_value = "";
if (cacheLRUMap.find(key) == cacheLRUMap.end()) {
// cache entry not found. find it from file.
fetched_value = "NOT FOUND";
fetched_value = get_from_file(file_number, key).second;
// check if the cache is full
if (cacheLRU.size() == cacheLRU_size) {
// deleting the least recently used entry which is stored at the last
std::pair<std::string, std::string> last = cacheLRU.back();
cacheLRU.pop_back();
// deleting the map entry
cacheLRUMap.erase(last.first);
}
} else {
fetched_value = (*cacheLRUMap[key]).second;
cacheLRU.erase(cacheLRUMap[key]);
}
// putting the recently accessed key-value pair at the front
std::pair<std::string, std::string> key_val(key, fetched_value);
cacheLRU.push_front(key_val);
cacheLRUMap[key] = cacheLRU.begin();
m.unlock();
return key_val;
}
void put_key_value(std::string key, std::string value)
{
m.lock();
int sum = 0;
int file_number = -1;
for (char ch:key) {
sum += ch;
}
file_number = sum % 100;
std::pair<std::string, std::string> key_val(key, value);
// check if the cache is full
if (cacheLRU.size() == cacheLRU_size) {
// deleting the least recently used entry which is stored at the last
std::pair<std::string, std::string> last = cacheLRU.back();
cacheLRU.pop_back();
// deleting the map entry
cacheLRUMap.erase(last.first);
}
// putting the recently accessed key-value pair at the front
cacheLRU.push_front(key_val);
cacheLRUMap[key] = cacheLRU.begin();
// Store the key-value pair in a file
put_to_file(file_number, key, value);
m.unlock();
}
int delete_key_value(std::string key)
{
m.lock();
int sum = 0;
int file_number = -1;
for (char ch:key) {
sum += ch;
}
file_number = sum % 100;
if (cacheLRUMap.find(key) != cacheLRUMap.end()) {
cacheLRU.erase(cacheLRUMap[key]);
cacheLRUMap.erase(key);
}
// delete key-value entry from the file
int status = del_from_file(file_number, key);
m.unlock();
return status;
}
void Proceed() {
if (status_ == CREATE) {
// Make this instance progress to the PROCESS state.
status_ = PROCESS;
// As part of the initial CREATE state, we *request* that the system
// start processing SayHello requests. In this request, "this" acts are
// the tag uniquely identifying the request (so that different CallData
// instances can serve different requests concurrently), in this case
// the memory address of this CallData instance.
if(type_of_request==0){
service_->RequestGET(&ctx_,&request_get,&responder_,cq_,cq_,this);
}else if(type_of_request==1){
service_->RequestPUT(&ctx_,&request_put,&responder_,cq_,cq_,this);
}else if(type_of_request==2){
service_->RequestDEL(&ctx_,&request_del,&responder_,cq_,cq_,this);
}
}
else if (status_ == PROCESS) {
//business logic
if(request_get.key()!="")
{
new CallDataLRU(service_, cq_, 0);
if(request_get.key().size()>256)
{
reply_.set_key(request_get.key());
reply_.set_value("Error key size long...");
std::unique_lock <std::mutex> lock(serverlck);
std::ofstream serverHandle("serverLog.txt", std::ios_base::app);
serverHandle << "Connection Not Estable\n";
serverHandle << "Error key size long...\n";
serverHandle.close();
} else {
std::string requested_key = request_get.key();
std::pair <std::string, std::string> fetched_key_value = get_value(requested_key);
reply_.set_key(fetched_key_value.first);
reply_.set_value(fetched_key_value.second);
// i m get service...
std::ofstream serverHandle("serverLog.txt", std::ios_base::app);
serverHandle << "Connection Estable\n";
serverHandle << "Method GET Parameter "<<request_get.key()<<" Reply value :"<<reply_.key()<<" "<<reply_.value()<<"\n";
serverHandle.close();
}
}
else if(request_put.key()!="")
{
new CallDataLRU(service_, cq_, 1);
if(request_put.key().size()>256 || request_put.key().size()>256 )
{
reply_.set_key(request_put.key());
reply_.set_value("Error key size long...");
std::unique_lock <std::mutex> lock(serverlck);
std::ofstream serverHandle("serverLog.txt", std::ios_base::app);
serverHandle << "Connection Not Estable\n";
serverHandle << "Error key or value size long...\n";
serverHandle.close();
}
else {
std::string requested_key = request_put.key();
std::string requested_value = request_put.value();
put_key_value(requested_key, requested_value);
reply_.set_value("Success");
reply_.set_key(requested_key);
// i m put service...
std::unique_lock <std::mutex> lock(serverlck);
std::ofstream serverHandle("serverLog.txt", std::ios_base::app);
serverHandle << "Connection Estable\n";
serverHandle << "Method PUT Parameter "<<request_put.key()<<" "<<request_put.value()<<" Reply value :"<<reply_.key()<<" "<<reply_.value();
serverHandle.close();
}
}
else if( request_del.key()!="" )
{
new CallDataLRU(service_, cq_, 2);
if(request_del.key().size()>256)
{
reply_.set_key(request_get.key());
reply_.set_value("Error key size long...");
std::unique_lock <std::mutex> lock(serverlck);
std::ofstream serverHandle("serverLog.txt", std::ios_base::app);
serverHandle << "Connection Not Estable\n";
serverHandle << "Error key size long...\n";
serverHandle.close();
}
else {
std::string requested_key = request_del.key();
if(delete_key_value(requested_key)==-1){
reply_.set_value("Unsuccess");
} else{
reply_.set_value("Success");
}
reply_.set_key(requested_key);
//server lock
std::unique_lock <std::mutex> lock(serverlck);
std::ofstream serverHandle("serverLog.txt", std::ios_base::app);
serverHandle << "Connection Estable\n";
serverHandle << "Method GET Parameter "<<request_del.key()<<" Reply value :"<<reply_.key()<<" "<<reply_.value();
serverHandle.close();
}
}
// The actual processing.
status_ = FINISH;
responder_.Finish(reply_, Status::OK, this);
}
else {
GPR_ASSERT(status_ == FINISH);
// Once in the FINISH state, deallocate ourselves (CallData).
delete this;
}
}
private:
// The means of communication with the gRPC runtime for an asynchronous
// server.
int type_of_request;
KV::AsyncService* service_;
// The producer-consumer queue where for asynchronous server notifications.
ServerCompletionQueue* cq_;
// Context for the rpc, allowing to tweak aspects of it such as the use
// of compression, authentication, as well as to send metadata back to the
// client.
ServerContext ctx_;
// What we get from the client.
GetKeyRequest request_get;
PutKeyRequest request_put;
DelKeyRequest request_del;
// What we send back to the client.
keyvaluepackage::Reply reply_;
// The means to get back to the client.
ServerAsyncResponseWriter<keyvaluepackage::Reply> responder_;
// Let's implement a tiny state machine with the following states.
enum CallStatus { CREATE, PROCESS, FINISH };
CallStatus status_; // The current serving state.
};
// This can be run in multiple threads if needed.
void HandleRpcsLRU(int idx) {
// Spawn a new CallData instance to serve new clients.
new CallDataLRU(&service_, cq_[idx].get(), 0);
new CallDataLRU(&service_, cq_[idx].get(), 1);
new CallDataLRU(&service_, cq_[idx].get(), 2);
void* tag; // uniquely identifies a request.
bool ok;
while (true) {
// Block waiting to read the next event from the completion queue. The
// event is uniquely identified by its tag, which in this case is the
// memory address of a CallData instance.
// The return value of Next should always be checked. This return value
// tells us whether there is any kind of event or cq_ is shutting down.
GPR_ASSERT(cq_[idx]->Next(&tag, &ok));
GPR_ASSERT(ok);
static_cast<CallDataLRU*>(tag)->Proceed();
}
}
class CallDataLFU {
public:
CallDataLFU(KV::AsyncService * service, ServerCompletionQueue * cq, int type)
: service_(service), responder_(&ctx_), cq_(cq), status_(CREATE)
{
type_of_request = type;
// Invoke the serving logic right away.
Proceed();
}
void Proceed() {
if (status_ == CREATE) {
// Make this instance progress to the PROCESS state.
status_ = PROCESS;
// As part of the initial CREATE state, we *request* that the system
// start processing SayHello requests. In this request, "this" acts are
// the tag uniquely identifying the request (so that different CallData
// instances can serve different requests concurrently), in this case
// the memory address of this CallData instance.
if(type_of_request==0){
service_->RequestGET(&ctx_,&request_get,&responder_,cq_,cq_,this);
}else if(type_of_request==1){
service_->RequestPUT(&ctx_,&request_put,&responder_,cq_,cq_,this);
}else if(type_of_request==2){
service_->RequestDEL(&ctx_,&request_del,&responder_,cq_,cq_,this);
}
}
else if (status_ == PROCESS) {
// The actual processing.
if(request_get.key()!="")
{
new CallDataLFU(service_, cq_, 0);
if(request_get.key().size()>256)
{
reply_.set_key(request_get.key());
reply_.set_value("Error key size long...");
std::unique_lock <std::mutex> lock(serverlck);
std::ofstream serverHandle("serverLog.txt", std::ios_base::app);
serverHandle << "Connection Not Estable\n";
serverHandle << "Error key size long...\n";
serverHandle.close();
}
else {
// try to find in cache
auto it = keyFeqValue.find(request_get.key());
//Present into cache
if (it != keyFeqValue.end()) {
//lock require
std::unique_lock <std::mutex> lock(door);
std::pair<int, std::string> value = keyFeqValue[request_get.key()];
auto it1 = feqKeq.find({value.first, request_get.key()});
feqKeq.erase(it1);
keyFeqValue[request_get.key()] = {value.first + 1, value.second};
feqKeq.insert({value.first + 1, request_get.key()});
reply_.set_value(value.second);
reply_.set_key(request_get.key());
}
else {//don't present into cache
std::unique_lock <std::mutex> lock(door);
int sum = 0;
int file_number = -1;
for (char ch:request_get.key()) {
sum += ch;
}
file_number = sum % 100;
std::pair<std::string, std::string> returnVal=get_from_file(file_number,request_get.key());
if(returnVal.first=="NULL") {
reply_.set_value("NOT FOUND");
}
else
{
reply_.set_value(returnVal.second);
}
reply_.set_key(request_get.key());
}
std::unique_lock <std::mutex> lock(serverlck);
std::ofstream serverHandle("serverLog.txt", std::ios_base::app);
serverHandle << "Connection Estable\n";
serverHandle << "Method GET Parameter "<<request_get.key()<<" Reply value :"<<reply_.key()<<" "<<reply_.value()<<"\n";
serverHandle.close();
}
}
else if(request_put.key()!="")
{
new CallDataLFU(service_, cq_, 1);
if(request_put.key().size()>256 || request_put.key().size()>256 )
{
reply_.set_key(request_put.key());
reply_.set_value("Error key size long...");
std::unique_lock <std::mutex> lock(serverlck);
std::ofstream serverHandle("serverLog.txt", std::ios_base::app);
serverHandle << "Connection Not Estable\n";
serverHandle << "Error key or value size long...\n";
serverHandle.close();
}
else {
// i m put service...
auto it = keyFeqValue.find(request_put.key());
//Present into cache
if (it != keyFeqValue.end()) {
std::unique_lock <std::mutex> lock(door);
std::pair<int, std::string> value = keyFeqValue[request_put.key()];
auto it1 = feqKeq.find({value.first, request_put.key()});
feqKeq.erase(it1);
keyFeqValue[request_put.key()] = {value.first + 1, request_put.value()};
feqKeq.insert({value.first + 1, request_put.key()});
int sum = 0;
int file_number = -1;
for (char ch:request_put.key()) {
sum += ch;
}
file_number = sum % 100;
put_to_file(file_number,request_put.key(),request_put.value());
}
else {
std::unique_lock <std::mutex> lock(door);
keyFeqValue[request_put.key()] = {1, request_put.value()};
feqKeq.insert({1, request_put.key()});
int sum = 0;
int file_number = -1;
for (char ch:request_put.key()) {
sum += ch;
}
file_number = sum % 100;
put_to_file(file_number,request_put.key(),request_put.value());
if (feqKeq.size() > NUM_OF_RECORD) {
auto it = feqKeq.begin();
keyFeqValue.erase(it->second);
feqKeq.erase(it);
}
}
reply_.set_value("Success");
reply_.set_key(request_put.key());
//logic of file update
std::unique_lock <std::mutex> lock(serverlck);
std::ofstream serverHandle("serverLog.txt", std::ios_base::app);
serverHandle << "Connection Estable\n";
serverHandle << "Method PUT Parameter "<<request_put.key()<<" "<<request_put.value()<<" Reply value :"<<reply_.key()<<" "<<reply_.value();
serverHandle.close();
}
}
else if(request_del.key()!="")
{
new CallDataLFU(service_, cq_, 2);
if(request_del.key().size()>256)
{
reply_.set_key(request_get.key());
reply_.set_value("Error key size long...");
std::unique_lock <std::mutex> lock(serverlck);
std::ofstream serverHandle("serverLog.txt", std::ios_base::app);
serverHandle << "Connection Not Estable\n";
serverHandle << "Error key size long...\n";
serverHandle.close();
}
else {
auto it = keyFeqValue.find(request_del.key());
//Present into cache
if (it != keyFeqValue.end()) {
//lock require
std::unique_lock <std::mutex> lock(door);
std::pair<int, std::string> value = keyFeqValue[request_del.key()];
keyFeqValue.erase(request_del.key());
auto it1 = feqKeq.find({value.first, request_del.key()});
feqKeq.erase(it1);
int sum = 0;
int file_number = -1;
for (char ch:request_del.key()) {
sum += ch;
}
file_number = sum % 100;
if(del_from_file(file_number,request_del.key())==0){
reply_.set_value("delete Success");
} else
{
reply_.set_value("delete Unsccess");
}
}
else
{
std::unique_lock <std::mutex> lock(door);
int sum = 0;
int file_number = -1;
for (char ch:request_del.key()) {
sum += ch;
}
file_number = sum % 100;
if(del_from_file(file_number,request_del.key())==0){
reply_.set_value("delete Success");
} else
{
reply_.set_value("delete Unsccess");
}
}
reply_.set_key(request_del.key());
std::unique_lock <std::mutex> lock(serverlck);
std::ofstream serverHandle("serverLog.txt", std::ios_base::app);
serverHandle << "Connection Estable\n";
serverHandle << "Method GET Parameter "<<request_del.key()<<" Reply value :"<<reply_.key()<<" "<<reply_.value();
serverHandle.close();
}
}
status_ = FINISH;
responder_.Finish(reply_, Status::OK, this);
}
else {
GPR_ASSERT(status_ == FINISH);
// Once in the FINISH state, deallocate ourselves (CallData).
delete this;
}
}
private:
// The means of communication with the gRPC runtime for an asynchronous
// server.
int type_of_request;
KV::AsyncService* service_;
// The producer-consumer queue where for asynchronous server notifications.
ServerCompletionQueue* cq_;
// Context for the rpc, allowing to tweak aspects of it such as the use
// of compression, authentication, as well as to send metadata back to the
// client.
ServerContext ctx_;
// What we get from the client.
GetKeyRequest request_get;
PutKeyRequest request_put;
DelKeyRequest request_del;
// What we send back to the client.
keyvaluepackage::Reply reply_;
// The means to get back to the client.
ServerAsyncResponseWriter<keyvaluepackage::Reply> responder_;
// Let's implement a tiny state machine with the following states.
enum CallStatus { CREATE, PROCESS, FINISH };
CallStatus status_; // The current serving state.
};
// This can be run in multiple threads if needed.
void HandleRpcsLFU(int idx) {
// Spawn a new CallData instance to serve new clients.
new CallDataLFU(&service_, cq_[idx].get(), 0);
new CallDataLFU(&service_, cq_[idx].get(), 1);
new CallDataLFU(&service_, cq_[idx].get(), 2);
void* tag; // uniquely identifies a request.
bool ok;
while (true) {
// Block waiting to read the next event from the completion queue. The
// event is uniquely identified by its tag, which in this case is the
// memory address of a CallData instance.
// The return value of Next should always be checked. This return value
// tells us whether there is any kind of event or cq_ is shutting down.
GPR_ASSERT(cq_[idx]->Next(&tag, &ok));
GPR_ASSERT(ok);
static_cast<CallDataLFU*>(tag)->Proceed();
}
}
std::vector<std::unique_ptr<ServerCompletionQueue>> cq_;
KV::AsyncService service_;
std::unique_ptr<Server> server_;
};
int main(int argc, char** argv) {
//struct configData contain data of config file
struct conf configData = print();
ServerImpl server;
server.Run(configData);
return 0;
}
\ No newline at end of file
LISTENING_PORT 50005
CACHE_REPLACEMENT_TYPE LFU
CACHE_SIZE 10240
THREAD_POOL_SIZE 4
\ No newline at end of file
// Generated by the gRPC C++ plugin.
// If you make any local change, they will be lost.
// source: keyvaluepackage.proto
#include "keyvaluepackage.pb.h"
#include "keyvaluepackage.grpc.pb.h"
#include <functional>
#include <grpcpp/impl/codegen/async_stream.h>
#include <grpcpp/impl/codegen/async_unary_call.h>
#include <grpcpp/impl/codegen/channel_interface.h>
#include <grpcpp/impl/codegen/client_unary_call.h>
#include <grpcpp/impl/codegen/client_callback.h>
#include <grpcpp/impl/codegen/message_allocator.h>
#include <grpcpp/impl/codegen/method_handler.h>
#include <grpcpp/impl/codegen/rpc_service_method.h>
#include <grpcpp/impl/codegen/server_callback.h>
#include <grpcpp/impl/codegen/server_callback_handlers.h>
#include <grpcpp/impl/codegen/server_context.h>
#include <grpcpp/impl/codegen/service_type.h>
#include <grpcpp/impl/codegen/sync_stream.h>
namespace keyvaluepackage {
static const char* KV_method_names[] = {
"/keyvaluepackage.KV/GET",
"/keyvaluepackage.KV/PUT",
"/keyvaluepackage.KV/DEL",
};
std::unique_ptr< KV::Stub> KV::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) {
(void)options;
std::unique_ptr< KV::Stub> stub(new KV::Stub(channel, options));
return stub;
}
KV::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options)
: channel_(channel), rpcmethod_GET_(KV_method_names[0], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_PUT_(KV_method_names[1], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
, rpcmethod_DEL_(KV_method_names[2], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
{}
::grpc::Status KV::Stub::GET(::grpc::ClientContext* context, const ::keyvaluepackage::GetKeyRequest& request, ::keyvaluepackage::Reply* response) {
return ::grpc::internal::BlockingUnaryCall< ::keyvaluepackage::GetKeyRequest, ::keyvaluepackage::Reply, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_GET_, context, request, response);
}
void KV::Stub::async::GET(::grpc::ClientContext* context, const ::keyvaluepackage::GetKeyRequest* request, ::keyvaluepackage::Reply* response, std::function<void(::grpc::Status)> f) {
::grpc::internal::CallbackUnaryCall< ::keyvaluepackage::GetKeyRequest, ::keyvaluepackage::Reply, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GET_, context, request, response, std::move(f));
}
void KV::Stub::async::GET(::grpc::ClientContext* context, const ::keyvaluepackage::GetKeyRequest* request, ::keyvaluepackage::Reply* response, ::grpc::ClientUnaryReactor* reactor) {
::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GET_, context, request, response, reactor);
}
::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>* KV::Stub::PrepareAsyncGETRaw(::grpc::ClientContext* context, const ::keyvaluepackage::GetKeyRequest& request, ::grpc::CompletionQueue* cq) {
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::keyvaluepackage::Reply, ::keyvaluepackage::GetKeyRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_GET_, context, request);
}
::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>* KV::Stub::AsyncGETRaw(::grpc::ClientContext* context, const ::keyvaluepackage::GetKeyRequest& request, ::grpc::CompletionQueue* cq) {
auto* result =
this->PrepareAsyncGETRaw(context, request, cq);
result->StartCall();
return result;
}
::grpc::Status KV::Stub::PUT(::grpc::ClientContext* context, const ::keyvaluepackage::PutKeyRequest& request, ::keyvaluepackage::Reply* response) {
return ::grpc::internal::BlockingUnaryCall< ::keyvaluepackage::PutKeyRequest, ::keyvaluepackage::Reply, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_PUT_, context, request, response);
}
void KV::Stub::async::PUT(::grpc::ClientContext* context, const ::keyvaluepackage::PutKeyRequest* request, ::keyvaluepackage::Reply* response, std::function<void(::grpc::Status)> f) {
::grpc::internal::CallbackUnaryCall< ::keyvaluepackage::PutKeyRequest, ::keyvaluepackage::Reply, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_PUT_, context, request, response, std::move(f));
}
void KV::Stub::async::PUT(::grpc::ClientContext* context, const ::keyvaluepackage::PutKeyRequest* request, ::keyvaluepackage::Reply* response, ::grpc::ClientUnaryReactor* reactor) {
::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_PUT_, context, request, response, reactor);
}
::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>* KV::Stub::PrepareAsyncPUTRaw(::grpc::ClientContext* context, const ::keyvaluepackage::PutKeyRequest& request, ::grpc::CompletionQueue* cq) {
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::keyvaluepackage::Reply, ::keyvaluepackage::PutKeyRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_PUT_, context, request);
}
::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>* KV::Stub::AsyncPUTRaw(::grpc::ClientContext* context, const ::keyvaluepackage::PutKeyRequest& request, ::grpc::CompletionQueue* cq) {
auto* result =
this->PrepareAsyncPUTRaw(context, request, cq);
result->StartCall();
return result;
}
::grpc::Status KV::Stub::DEL(::grpc::ClientContext* context, const ::keyvaluepackage::DelKeyRequest& request, ::keyvaluepackage::Reply* response) {
return ::grpc::internal::BlockingUnaryCall< ::keyvaluepackage::DelKeyRequest, ::keyvaluepackage::Reply, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_DEL_, context, request, response);
}
void KV::Stub::async::DEL(::grpc::ClientContext* context, const ::keyvaluepackage::DelKeyRequest* request, ::keyvaluepackage::Reply* response, std::function<void(::grpc::Status)> f) {
::grpc::internal::CallbackUnaryCall< ::keyvaluepackage::DelKeyRequest, ::keyvaluepackage::Reply, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_DEL_, context, request, response, std::move(f));
}
void KV::Stub::async::DEL(::grpc::ClientContext* context, const ::keyvaluepackage::DelKeyRequest* request, ::keyvaluepackage::Reply* response, ::grpc::ClientUnaryReactor* reactor) {
::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_DEL_, context, request, response, reactor);
}
::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>* KV::Stub::PrepareAsyncDELRaw(::grpc::ClientContext* context, const ::keyvaluepackage::DelKeyRequest& request, ::grpc::CompletionQueue* cq) {
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::keyvaluepackage::Reply, ::keyvaluepackage::DelKeyRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_DEL_, context, request);
}
::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>* KV::Stub::AsyncDELRaw(::grpc::ClientContext* context, const ::keyvaluepackage::DelKeyRequest& request, ::grpc::CompletionQueue* cq) {
auto* result =
this->PrepareAsyncDELRaw(context, request, cq);
result->StartCall();
return result;
}
KV::Service::Service() {
AddMethod(new ::grpc::internal::RpcServiceMethod(
KV_method_names[0],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< KV::Service, ::keyvaluepackage::GetKeyRequest, ::keyvaluepackage::Reply, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](KV::Service* service,
::grpc::ServerContext* ctx,
const ::keyvaluepackage::GetKeyRequest* req,
::keyvaluepackage::Reply* resp) {
return service->GET(ctx, req, resp);
}, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod(
KV_method_names[1],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< KV::Service, ::keyvaluepackage::PutKeyRequest, ::keyvaluepackage::Reply, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](KV::Service* service,
::grpc::ServerContext* ctx,
const ::keyvaluepackage::PutKeyRequest* req,
::keyvaluepackage::Reply* resp) {
return service->PUT(ctx, req, resp);
}, this)));
AddMethod(new ::grpc::internal::RpcServiceMethod(
KV_method_names[2],
::grpc::internal::RpcMethod::NORMAL_RPC,
new ::grpc::internal::RpcMethodHandler< KV::Service, ::keyvaluepackage::DelKeyRequest, ::keyvaluepackage::Reply, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
[](KV::Service* service,
::grpc::ServerContext* ctx,
const ::keyvaluepackage::DelKeyRequest* req,
::keyvaluepackage::Reply* resp) {
return service->DEL(ctx, req, resp);
}, this)));
}
KV::Service::~Service() {
}
::grpc::Status KV::Service::GET(::grpc::ServerContext* context, const ::keyvaluepackage::GetKeyRequest* request, ::keyvaluepackage::Reply* response) {
(void) context;
(void) request;
(void) response;
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
::grpc::Status KV::Service::PUT(::grpc::ServerContext* context, const ::keyvaluepackage::PutKeyRequest* request, ::keyvaluepackage::Reply* response) {
(void) context;
(void) request;
(void) response;
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
::grpc::Status KV::Service::DEL(::grpc::ServerContext* context, const ::keyvaluepackage::DelKeyRequest* request, ::keyvaluepackage::Reply* response) {
(void) context;
(void) request;
(void) response;
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
} // namespace keyvaluepackage
// Generated by the gRPC C++ plugin.
// If you make any local change, they will be lost.
// source: keyvaluepackage.proto
// Original file comments:
// Copyright 2015 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef GRPC_keyvaluepackage_2eproto__INCLUDED
#define GRPC_keyvaluepackage_2eproto__INCLUDED
#include "keyvaluepackage.pb.h"
#include <functional>
#include <grpcpp/impl/codegen/async_generic_service.h>
#include <grpcpp/impl/codegen/async_stream.h>
#include <grpcpp/impl/codegen/async_unary_call.h>
#include <grpcpp/impl/codegen/client_callback.h>
#include <grpcpp/impl/codegen/client_context.h>
#include <grpcpp/impl/codegen/completion_queue.h>
#include <grpcpp/impl/codegen/message_allocator.h>
#include <grpcpp/impl/codegen/method_handler.h>
#include <grpcpp/impl/codegen/proto_utils.h>
#include <grpcpp/impl/codegen/rpc_method.h>
#include <grpcpp/impl/codegen/server_callback.h>
#include <grpcpp/impl/codegen/server_callback_handlers.h>
#include <grpcpp/impl/codegen/server_context.h>
#include <grpcpp/impl/codegen/service_type.h>
#include <grpcpp/impl/codegen/status.h>
#include <grpcpp/impl/codegen/stub_options.h>
#include <grpcpp/impl/codegen/sync_stream.h>
namespace keyvaluepackage {
// The greeting service definition.
class KV final {
public:
static constexpr char const* service_full_name() {
return "keyvaluepackage.KV";
}
class StubInterface {
public:
virtual ~StubInterface() {}
// Sends a greeting
virtual ::grpc::Status GET(::grpc::ClientContext* context, const ::keyvaluepackage::GetKeyRequest& request, ::keyvaluepackage::Reply* response) = 0;
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::keyvaluepackage::Reply>> AsyncGET(::grpc::ClientContext* context, const ::keyvaluepackage::GetKeyRequest& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::keyvaluepackage::Reply>>(AsyncGETRaw(context, request, cq));
}
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::keyvaluepackage::Reply>> PrepareAsyncGET(::grpc::ClientContext* context, const ::keyvaluepackage::GetKeyRequest& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::keyvaluepackage::Reply>>(PrepareAsyncGETRaw(context, request, cq));
}
virtual ::grpc::Status PUT(::grpc::ClientContext* context, const ::keyvaluepackage::PutKeyRequest& request, ::keyvaluepackage::Reply* response) = 0;
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::keyvaluepackage::Reply>> AsyncPUT(::grpc::ClientContext* context, const ::keyvaluepackage::PutKeyRequest& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::keyvaluepackage::Reply>>(AsyncPUTRaw(context, request, cq));
}
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::keyvaluepackage::Reply>> PrepareAsyncPUT(::grpc::ClientContext* context, const ::keyvaluepackage::PutKeyRequest& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::keyvaluepackage::Reply>>(PrepareAsyncPUTRaw(context, request, cq));
}
virtual ::grpc::Status DEL(::grpc::ClientContext* context, const ::keyvaluepackage::DelKeyRequest& request, ::keyvaluepackage::Reply* response) = 0;
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::keyvaluepackage::Reply>> AsyncDEL(::grpc::ClientContext* context, const ::keyvaluepackage::DelKeyRequest& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::keyvaluepackage::Reply>>(AsyncDELRaw(context, request, cq));
}
std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::keyvaluepackage::Reply>> PrepareAsyncDEL(::grpc::ClientContext* context, const ::keyvaluepackage::DelKeyRequest& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReaderInterface< ::keyvaluepackage::Reply>>(PrepareAsyncDELRaw(context, request, cq));
}
class async_interface {
public:
virtual ~async_interface() {}
// Sends a greeting
virtual void GET(::grpc::ClientContext* context, const ::keyvaluepackage::GetKeyRequest* request, ::keyvaluepackage::Reply* response, std::function<void(::grpc::Status)>) = 0;
virtual void GET(::grpc::ClientContext* context, const ::keyvaluepackage::GetKeyRequest* request, ::keyvaluepackage::Reply* response, ::grpc::ClientUnaryReactor* reactor) = 0;
virtual void PUT(::grpc::ClientContext* context, const ::keyvaluepackage::PutKeyRequest* request, ::keyvaluepackage::Reply* response, std::function<void(::grpc::Status)>) = 0;
virtual void PUT(::grpc::ClientContext* context, const ::keyvaluepackage::PutKeyRequest* request, ::keyvaluepackage::Reply* response, ::grpc::ClientUnaryReactor* reactor) = 0;
virtual void DEL(::grpc::ClientContext* context, const ::keyvaluepackage::DelKeyRequest* request, ::keyvaluepackage::Reply* response, std::function<void(::grpc::Status)>) = 0;
virtual void DEL(::grpc::ClientContext* context, const ::keyvaluepackage::DelKeyRequest* request, ::keyvaluepackage::Reply* response, ::grpc::ClientUnaryReactor* reactor) = 0;
};
typedef class async_interface experimental_async_interface;
virtual class async_interface* async() { return nullptr; }
class async_interface* experimental_async() { return async(); }
private:
virtual ::grpc::ClientAsyncResponseReaderInterface< ::keyvaluepackage::Reply>* AsyncGETRaw(::grpc::ClientContext* context, const ::keyvaluepackage::GetKeyRequest& request, ::grpc::CompletionQueue* cq) = 0;
virtual ::grpc::ClientAsyncResponseReaderInterface< ::keyvaluepackage::Reply>* PrepareAsyncGETRaw(::grpc::ClientContext* context, const ::keyvaluepackage::GetKeyRequest& request, ::grpc::CompletionQueue* cq) = 0;
virtual ::grpc::ClientAsyncResponseReaderInterface< ::keyvaluepackage::Reply>* AsyncPUTRaw(::grpc::ClientContext* context, const ::keyvaluepackage::PutKeyRequest& request, ::grpc::CompletionQueue* cq) = 0;
virtual ::grpc::ClientAsyncResponseReaderInterface< ::keyvaluepackage::Reply>* PrepareAsyncPUTRaw(::grpc::ClientContext* context, const ::keyvaluepackage::PutKeyRequest& request, ::grpc::CompletionQueue* cq) = 0;
virtual ::grpc::ClientAsyncResponseReaderInterface< ::keyvaluepackage::Reply>* AsyncDELRaw(::grpc::ClientContext* context, const ::keyvaluepackage::DelKeyRequest& request, ::grpc::CompletionQueue* cq) = 0;
virtual ::grpc::ClientAsyncResponseReaderInterface< ::keyvaluepackage::Reply>* PrepareAsyncDELRaw(::grpc::ClientContext* context, const ::keyvaluepackage::DelKeyRequest& request, ::grpc::CompletionQueue* cq) = 0;
};
class Stub final : public StubInterface {
public:
Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions());
::grpc::Status GET(::grpc::ClientContext* context, const ::keyvaluepackage::GetKeyRequest& request, ::keyvaluepackage::Reply* response) override;
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>> AsyncGET(::grpc::ClientContext* context, const ::keyvaluepackage::GetKeyRequest& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>>(AsyncGETRaw(context, request, cq));
}
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>> PrepareAsyncGET(::grpc::ClientContext* context, const ::keyvaluepackage::GetKeyRequest& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>>(PrepareAsyncGETRaw(context, request, cq));
}
::grpc::Status PUT(::grpc::ClientContext* context, const ::keyvaluepackage::PutKeyRequest& request, ::keyvaluepackage::Reply* response) override;
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>> AsyncPUT(::grpc::ClientContext* context, const ::keyvaluepackage::PutKeyRequest& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>>(AsyncPUTRaw(context, request, cq));
}
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>> PrepareAsyncPUT(::grpc::ClientContext* context, const ::keyvaluepackage::PutKeyRequest& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>>(PrepareAsyncPUTRaw(context, request, cq));
}
::grpc::Status DEL(::grpc::ClientContext* context, const ::keyvaluepackage::DelKeyRequest& request, ::keyvaluepackage::Reply* response) override;
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>> AsyncDEL(::grpc::ClientContext* context, const ::keyvaluepackage::DelKeyRequest& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>>(AsyncDELRaw(context, request, cq));
}
std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>> PrepareAsyncDEL(::grpc::ClientContext* context, const ::keyvaluepackage::DelKeyRequest& request, ::grpc::CompletionQueue* cq) {
return std::unique_ptr< ::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>>(PrepareAsyncDELRaw(context, request, cq));
}
class async final :
public StubInterface::async_interface {
public:
void GET(::grpc::ClientContext* context, const ::keyvaluepackage::GetKeyRequest* request, ::keyvaluepackage::Reply* response, std::function<void(::grpc::Status)>) override;
void GET(::grpc::ClientContext* context, const ::keyvaluepackage::GetKeyRequest* request, ::keyvaluepackage::Reply* response, ::grpc::ClientUnaryReactor* reactor) override;
void PUT(::grpc::ClientContext* context, const ::keyvaluepackage::PutKeyRequest* request, ::keyvaluepackage::Reply* response, std::function<void(::grpc::Status)>) override;
void PUT(::grpc::ClientContext* context, const ::keyvaluepackage::PutKeyRequest* request, ::keyvaluepackage::Reply* response, ::grpc::ClientUnaryReactor* reactor) override;
void DEL(::grpc::ClientContext* context, const ::keyvaluepackage::DelKeyRequest* request, ::keyvaluepackage::Reply* response, std::function<void(::grpc::Status)>) override;
void DEL(::grpc::ClientContext* context, const ::keyvaluepackage::DelKeyRequest* request, ::keyvaluepackage::Reply* response, ::grpc::ClientUnaryReactor* reactor) override;
private:
friend class Stub;
explicit async(Stub* stub): stub_(stub) { }
Stub* stub() { return stub_; }
Stub* stub_;
};
class async* async() override { return &async_stub_; }
private:
std::shared_ptr< ::grpc::ChannelInterface> channel_;
class async async_stub_{this};
::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>* AsyncGETRaw(::grpc::ClientContext* context, const ::keyvaluepackage::GetKeyRequest& request, ::grpc::CompletionQueue* cq) override;
::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>* PrepareAsyncGETRaw(::grpc::ClientContext* context, const ::keyvaluepackage::GetKeyRequest& request, ::grpc::CompletionQueue* cq) override;
::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>* AsyncPUTRaw(::grpc::ClientContext* context, const ::keyvaluepackage::PutKeyRequest& request, ::grpc::CompletionQueue* cq) override;
::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>* PrepareAsyncPUTRaw(::grpc::ClientContext* context, const ::keyvaluepackage::PutKeyRequest& request, ::grpc::CompletionQueue* cq) override;
::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>* AsyncDELRaw(::grpc::ClientContext* context, const ::keyvaluepackage::DelKeyRequest& request, ::grpc::CompletionQueue* cq) override;
::grpc::ClientAsyncResponseReader< ::keyvaluepackage::Reply>* PrepareAsyncDELRaw(::grpc::ClientContext* context, const ::keyvaluepackage::DelKeyRequest& request, ::grpc::CompletionQueue* cq) override;
const ::grpc::internal::RpcMethod rpcmethod_GET_;
const ::grpc::internal::RpcMethod rpcmethod_PUT_;
const ::grpc::internal::RpcMethod rpcmethod_DEL_;
};
static std::unique_ptr<Stub> NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options = ::grpc::StubOptions());
class Service : public ::grpc::Service {
public:
Service();
virtual ~Service();
// Sends a greeting
virtual ::grpc::Status GET(::grpc::ServerContext* context, const ::keyvaluepackage::GetKeyRequest* request, ::keyvaluepackage::Reply* response);
virtual ::grpc::Status PUT(::grpc::ServerContext* context, const ::keyvaluepackage::PutKeyRequest* request, ::keyvaluepackage::Reply* response);
virtual ::grpc::Status DEL(::grpc::ServerContext* context, const ::keyvaluepackage::DelKeyRequest* request, ::keyvaluepackage::Reply* response);
};
template <class BaseClass>
class WithAsyncMethod_GET : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithAsyncMethod_GET() {
::grpc::Service::MarkMethodAsync(0);
}
~WithAsyncMethod_GET() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status GET(::grpc::ServerContext* /*context*/, const ::keyvaluepackage::GetKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
void RequestGET(::grpc::ServerContext* context, ::keyvaluepackage::GetKeyRequest* request, ::grpc::ServerAsyncResponseWriter< ::keyvaluepackage::Reply>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag);
}
};
template <class BaseClass>
class WithAsyncMethod_PUT : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithAsyncMethod_PUT() {
::grpc::Service::MarkMethodAsync(1);
}
~WithAsyncMethod_PUT() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status PUT(::grpc::ServerContext* /*context*/, const ::keyvaluepackage::PutKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
void RequestPUT(::grpc::ServerContext* context, ::keyvaluepackage::PutKeyRequest* request, ::grpc::ServerAsyncResponseWriter< ::keyvaluepackage::Reply>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag);
}
};
template <class BaseClass>
class WithAsyncMethod_DEL : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithAsyncMethod_DEL() {
::grpc::Service::MarkMethodAsync(2);
}
~WithAsyncMethod_DEL() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status DEL(::grpc::ServerContext* /*context*/, const ::keyvaluepackage::DelKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
void RequestDEL(::grpc::ServerContext* context, ::keyvaluepackage::DelKeyRequest* request, ::grpc::ServerAsyncResponseWriter< ::keyvaluepackage::Reply>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag);
}
};
typedef WithAsyncMethod_GET<WithAsyncMethod_PUT<WithAsyncMethod_DEL<Service > > > AsyncService;
template <class BaseClass>
class WithCallbackMethod_GET : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithCallbackMethod_GET() {
::grpc::Service::MarkMethodCallback(0,
new ::grpc::internal::CallbackUnaryHandler< ::keyvaluepackage::GetKeyRequest, ::keyvaluepackage::Reply>(
[this](
::grpc::CallbackServerContext* context, const ::keyvaluepackage::GetKeyRequest* request, ::keyvaluepackage::Reply* response) { return this->GET(context, request, response); }));}
void SetMessageAllocatorFor_GET(
::grpc::MessageAllocator< ::keyvaluepackage::GetKeyRequest, ::keyvaluepackage::Reply>* allocator) {
::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(0);
static_cast<::grpc::internal::CallbackUnaryHandler< ::keyvaluepackage::GetKeyRequest, ::keyvaluepackage::Reply>*>(handler)
->SetMessageAllocator(allocator);
}
~WithCallbackMethod_GET() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status GET(::grpc::ServerContext* /*context*/, const ::keyvaluepackage::GetKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
virtual ::grpc::ServerUnaryReactor* GET(
::grpc::CallbackServerContext* /*context*/, const ::keyvaluepackage::GetKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) { return nullptr; }
};
template <class BaseClass>
class WithCallbackMethod_PUT : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithCallbackMethod_PUT() {
::grpc::Service::MarkMethodCallback(1,
new ::grpc::internal::CallbackUnaryHandler< ::keyvaluepackage::PutKeyRequest, ::keyvaluepackage::Reply>(
[this](
::grpc::CallbackServerContext* context, const ::keyvaluepackage::PutKeyRequest* request, ::keyvaluepackage::Reply* response) { return this->PUT(context, request, response); }));}
void SetMessageAllocatorFor_PUT(
::grpc::MessageAllocator< ::keyvaluepackage::PutKeyRequest, ::keyvaluepackage::Reply>* allocator) {
::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(1);
static_cast<::grpc::internal::CallbackUnaryHandler< ::keyvaluepackage::PutKeyRequest, ::keyvaluepackage::Reply>*>(handler)
->SetMessageAllocator(allocator);
}
~WithCallbackMethod_PUT() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status PUT(::grpc::ServerContext* /*context*/, const ::keyvaluepackage::PutKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
virtual ::grpc::ServerUnaryReactor* PUT(
::grpc::CallbackServerContext* /*context*/, const ::keyvaluepackage::PutKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) { return nullptr; }
};
template <class BaseClass>
class WithCallbackMethod_DEL : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithCallbackMethod_DEL() {
::grpc::Service::MarkMethodCallback(2,
new ::grpc::internal::CallbackUnaryHandler< ::keyvaluepackage::DelKeyRequest, ::keyvaluepackage::Reply>(
[this](
::grpc::CallbackServerContext* context, const ::keyvaluepackage::DelKeyRequest* request, ::keyvaluepackage::Reply* response) { return this->DEL(context, request, response); }));}
void SetMessageAllocatorFor_DEL(
::grpc::MessageAllocator< ::keyvaluepackage::DelKeyRequest, ::keyvaluepackage::Reply>* allocator) {
::grpc::internal::MethodHandler* const handler = ::grpc::Service::GetHandler(2);
static_cast<::grpc::internal::CallbackUnaryHandler< ::keyvaluepackage::DelKeyRequest, ::keyvaluepackage::Reply>*>(handler)
->SetMessageAllocator(allocator);
}
~WithCallbackMethod_DEL() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status DEL(::grpc::ServerContext* /*context*/, const ::keyvaluepackage::DelKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
virtual ::grpc::ServerUnaryReactor* DEL(
::grpc::CallbackServerContext* /*context*/, const ::keyvaluepackage::DelKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) { return nullptr; }
};
typedef WithCallbackMethod_GET<WithCallbackMethod_PUT<WithCallbackMethod_DEL<Service > > > CallbackService;
typedef CallbackService ExperimentalCallbackService;
template <class BaseClass>
class WithGenericMethod_GET : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithGenericMethod_GET() {
::grpc::Service::MarkMethodGeneric(0);
}
~WithGenericMethod_GET() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status GET(::grpc::ServerContext* /*context*/, const ::keyvaluepackage::GetKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
};
template <class BaseClass>
class WithGenericMethod_PUT : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithGenericMethod_PUT() {
::grpc::Service::MarkMethodGeneric(1);
}
~WithGenericMethod_PUT() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status PUT(::grpc::ServerContext* /*context*/, const ::keyvaluepackage::PutKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
};
template <class BaseClass>
class WithGenericMethod_DEL : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithGenericMethod_DEL() {
::grpc::Service::MarkMethodGeneric(2);
}
~WithGenericMethod_DEL() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status DEL(::grpc::ServerContext* /*context*/, const ::keyvaluepackage::DelKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
};
template <class BaseClass>
class WithRawMethod_GET : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithRawMethod_GET() {
::grpc::Service::MarkMethodRaw(0);
}
~WithRawMethod_GET() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status GET(::grpc::ServerContext* /*context*/, const ::keyvaluepackage::GetKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
void RequestGET(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
::grpc::Service::RequestAsyncUnary(0, context, request, response, new_call_cq, notification_cq, tag);
}
};
template <class BaseClass>
class WithRawMethod_PUT : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithRawMethod_PUT() {
::grpc::Service::MarkMethodRaw(1);
}
~WithRawMethod_PUT() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status PUT(::grpc::ServerContext* /*context*/, const ::keyvaluepackage::PutKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
void RequestPUT(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
::grpc::Service::RequestAsyncUnary(1, context, request, response, new_call_cq, notification_cq, tag);
}
};
template <class BaseClass>
class WithRawMethod_DEL : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithRawMethod_DEL() {
::grpc::Service::MarkMethodRaw(2);
}
~WithRawMethod_DEL() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status DEL(::grpc::ServerContext* /*context*/, const ::keyvaluepackage::DelKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
void RequestDEL(::grpc::ServerContext* context, ::grpc::ByteBuffer* request, ::grpc::ServerAsyncResponseWriter< ::grpc::ByteBuffer>* response, ::grpc::CompletionQueue* new_call_cq, ::grpc::ServerCompletionQueue* notification_cq, void *tag) {
::grpc::Service::RequestAsyncUnary(2, context, request, response, new_call_cq, notification_cq, tag);
}
};
template <class BaseClass>
class WithRawCallbackMethod_GET : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithRawCallbackMethod_GET() {
::grpc::Service::MarkMethodRawCallback(0,
new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>(
[this](
::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->GET(context, request, response); }));
}
~WithRawCallbackMethod_GET() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status GET(::grpc::ServerContext* /*context*/, const ::keyvaluepackage::GetKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
virtual ::grpc::ServerUnaryReactor* GET(
::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; }
};
template <class BaseClass>
class WithRawCallbackMethod_PUT : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithRawCallbackMethod_PUT() {
::grpc::Service::MarkMethodRawCallback(1,
new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>(
[this](
::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->PUT(context, request, response); }));
}
~WithRawCallbackMethod_PUT() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status PUT(::grpc::ServerContext* /*context*/, const ::keyvaluepackage::PutKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
virtual ::grpc::ServerUnaryReactor* PUT(
::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; }
};
template <class BaseClass>
class WithRawCallbackMethod_DEL : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithRawCallbackMethod_DEL() {
::grpc::Service::MarkMethodRawCallback(2,
new ::grpc::internal::CallbackUnaryHandler< ::grpc::ByteBuffer, ::grpc::ByteBuffer>(
[this](
::grpc::CallbackServerContext* context, const ::grpc::ByteBuffer* request, ::grpc::ByteBuffer* response) { return this->DEL(context, request, response); }));
}
~WithRawCallbackMethod_DEL() override {
BaseClassMustBeDerivedFromService(this);
}
// disable synchronous version of this method
::grpc::Status DEL(::grpc::ServerContext* /*context*/, const ::keyvaluepackage::DelKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
virtual ::grpc::ServerUnaryReactor* DEL(
::grpc::CallbackServerContext* /*context*/, const ::grpc::ByteBuffer* /*request*/, ::grpc::ByteBuffer* /*response*/) { return nullptr; }
};
template <class BaseClass>
class WithStreamedUnaryMethod_GET : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithStreamedUnaryMethod_GET() {
::grpc::Service::MarkMethodStreamed(0,
new ::grpc::internal::StreamedUnaryHandler<
::keyvaluepackage::GetKeyRequest, ::keyvaluepackage::Reply>(
[this](::grpc::ServerContext* context,
::grpc::ServerUnaryStreamer<
::keyvaluepackage::GetKeyRequest, ::keyvaluepackage::Reply>* streamer) {
return this->StreamedGET(context,
streamer);
}));
}
~WithStreamedUnaryMethod_GET() override {
BaseClassMustBeDerivedFromService(this);
}
// disable regular version of this method
::grpc::Status GET(::grpc::ServerContext* /*context*/, const ::keyvaluepackage::GetKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
// replace default version of method with streamed unary
virtual ::grpc::Status StreamedGET(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::keyvaluepackage::GetKeyRequest,::keyvaluepackage::Reply>* server_unary_streamer) = 0;
};
template <class BaseClass>
class WithStreamedUnaryMethod_PUT : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithStreamedUnaryMethod_PUT() {
::grpc::Service::MarkMethodStreamed(1,
new ::grpc::internal::StreamedUnaryHandler<
::keyvaluepackage::PutKeyRequest, ::keyvaluepackage::Reply>(
[this](::grpc::ServerContext* context,
::grpc::ServerUnaryStreamer<
::keyvaluepackage::PutKeyRequest, ::keyvaluepackage::Reply>* streamer) {
return this->StreamedPUT(context,
streamer);
}));
}
~WithStreamedUnaryMethod_PUT() override {
BaseClassMustBeDerivedFromService(this);
}
// disable regular version of this method
::grpc::Status PUT(::grpc::ServerContext* /*context*/, const ::keyvaluepackage::PutKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
// replace default version of method with streamed unary
virtual ::grpc::Status StreamedPUT(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::keyvaluepackage::PutKeyRequest,::keyvaluepackage::Reply>* server_unary_streamer) = 0;
};
template <class BaseClass>
class WithStreamedUnaryMethod_DEL : public BaseClass {
private:
void BaseClassMustBeDerivedFromService(const Service* /*service*/) {}
public:
WithStreamedUnaryMethod_DEL() {
::grpc::Service::MarkMethodStreamed(2,
new ::grpc::internal::StreamedUnaryHandler<
::keyvaluepackage::DelKeyRequest, ::keyvaluepackage::Reply>(
[this](::grpc::ServerContext* context,
::grpc::ServerUnaryStreamer<
::keyvaluepackage::DelKeyRequest, ::keyvaluepackage::Reply>* streamer) {
return this->StreamedDEL(context,
streamer);
}));
}
~WithStreamedUnaryMethod_DEL() override {
BaseClassMustBeDerivedFromService(this);
}
// disable regular version of this method
::grpc::Status DEL(::grpc::ServerContext* /*context*/, const ::keyvaluepackage::DelKeyRequest* /*request*/, ::keyvaluepackage::Reply* /*response*/) override {
abort();
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
}
// replace default version of method with streamed unary
virtual ::grpc::Status StreamedDEL(::grpc::ServerContext* context, ::grpc::ServerUnaryStreamer< ::keyvaluepackage::DelKeyRequest,::keyvaluepackage::Reply>* server_unary_streamer) = 0;
};
typedef WithStreamedUnaryMethod_GET<WithStreamedUnaryMethod_PUT<WithStreamedUnaryMethod_DEL<Service > > > StreamedUnaryService;
typedef Service SplitStreamedService;
typedef WithStreamedUnaryMethod_GET<WithStreamedUnaryMethod_PUT<WithStreamedUnaryMethod_DEL<Service > > > StreamedService;
};
} // namespace keyvaluepackage
#endif // GRPC_keyvaluepackage_2eproto__INCLUDED
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: keyvaluepackage.proto
#include "keyvaluepackage.pb.h"
#include <algorithm>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/wire_format_lite.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
PROTOBUF_PRAGMA_INIT_SEG
namespace keyvaluepackage {
constexpr GetKeyRequest::GetKeyRequest(
::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
: key_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
struct GetKeyRequestDefaultTypeInternal {
constexpr GetKeyRequestDefaultTypeInternal()
: _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
~GetKeyRequestDefaultTypeInternal() {}
union {
GetKeyRequest _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT GetKeyRequestDefaultTypeInternal _GetKeyRequest_default_instance_;
constexpr PutKeyRequest::PutKeyRequest(
::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
: key_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
, value_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
struct PutKeyRequestDefaultTypeInternal {
constexpr PutKeyRequestDefaultTypeInternal()
: _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
~PutKeyRequestDefaultTypeInternal() {}
union {
PutKeyRequest _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PutKeyRequestDefaultTypeInternal _PutKeyRequest_default_instance_;
constexpr DelKeyRequest::DelKeyRequest(
::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
: key_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
struct DelKeyRequestDefaultTypeInternal {
constexpr DelKeyRequestDefaultTypeInternal()
: _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
~DelKeyRequestDefaultTypeInternal() {}
union {
DelKeyRequest _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT DelKeyRequestDefaultTypeInternal _DelKeyRequest_default_instance_;
constexpr Reply::Reply(
::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized)
: key_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string)
, value_(&::PROTOBUF_NAMESPACE_ID::internal::fixed_address_empty_string){}
struct ReplyDefaultTypeInternal {
constexpr ReplyDefaultTypeInternal()
: _instance(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized{}) {}
~ReplyDefaultTypeInternal() {}
union {
Reply _instance;
};
};
PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT ReplyDefaultTypeInternal _Reply_default_instance_;
} // namespace keyvaluepackage
static ::PROTOBUF_NAMESPACE_ID::Metadata file_level_metadata_keyvaluepackage_2eproto[4];
static constexpr ::PROTOBUF_NAMESPACE_ID::EnumDescriptor const** file_level_enum_descriptors_keyvaluepackage_2eproto = nullptr;
static constexpr ::PROTOBUF_NAMESPACE_ID::ServiceDescriptor const** file_level_service_descriptors_keyvaluepackage_2eproto = nullptr;
const ::PROTOBUF_NAMESPACE_ID::uint32 TableStruct_keyvaluepackage_2eproto::offsets[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::keyvaluepackage::GetKeyRequest, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::keyvaluepackage::GetKeyRequest, key_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::keyvaluepackage::PutKeyRequest, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::keyvaluepackage::PutKeyRequest, key_),
PROTOBUF_FIELD_OFFSET(::keyvaluepackage::PutKeyRequest, value_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::keyvaluepackage::DelKeyRequest, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::keyvaluepackage::DelKeyRequest, key_),
~0u, // no _has_bits_
PROTOBUF_FIELD_OFFSET(::keyvaluepackage::Reply, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
PROTOBUF_FIELD_OFFSET(::keyvaluepackage::Reply, key_),
PROTOBUF_FIELD_OFFSET(::keyvaluepackage::Reply, value_),
};
static const ::PROTOBUF_NAMESPACE_ID::internal::MigrationSchema schemas[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, sizeof(::keyvaluepackage::GetKeyRequest)},
{ 6, -1, sizeof(::keyvaluepackage::PutKeyRequest)},
{ 13, -1, sizeof(::keyvaluepackage::DelKeyRequest)},
{ 19, -1, sizeof(::keyvaluepackage::Reply)},
};
static ::PROTOBUF_NAMESPACE_ID::Message const * const file_default_instances[] = {
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::keyvaluepackage::_GetKeyRequest_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::keyvaluepackage::_PutKeyRequest_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::keyvaluepackage::_DelKeyRequest_default_instance_),
reinterpret_cast<const ::PROTOBUF_NAMESPACE_ID::Message*>(&::keyvaluepackage::_Reply_default_instance_),
};
const char descriptor_table_protodef_keyvaluepackage_2eproto[] PROTOBUF_SECTION_VARIABLE(protodesc_cold) =
"\n\025keyvaluepackage.proto\022\017keyvaluepackage"
"\"\034\n\rGetKeyRequest\022\013\n\003key\030\001 \001(\t\"+\n\rPutKey"
"Request\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t\"\034\n\rD"
"elKeyRequest\022\013\n\003key\030\001 \001(\t\"#\n\005Reply\022\013\n\003ke"
"y\030\001 \001(\t\022\r\n\005value\030\002 \001(\t2\307\001\n\002KV\022\?\n\003GET\022\036.k"
"eyvaluepackage.GetKeyRequest\032\026.keyvaluep"
"ackage.Reply\"\000\022\?\n\003PUT\022\036.keyvaluepackage."
"PutKeyRequest\032\026.keyvaluepackage.Reply\"\000\022"
"\?\n\003DEL\022\036.keyvaluepackage.DelKeyRequest\032\026"
".keyvaluepackage.Reply\"\000B6\n\033io.grpc.exam"
"ples.helloworldB\017HelloWorldProtoP\001\242\002\003HLW"
"b\006proto3"
;
static ::PROTOBUF_NAMESPACE_ID::internal::once_flag descriptor_table_keyvaluepackage_2eproto_once;
const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_keyvaluepackage_2eproto = {
false, false, 448, descriptor_table_protodef_keyvaluepackage_2eproto, "keyvaluepackage.proto",
&descriptor_table_keyvaluepackage_2eproto_once, nullptr, 0, 4,
schemas, file_default_instances, TableStruct_keyvaluepackage_2eproto::offsets,
file_level_metadata_keyvaluepackage_2eproto, file_level_enum_descriptors_keyvaluepackage_2eproto, file_level_service_descriptors_keyvaluepackage_2eproto,
};
PROTOBUF_ATTRIBUTE_WEAK ::PROTOBUF_NAMESPACE_ID::Metadata
descriptor_table_keyvaluepackage_2eproto_metadata_getter(int index) {
::PROTOBUF_NAMESPACE_ID::internal::AssignDescriptors(&descriptor_table_keyvaluepackage_2eproto);
return descriptor_table_keyvaluepackage_2eproto.file_level_metadata[index];
}
// Force running AddDescriptors() at dynamic initialization time.
PROTOBUF_ATTRIBUTE_INIT_PRIORITY static ::PROTOBUF_NAMESPACE_ID::internal::AddDescriptorsRunner dynamic_init_dummy_keyvaluepackage_2eproto(&descriptor_table_keyvaluepackage_2eproto);
namespace keyvaluepackage {
// ===================================================================
class GetKeyRequest::_Internal {
public:
};
GetKeyRequest::GetKeyRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena)
: ::PROTOBUF_NAMESPACE_ID::Message(arena) {
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:keyvaluepackage.GetKeyRequest)
}
GetKeyRequest::GetKeyRequest(const GetKeyRequest& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_key().empty()) {
key_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_key(),
GetArena());
}
// @@protoc_insertion_point(copy_constructor:keyvaluepackage.GetKeyRequest)
}
void GetKeyRequest::SharedCtor() {
key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
GetKeyRequest::~GetKeyRequest() {
// @@protoc_insertion_point(destructor:keyvaluepackage.GetKeyRequest)
SharedDtor();
_internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
void GetKeyRequest::SharedDtor() {
GOOGLE_DCHECK(GetArena() == nullptr);
key_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void GetKeyRequest::ArenaDtor(void* object) {
GetKeyRequest* _this = reinterpret_cast< GetKeyRequest* >(object);
(void)_this;
}
void GetKeyRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void GetKeyRequest::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
void GetKeyRequest::Clear() {
// @@protoc_insertion_point(message_clear_start:keyvaluepackage.GetKeyRequest)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
key_.ClearToEmpty();
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char* GetKeyRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// string key = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
auto str = _internal_mutable_key();
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "keyvaluepackage.GetKeyRequest.key"));
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag,
_internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* GetKeyRequest::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:keyvaluepackage.GetKeyRequest)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// string key = 1;
if (this->key().size() > 0) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_key().data(), static_cast<int>(this->_internal_key().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"keyvaluepackage.GetKeyRequest.key");
target = stream->WriteStringMaybeAliased(
1, this->_internal_key(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:keyvaluepackage.GetKeyRequest)
return target;
}
size_t GetKeyRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyvaluepackage.GetKeyRequest)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// string key = 1;
if (this->key().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_key());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void GetKeyRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:keyvaluepackage.GetKeyRequest)
GOOGLE_DCHECK_NE(&from, this);
const GetKeyRequest* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<GetKeyRequest>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:keyvaluepackage.GetKeyRequest)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:keyvaluepackage.GetKeyRequest)
MergeFrom(*source);
}
}
void GetKeyRequest::MergeFrom(const GetKeyRequest& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:keyvaluepackage.GetKeyRequest)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.key().size() > 0) {
_internal_set_key(from._internal_key());
}
}
void GetKeyRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:keyvaluepackage.GetKeyRequest)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void GetKeyRequest::CopyFrom(const GetKeyRequest& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyvaluepackage.GetKeyRequest)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool GetKeyRequest::IsInitialized() const {
return true;
}
void GetKeyRequest::InternalSwap(GetKeyRequest* other) {
using std::swap;
_internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
key_.Swap(&other->key_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
::PROTOBUF_NAMESPACE_ID::Metadata GetKeyRequest::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
class PutKeyRequest::_Internal {
public:
};
PutKeyRequest::PutKeyRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena)
: ::PROTOBUF_NAMESPACE_ID::Message(arena) {
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:keyvaluepackage.PutKeyRequest)
}
PutKeyRequest::PutKeyRequest(const PutKeyRequest& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_key().empty()) {
key_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_key(),
GetArena());
}
value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_value().empty()) {
value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_value(),
GetArena());
}
// @@protoc_insertion_point(copy_constructor:keyvaluepackage.PutKeyRequest)
}
void PutKeyRequest::SharedCtor() {
key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
PutKeyRequest::~PutKeyRequest() {
// @@protoc_insertion_point(destructor:keyvaluepackage.PutKeyRequest)
SharedDtor();
_internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
void PutKeyRequest::SharedDtor() {
GOOGLE_DCHECK(GetArena() == nullptr);
key_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
value_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void PutKeyRequest::ArenaDtor(void* object) {
PutKeyRequest* _this = reinterpret_cast< PutKeyRequest* >(object);
(void)_this;
}
void PutKeyRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void PutKeyRequest::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
void PutKeyRequest::Clear() {
// @@protoc_insertion_point(message_clear_start:keyvaluepackage.PutKeyRequest)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
key_.ClearToEmpty();
value_.ClearToEmpty();
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char* PutKeyRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// string key = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
auto str = _internal_mutable_key();
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "keyvaluepackage.PutKeyRequest.key"));
CHK_(ptr);
} else goto handle_unusual;
continue;
// string value = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
auto str = _internal_mutable_value();
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "keyvaluepackage.PutKeyRequest.value"));
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag,
_internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* PutKeyRequest::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:keyvaluepackage.PutKeyRequest)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// string key = 1;
if (this->key().size() > 0) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_key().data(), static_cast<int>(this->_internal_key().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"keyvaluepackage.PutKeyRequest.key");
target = stream->WriteStringMaybeAliased(
1, this->_internal_key(), target);
}
// string value = 2;
if (this->value().size() > 0) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_value().data(), static_cast<int>(this->_internal_value().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"keyvaluepackage.PutKeyRequest.value");
target = stream->WriteStringMaybeAliased(
2, this->_internal_value(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:keyvaluepackage.PutKeyRequest)
return target;
}
size_t PutKeyRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyvaluepackage.PutKeyRequest)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// string key = 1;
if (this->key().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_key());
}
// string value = 2;
if (this->value().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_value());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void PutKeyRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:keyvaluepackage.PutKeyRequest)
GOOGLE_DCHECK_NE(&from, this);
const PutKeyRequest* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<PutKeyRequest>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:keyvaluepackage.PutKeyRequest)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:keyvaluepackage.PutKeyRequest)
MergeFrom(*source);
}
}
void PutKeyRequest::MergeFrom(const PutKeyRequest& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:keyvaluepackage.PutKeyRequest)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.key().size() > 0) {
_internal_set_key(from._internal_key());
}
if (from.value().size() > 0) {
_internal_set_value(from._internal_value());
}
}
void PutKeyRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:keyvaluepackage.PutKeyRequest)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void PutKeyRequest::CopyFrom(const PutKeyRequest& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyvaluepackage.PutKeyRequest)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool PutKeyRequest::IsInitialized() const {
return true;
}
void PutKeyRequest::InternalSwap(PutKeyRequest* other) {
using std::swap;
_internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
key_.Swap(&other->key_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
value_.Swap(&other->value_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
::PROTOBUF_NAMESPACE_ID::Metadata PutKeyRequest::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
class DelKeyRequest::_Internal {
public:
};
DelKeyRequest::DelKeyRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena)
: ::PROTOBUF_NAMESPACE_ID::Message(arena) {
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:keyvaluepackage.DelKeyRequest)
}
DelKeyRequest::DelKeyRequest(const DelKeyRequest& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_key().empty()) {
key_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_key(),
GetArena());
}
// @@protoc_insertion_point(copy_constructor:keyvaluepackage.DelKeyRequest)
}
void DelKeyRequest::SharedCtor() {
key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
DelKeyRequest::~DelKeyRequest() {
// @@protoc_insertion_point(destructor:keyvaluepackage.DelKeyRequest)
SharedDtor();
_internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
void DelKeyRequest::SharedDtor() {
GOOGLE_DCHECK(GetArena() == nullptr);
key_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void DelKeyRequest::ArenaDtor(void* object) {
DelKeyRequest* _this = reinterpret_cast< DelKeyRequest* >(object);
(void)_this;
}
void DelKeyRequest::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void DelKeyRequest::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
void DelKeyRequest::Clear() {
// @@protoc_insertion_point(message_clear_start:keyvaluepackage.DelKeyRequest)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
key_.ClearToEmpty();
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char* DelKeyRequest::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// string key = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
auto str = _internal_mutable_key();
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "keyvaluepackage.DelKeyRequest.key"));
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag,
_internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* DelKeyRequest::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:keyvaluepackage.DelKeyRequest)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// string key = 1;
if (this->key().size() > 0) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_key().data(), static_cast<int>(this->_internal_key().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"keyvaluepackage.DelKeyRequest.key");
target = stream->WriteStringMaybeAliased(
1, this->_internal_key(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:keyvaluepackage.DelKeyRequest)
return target;
}
size_t DelKeyRequest::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyvaluepackage.DelKeyRequest)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// string key = 1;
if (this->key().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_key());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void DelKeyRequest::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:keyvaluepackage.DelKeyRequest)
GOOGLE_DCHECK_NE(&from, this);
const DelKeyRequest* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<DelKeyRequest>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:keyvaluepackage.DelKeyRequest)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:keyvaluepackage.DelKeyRequest)
MergeFrom(*source);
}
}
void DelKeyRequest::MergeFrom(const DelKeyRequest& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:keyvaluepackage.DelKeyRequest)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.key().size() > 0) {
_internal_set_key(from._internal_key());
}
}
void DelKeyRequest::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:keyvaluepackage.DelKeyRequest)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void DelKeyRequest::CopyFrom(const DelKeyRequest& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyvaluepackage.DelKeyRequest)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool DelKeyRequest::IsInitialized() const {
return true;
}
void DelKeyRequest::InternalSwap(DelKeyRequest* other) {
using std::swap;
_internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
key_.Swap(&other->key_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
::PROTOBUF_NAMESPACE_ID::Metadata DelKeyRequest::GetMetadata() const {
return GetMetadataStatic();
}
// ===================================================================
class Reply::_Internal {
public:
};
Reply::Reply(::PROTOBUF_NAMESPACE_ID::Arena* arena)
: ::PROTOBUF_NAMESPACE_ID::Message(arena) {
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:keyvaluepackage.Reply)
}
Reply::Reply(const Reply& from)
: ::PROTOBUF_NAMESPACE_ID::Message() {
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_key().empty()) {
key_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_key(),
GetArena());
}
value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
if (!from._internal_value().empty()) {
value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, from._internal_value(),
GetArena());
}
// @@protoc_insertion_point(copy_constructor:keyvaluepackage.Reply)
}
void Reply::SharedCtor() {
key_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
value_.UnsafeSetDefault(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
Reply::~Reply() {
// @@protoc_insertion_point(destructor:keyvaluepackage.Reply)
SharedDtor();
_internal_metadata_.Delete<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
void Reply::SharedDtor() {
GOOGLE_DCHECK(GetArena() == nullptr);
key_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
value_.DestroyNoArena(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited());
}
void Reply::ArenaDtor(void* object) {
Reply* _this = reinterpret_cast< Reply* >(object);
(void)_this;
}
void Reply::RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena*) {
}
void Reply::SetCachedSize(int size) const {
_cached_size_.Set(size);
}
void Reply::Clear() {
// @@protoc_insertion_point(message_clear_start:keyvaluepackage.Reply)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
key_.ClearToEmpty();
value_.ClearToEmpty();
_internal_metadata_.Clear<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>();
}
const char* Reply::_InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) {
#define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
while (!ctx->Done(&ptr)) {
::PROTOBUF_NAMESPACE_ID::uint32 tag;
ptr = ::PROTOBUF_NAMESPACE_ID::internal::ReadTag(ptr, &tag);
CHK_(ptr);
switch (tag >> 3) {
// string key = 1;
case 1:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 10)) {
auto str = _internal_mutable_key();
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "keyvaluepackage.Reply.key"));
CHK_(ptr);
} else goto handle_unusual;
continue;
// string value = 2;
case 2:
if (PROTOBUF_PREDICT_TRUE(static_cast<::PROTOBUF_NAMESPACE_ID::uint8>(tag) == 18)) {
auto str = _internal_mutable_value();
ptr = ::PROTOBUF_NAMESPACE_ID::internal::InlineGreedyStringParser(str, ptr, ctx);
CHK_(::PROTOBUF_NAMESPACE_ID::internal::VerifyUTF8(str, "keyvaluepackage.Reply.value"));
CHK_(ptr);
} else goto handle_unusual;
continue;
default: {
handle_unusual:
if ((tag & 7) == 4 || tag == 0) {
ctx->SetLastTag(tag);
goto success;
}
ptr = UnknownFieldParse(tag,
_internal_metadata_.mutable_unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(),
ptr, ctx);
CHK_(ptr != nullptr);
continue;
}
} // switch
} // while
success:
return ptr;
failure:
ptr = nullptr;
goto success;
#undef CHK_
}
::PROTOBUF_NAMESPACE_ID::uint8* Reply::_InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
// @@protoc_insertion_point(serialize_to_array_start:keyvaluepackage.Reply)
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// string key = 1;
if (this->key().size() > 0) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_key().data(), static_cast<int>(this->_internal_key().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"keyvaluepackage.Reply.key");
target = stream->WriteStringMaybeAliased(
1, this->_internal_key(), target);
}
// string value = 2;
if (this->value().size() > 0) {
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::VerifyUtf8String(
this->_internal_value().data(), static_cast<int>(this->_internal_value().length()),
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::SERIALIZE,
"keyvaluepackage.Reply.value");
target = stream->WriteStringMaybeAliased(
2, this->_internal_value(), target);
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormat::InternalSerializeUnknownFieldsToArray(
_internal_metadata_.unknown_fields<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(::PROTOBUF_NAMESPACE_ID::UnknownFieldSet::default_instance), target, stream);
}
// @@protoc_insertion_point(serialize_to_array_end:keyvaluepackage.Reply)
return target;
}
size_t Reply::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:keyvaluepackage.Reply)
size_t total_size = 0;
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
// string key = 1;
if (this->key().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_key());
}
// string value = 2;
if (this->value().size() > 0) {
total_size += 1 +
::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
this->_internal_value());
}
if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
return ::PROTOBUF_NAMESPACE_ID::internal::ComputeUnknownFieldsSize(
_internal_metadata_, total_size, &_cached_size_);
}
int cached_size = ::PROTOBUF_NAMESPACE_ID::internal::ToCachedSize(total_size);
SetCachedSize(cached_size);
return total_size;
}
void Reply::MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:keyvaluepackage.Reply)
GOOGLE_DCHECK_NE(&from, this);
const Reply* source =
::PROTOBUF_NAMESPACE_ID::DynamicCastToGenerated<Reply>(
&from);
if (source == nullptr) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:keyvaluepackage.Reply)
::PROTOBUF_NAMESPACE_ID::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:keyvaluepackage.Reply)
MergeFrom(*source);
}
}
void Reply::MergeFrom(const Reply& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:keyvaluepackage.Reply)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(from._internal_metadata_);
::PROTOBUF_NAMESPACE_ID::uint32 cached_has_bits = 0;
(void) cached_has_bits;
if (from.key().size() > 0) {
_internal_set_key(from._internal_key());
}
if (from.value().size() > 0) {
_internal_set_value(from._internal_value());
}
}
void Reply::CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:keyvaluepackage.Reply)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void Reply::CopyFrom(const Reply& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:keyvaluepackage.Reply)
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool Reply::IsInitialized() const {
return true;
}
void Reply::InternalSwap(Reply* other) {
using std::swap;
_internal_metadata_.Swap<::PROTOBUF_NAMESPACE_ID::UnknownFieldSet>(&other->_internal_metadata_);
key_.Swap(&other->key_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
value_.Swap(&other->value_, &::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
::PROTOBUF_NAMESPACE_ID::Metadata Reply::GetMetadata() const {
return GetMetadataStatic();
}
// @@protoc_insertion_point(namespace_scope)
} // namespace keyvaluepackage
PROTOBUF_NAMESPACE_OPEN
template<> PROTOBUF_NOINLINE ::keyvaluepackage::GetKeyRequest* Arena::CreateMaybeMessage< ::keyvaluepackage::GetKeyRequest >(Arena* arena) {
return Arena::CreateMessageInternal< ::keyvaluepackage::GetKeyRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::keyvaluepackage::PutKeyRequest* Arena::CreateMaybeMessage< ::keyvaluepackage::PutKeyRequest >(Arena* arena) {
return Arena::CreateMessageInternal< ::keyvaluepackage::PutKeyRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::keyvaluepackage::DelKeyRequest* Arena::CreateMaybeMessage< ::keyvaluepackage::DelKeyRequest >(Arena* arena) {
return Arena::CreateMessageInternal< ::keyvaluepackage::DelKeyRequest >(arena);
}
template<> PROTOBUF_NOINLINE ::keyvaluepackage::Reply* Arena::CreateMaybeMessage< ::keyvaluepackage::Reply >(Arena* arena) {
return Arena::CreateMessageInternal< ::keyvaluepackage::Reply >(arena);
}
PROTOBUF_NAMESPACE_CLOSE
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: keyvaluepackage.proto
#ifndef GOOGLE_PROTOBUF_INCLUDED_keyvaluepackage_2eproto
#define GOOGLE_PROTOBUF_INCLUDED_keyvaluepackage_2eproto
#include <limits>
#include <string>
#include <google/protobuf/port_def.inc>
#if PROTOBUF_VERSION < 3015000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3015008 < PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/port_undef.inc>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/generated_message_table_driven.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/metadata_lite.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h> // IWYU pragma: export
#include <google/protobuf/extension_set.h> // IWYU pragma: export
#include <google/protobuf/unknown_field_set.h>
// @@protoc_insertion_point(includes)
#include <google/protobuf/port_def.inc>
#define PROTOBUF_INTERNAL_EXPORT_keyvaluepackage_2eproto
PROTOBUF_NAMESPACE_OPEN
namespace internal {
class AnyMetadata;
} // namespace internal
PROTOBUF_NAMESPACE_CLOSE
// Internal implementation detail -- do not use these members.
struct TableStruct_keyvaluepackage_2eproto {
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTableField entries[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::AuxiliaryParseTableField aux[]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::ParseTable schema[4]
PROTOBUF_SECTION_VARIABLE(protodesc_cold);
static const ::PROTOBUF_NAMESPACE_ID::internal::FieldMetadata field_metadata[];
static const ::PROTOBUF_NAMESPACE_ID::internal::SerializationTable serialization_table[];
static const ::PROTOBUF_NAMESPACE_ID::uint32 offsets[];
};
extern const ::PROTOBUF_NAMESPACE_ID::internal::DescriptorTable descriptor_table_keyvaluepackage_2eproto;
::PROTOBUF_NAMESPACE_ID::Metadata descriptor_table_keyvaluepackage_2eproto_metadata_getter(int index);
namespace keyvaluepackage {
class DelKeyRequest;
struct DelKeyRequestDefaultTypeInternal;
extern DelKeyRequestDefaultTypeInternal _DelKeyRequest_default_instance_;
class GetKeyRequest;
struct GetKeyRequestDefaultTypeInternal;
extern GetKeyRequestDefaultTypeInternal _GetKeyRequest_default_instance_;
class PutKeyRequest;
struct PutKeyRequestDefaultTypeInternal;
extern PutKeyRequestDefaultTypeInternal _PutKeyRequest_default_instance_;
class Reply;
struct ReplyDefaultTypeInternal;
extern ReplyDefaultTypeInternal _Reply_default_instance_;
} // namespace keyvaluepackage
PROTOBUF_NAMESPACE_OPEN
template<> ::keyvaluepackage::DelKeyRequest* Arena::CreateMaybeMessage<::keyvaluepackage::DelKeyRequest>(Arena*);
template<> ::keyvaluepackage::GetKeyRequest* Arena::CreateMaybeMessage<::keyvaluepackage::GetKeyRequest>(Arena*);
template<> ::keyvaluepackage::PutKeyRequest* Arena::CreateMaybeMessage<::keyvaluepackage::PutKeyRequest>(Arena*);
template<> ::keyvaluepackage::Reply* Arena::CreateMaybeMessage<::keyvaluepackage::Reply>(Arena*);
PROTOBUF_NAMESPACE_CLOSE
namespace keyvaluepackage {
// ===================================================================
class GetKeyRequest PROTOBUF_FINAL :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:keyvaluepackage.GetKeyRequest) */ {
public:
inline GetKeyRequest() : GetKeyRequest(nullptr) {}
virtual ~GetKeyRequest();
explicit constexpr GetKeyRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
GetKeyRequest(const GetKeyRequest& from);
GetKeyRequest(GetKeyRequest&& from) noexcept
: GetKeyRequest() {
*this = ::std::move(from);
}
inline GetKeyRequest& operator=(const GetKeyRequest& from) {
CopyFrom(from);
return *this;
}
inline GetKeyRequest& operator=(GetKeyRequest&& from) noexcept {
if (GetArena() == from.GetArena()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return GetMetadataStatic().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return GetMetadataStatic().reflection;
}
static const GetKeyRequest& default_instance() {
return *internal_default_instance();
}
static inline const GetKeyRequest* internal_default_instance() {
return reinterpret_cast<const GetKeyRequest*>(
&_GetKeyRequest_default_instance_);
}
static constexpr int kIndexInFileMessages =
0;
friend void swap(GetKeyRequest& a, GetKeyRequest& b) {
a.Swap(&b);
}
inline void Swap(GetKeyRequest* other) {
if (other == this) return;
if (GetArena() == other->GetArena()) {
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(GetKeyRequest* other) {
if (other == this) return;
GOOGLE_DCHECK(GetArena() == other->GetArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
inline GetKeyRequest* New() const final {
return CreateMaybeMessage<GetKeyRequest>(nullptr);
}
GetKeyRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage<GetKeyRequest>(arena);
}
void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const GetKeyRequest& from);
void MergeFrom(const GetKeyRequest& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
inline void SharedCtor();
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(GetKeyRequest* other);
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "keyvaluepackage.GetKeyRequest";
}
protected:
explicit GetKeyRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
private:
static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
return ::descriptor_table_keyvaluepackage_2eproto_metadata_getter(kIndexInFileMessages);
}
public:
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kKeyFieldNumber = 1,
};
// string key = 1;
void clear_key();
const std::string& key() const;
void set_key(const std::string& value);
void set_key(std::string&& value);
void set_key(const char* value);
void set_key(const char* value, size_t size);
std::string* mutable_key();
std::string* release_key();
void set_allocated_key(std::string* key);
private:
const std::string& _internal_key() const;
void _internal_set_key(const std::string& value);
std::string* _internal_mutable_key();
public:
// @@protoc_insertion_point(class_scope:keyvaluepackage.GetKeyRequest)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr key_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
friend struct ::TableStruct_keyvaluepackage_2eproto;
};
// -------------------------------------------------------------------
class PutKeyRequest PROTOBUF_FINAL :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:keyvaluepackage.PutKeyRequest) */ {
public:
inline PutKeyRequest() : PutKeyRequest(nullptr) {}
virtual ~PutKeyRequest();
explicit constexpr PutKeyRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
PutKeyRequest(const PutKeyRequest& from);
PutKeyRequest(PutKeyRequest&& from) noexcept
: PutKeyRequest() {
*this = ::std::move(from);
}
inline PutKeyRequest& operator=(const PutKeyRequest& from) {
CopyFrom(from);
return *this;
}
inline PutKeyRequest& operator=(PutKeyRequest&& from) noexcept {
if (GetArena() == from.GetArena()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return GetMetadataStatic().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return GetMetadataStatic().reflection;
}
static const PutKeyRequest& default_instance() {
return *internal_default_instance();
}
static inline const PutKeyRequest* internal_default_instance() {
return reinterpret_cast<const PutKeyRequest*>(
&_PutKeyRequest_default_instance_);
}
static constexpr int kIndexInFileMessages =
1;
friend void swap(PutKeyRequest& a, PutKeyRequest& b) {
a.Swap(&b);
}
inline void Swap(PutKeyRequest* other) {
if (other == this) return;
if (GetArena() == other->GetArena()) {
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(PutKeyRequest* other) {
if (other == this) return;
GOOGLE_DCHECK(GetArena() == other->GetArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
inline PutKeyRequest* New() const final {
return CreateMaybeMessage<PutKeyRequest>(nullptr);
}
PutKeyRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage<PutKeyRequest>(arena);
}
void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const PutKeyRequest& from);
void MergeFrom(const PutKeyRequest& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
inline void SharedCtor();
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(PutKeyRequest* other);
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "keyvaluepackage.PutKeyRequest";
}
protected:
explicit PutKeyRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
private:
static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
return ::descriptor_table_keyvaluepackage_2eproto_metadata_getter(kIndexInFileMessages);
}
public:
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kKeyFieldNumber = 1,
kValueFieldNumber = 2,
};
// string key = 1;
void clear_key();
const std::string& key() const;
void set_key(const std::string& value);
void set_key(std::string&& value);
void set_key(const char* value);
void set_key(const char* value, size_t size);
std::string* mutable_key();
std::string* release_key();
void set_allocated_key(std::string* key);
private:
const std::string& _internal_key() const;
void _internal_set_key(const std::string& value);
std::string* _internal_mutable_key();
public:
// string value = 2;
void clear_value();
const std::string& value() const;
void set_value(const std::string& value);
void set_value(std::string&& value);
void set_value(const char* value);
void set_value(const char* value, size_t size);
std::string* mutable_value();
std::string* release_value();
void set_allocated_value(std::string* value);
private:
const std::string& _internal_value() const;
void _internal_set_value(const std::string& value);
std::string* _internal_mutable_value();
public:
// @@protoc_insertion_point(class_scope:keyvaluepackage.PutKeyRequest)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr key_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr value_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
friend struct ::TableStruct_keyvaluepackage_2eproto;
};
// -------------------------------------------------------------------
class DelKeyRequest PROTOBUF_FINAL :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:keyvaluepackage.DelKeyRequest) */ {
public:
inline DelKeyRequest() : DelKeyRequest(nullptr) {}
virtual ~DelKeyRequest();
explicit constexpr DelKeyRequest(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
DelKeyRequest(const DelKeyRequest& from);
DelKeyRequest(DelKeyRequest&& from) noexcept
: DelKeyRequest() {
*this = ::std::move(from);
}
inline DelKeyRequest& operator=(const DelKeyRequest& from) {
CopyFrom(from);
return *this;
}
inline DelKeyRequest& operator=(DelKeyRequest&& from) noexcept {
if (GetArena() == from.GetArena()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return GetMetadataStatic().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return GetMetadataStatic().reflection;
}
static const DelKeyRequest& default_instance() {
return *internal_default_instance();
}
static inline const DelKeyRequest* internal_default_instance() {
return reinterpret_cast<const DelKeyRequest*>(
&_DelKeyRequest_default_instance_);
}
static constexpr int kIndexInFileMessages =
2;
friend void swap(DelKeyRequest& a, DelKeyRequest& b) {
a.Swap(&b);
}
inline void Swap(DelKeyRequest* other) {
if (other == this) return;
if (GetArena() == other->GetArena()) {
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(DelKeyRequest* other) {
if (other == this) return;
GOOGLE_DCHECK(GetArena() == other->GetArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
inline DelKeyRequest* New() const final {
return CreateMaybeMessage<DelKeyRequest>(nullptr);
}
DelKeyRequest* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage<DelKeyRequest>(arena);
}
void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const DelKeyRequest& from);
void MergeFrom(const DelKeyRequest& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
inline void SharedCtor();
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(DelKeyRequest* other);
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "keyvaluepackage.DelKeyRequest";
}
protected:
explicit DelKeyRequest(::PROTOBUF_NAMESPACE_ID::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
private:
static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
return ::descriptor_table_keyvaluepackage_2eproto_metadata_getter(kIndexInFileMessages);
}
public:
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kKeyFieldNumber = 1,
};
// string key = 1;
void clear_key();
const std::string& key() const;
void set_key(const std::string& value);
void set_key(std::string&& value);
void set_key(const char* value);
void set_key(const char* value, size_t size);
std::string* mutable_key();
std::string* release_key();
void set_allocated_key(std::string* key);
private:
const std::string& _internal_key() const;
void _internal_set_key(const std::string& value);
std::string* _internal_mutable_key();
public:
// @@protoc_insertion_point(class_scope:keyvaluepackage.DelKeyRequest)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr key_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
friend struct ::TableStruct_keyvaluepackage_2eproto;
};
// -------------------------------------------------------------------
class Reply PROTOBUF_FINAL :
public ::PROTOBUF_NAMESPACE_ID::Message /* @@protoc_insertion_point(class_definition:keyvaluepackage.Reply) */ {
public:
inline Reply() : Reply(nullptr) {}
virtual ~Reply();
explicit constexpr Reply(::PROTOBUF_NAMESPACE_ID::internal::ConstantInitialized);
Reply(const Reply& from);
Reply(Reply&& from) noexcept
: Reply() {
*this = ::std::move(from);
}
inline Reply& operator=(const Reply& from) {
CopyFrom(from);
return *this;
}
inline Reply& operator=(Reply&& from) noexcept {
if (GetArena() == from.GetArena()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* descriptor() {
return GetDescriptor();
}
static const ::PROTOBUF_NAMESPACE_ID::Descriptor* GetDescriptor() {
return GetMetadataStatic().descriptor;
}
static const ::PROTOBUF_NAMESPACE_ID::Reflection* GetReflection() {
return GetMetadataStatic().reflection;
}
static const Reply& default_instance() {
return *internal_default_instance();
}
static inline const Reply* internal_default_instance() {
return reinterpret_cast<const Reply*>(
&_Reply_default_instance_);
}
static constexpr int kIndexInFileMessages =
3;
friend void swap(Reply& a, Reply& b) {
a.Swap(&b);
}
inline void Swap(Reply* other) {
if (other == this) return;
if (GetArena() == other->GetArena()) {
InternalSwap(other);
} else {
::PROTOBUF_NAMESPACE_ID::internal::GenericSwap(this, other);
}
}
void UnsafeArenaSwap(Reply* other) {
if (other == this) return;
GOOGLE_DCHECK(GetArena() == other->GetArena());
InternalSwap(other);
}
// implements Message ----------------------------------------------
inline Reply* New() const final {
return CreateMaybeMessage<Reply>(nullptr);
}
Reply* New(::PROTOBUF_NAMESPACE_ID::Arena* arena) const final {
return CreateMaybeMessage<Reply>(arena);
}
void CopyFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void MergeFrom(const ::PROTOBUF_NAMESPACE_ID::Message& from) final;
void CopyFrom(const Reply& from);
void MergeFrom(const Reply& from);
PROTOBUF_ATTRIBUTE_REINITIALIZES void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
const char* _InternalParse(const char* ptr, ::PROTOBUF_NAMESPACE_ID::internal::ParseContext* ctx) final;
::PROTOBUF_NAMESPACE_ID::uint8* _InternalSerialize(
::PROTOBUF_NAMESPACE_ID::uint8* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
inline void SharedCtor();
inline void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(Reply* other);
friend class ::PROTOBUF_NAMESPACE_ID::internal::AnyMetadata;
static ::PROTOBUF_NAMESPACE_ID::StringPiece FullMessageName() {
return "keyvaluepackage.Reply";
}
protected:
explicit Reply(::PROTOBUF_NAMESPACE_ID::Arena* arena);
private:
static void ArenaDtor(void* object);
inline void RegisterArenaDtor(::PROTOBUF_NAMESPACE_ID::Arena* arena);
public:
::PROTOBUF_NAMESPACE_ID::Metadata GetMetadata() const final;
private:
static ::PROTOBUF_NAMESPACE_ID::Metadata GetMetadataStatic() {
return ::descriptor_table_keyvaluepackage_2eproto_metadata_getter(kIndexInFileMessages);
}
public:
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
enum : int {
kKeyFieldNumber = 1,
kValueFieldNumber = 2,
};
// string key = 1;
void clear_key();
const std::string& key() const;
void set_key(const std::string& value);
void set_key(std::string&& value);
void set_key(const char* value);
void set_key(const char* value, size_t size);
std::string* mutable_key();
std::string* release_key();
void set_allocated_key(std::string* key);
private:
const std::string& _internal_key() const;
void _internal_set_key(const std::string& value);
std::string* _internal_mutable_key();
public:
// string value = 2;
void clear_value();
const std::string& value() const;
void set_value(const std::string& value);
void set_value(std::string&& value);
void set_value(const char* value);
void set_value(const char* value, size_t size);
std::string* mutable_value();
std::string* release_value();
void set_allocated_value(std::string* value);
private:
const std::string& _internal_value() const;
void _internal_set_value(const std::string& value);
std::string* _internal_mutable_value();
public:
// @@protoc_insertion_point(class_scope:keyvaluepackage.Reply)
private:
class _Internal;
template <typename T> friend class ::PROTOBUF_NAMESPACE_ID::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr key_;
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr value_;
mutable ::PROTOBUF_NAMESPACE_ID::internal::CachedSize _cached_size_;
friend struct ::TableStruct_keyvaluepackage_2eproto;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// GetKeyRequest
// string key = 1;
inline void GetKeyRequest::clear_key() {
key_.ClearToEmpty();
}
inline const std::string& GetKeyRequest::key() const {
// @@protoc_insertion_point(field_get:keyvaluepackage.GetKeyRequest.key)
return _internal_key();
}
inline void GetKeyRequest::set_key(const std::string& value) {
_internal_set_key(value);
// @@protoc_insertion_point(field_set:keyvaluepackage.GetKeyRequest.key)
}
inline std::string* GetKeyRequest::mutable_key() {
// @@protoc_insertion_point(field_mutable:keyvaluepackage.GetKeyRequest.key)
return _internal_mutable_key();
}
inline const std::string& GetKeyRequest::_internal_key() const {
return key_.Get();
}
inline void GetKeyRequest::_internal_set_key(const std::string& value) {
key_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
}
inline void GetKeyRequest::set_key(std::string&& value) {
key_.Set(
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
// @@protoc_insertion_point(field_set_rvalue:keyvaluepackage.GetKeyRequest.key)
}
inline void GetKeyRequest::set_key(const char* value) {
GOOGLE_DCHECK(value != nullptr);
key_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
// @@protoc_insertion_point(field_set_char:keyvaluepackage.GetKeyRequest.key)
}
inline void GetKeyRequest::set_key(const char* value,
size_t size) {
key_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
reinterpret_cast<const char*>(value), size), GetArena());
// @@protoc_insertion_point(field_set_pointer:keyvaluepackage.GetKeyRequest.key)
}
inline std::string* GetKeyRequest::_internal_mutable_key() {
return key_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
}
inline std::string* GetKeyRequest::release_key() {
// @@protoc_insertion_point(field_release:keyvaluepackage.GetKeyRequest.key)
return key_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
inline void GetKeyRequest::set_allocated_key(std::string* key) {
if (key != nullptr) {
} else {
}
key_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), key,
GetArena());
// @@protoc_insertion_point(field_set_allocated:keyvaluepackage.GetKeyRequest.key)
}
// -------------------------------------------------------------------
// PutKeyRequest
// string key = 1;
inline void PutKeyRequest::clear_key() {
key_.ClearToEmpty();
}
inline const std::string& PutKeyRequest::key() const {
// @@protoc_insertion_point(field_get:keyvaluepackage.PutKeyRequest.key)
return _internal_key();
}
inline void PutKeyRequest::set_key(const std::string& value) {
_internal_set_key(value);
// @@protoc_insertion_point(field_set:keyvaluepackage.PutKeyRequest.key)
}
inline std::string* PutKeyRequest::mutable_key() {
// @@protoc_insertion_point(field_mutable:keyvaluepackage.PutKeyRequest.key)
return _internal_mutable_key();
}
inline const std::string& PutKeyRequest::_internal_key() const {
return key_.Get();
}
inline void PutKeyRequest::_internal_set_key(const std::string& value) {
key_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
}
inline void PutKeyRequest::set_key(std::string&& value) {
key_.Set(
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
// @@protoc_insertion_point(field_set_rvalue:keyvaluepackage.PutKeyRequest.key)
}
inline void PutKeyRequest::set_key(const char* value) {
GOOGLE_DCHECK(value != nullptr);
key_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
// @@protoc_insertion_point(field_set_char:keyvaluepackage.PutKeyRequest.key)
}
inline void PutKeyRequest::set_key(const char* value,
size_t size) {
key_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
reinterpret_cast<const char*>(value), size), GetArena());
// @@protoc_insertion_point(field_set_pointer:keyvaluepackage.PutKeyRequest.key)
}
inline std::string* PutKeyRequest::_internal_mutable_key() {
return key_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
}
inline std::string* PutKeyRequest::release_key() {
// @@protoc_insertion_point(field_release:keyvaluepackage.PutKeyRequest.key)
return key_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
inline void PutKeyRequest::set_allocated_key(std::string* key) {
if (key != nullptr) {
} else {
}
key_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), key,
GetArena());
// @@protoc_insertion_point(field_set_allocated:keyvaluepackage.PutKeyRequest.key)
}
// string value = 2;
inline void PutKeyRequest::clear_value() {
value_.ClearToEmpty();
}
inline const std::string& PutKeyRequest::value() const {
// @@protoc_insertion_point(field_get:keyvaluepackage.PutKeyRequest.value)
return _internal_value();
}
inline void PutKeyRequest::set_value(const std::string& value) {
_internal_set_value(value);
// @@protoc_insertion_point(field_set:keyvaluepackage.PutKeyRequest.value)
}
inline std::string* PutKeyRequest::mutable_value() {
// @@protoc_insertion_point(field_mutable:keyvaluepackage.PutKeyRequest.value)
return _internal_mutable_value();
}
inline const std::string& PutKeyRequest::_internal_value() const {
return value_.Get();
}
inline void PutKeyRequest::_internal_set_value(const std::string& value) {
value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
}
inline void PutKeyRequest::set_value(std::string&& value) {
value_.Set(
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
// @@protoc_insertion_point(field_set_rvalue:keyvaluepackage.PutKeyRequest.value)
}
inline void PutKeyRequest::set_value(const char* value) {
GOOGLE_DCHECK(value != nullptr);
value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
// @@protoc_insertion_point(field_set_char:keyvaluepackage.PutKeyRequest.value)
}
inline void PutKeyRequest::set_value(const char* value,
size_t size) {
value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
reinterpret_cast<const char*>(value), size), GetArena());
// @@protoc_insertion_point(field_set_pointer:keyvaluepackage.PutKeyRequest.value)
}
inline std::string* PutKeyRequest::_internal_mutable_value() {
return value_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
}
inline std::string* PutKeyRequest::release_value() {
// @@protoc_insertion_point(field_release:keyvaluepackage.PutKeyRequest.value)
return value_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
inline void PutKeyRequest::set_allocated_value(std::string* value) {
if (value != nullptr) {
} else {
}
value_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value,
GetArena());
// @@protoc_insertion_point(field_set_allocated:keyvaluepackage.PutKeyRequest.value)
}
// -------------------------------------------------------------------
// DelKeyRequest
// string key = 1;
inline void DelKeyRequest::clear_key() {
key_.ClearToEmpty();
}
inline const std::string& DelKeyRequest::key() const {
// @@protoc_insertion_point(field_get:keyvaluepackage.DelKeyRequest.key)
return _internal_key();
}
inline void DelKeyRequest::set_key(const std::string& value) {
_internal_set_key(value);
// @@protoc_insertion_point(field_set:keyvaluepackage.DelKeyRequest.key)
}
inline std::string* DelKeyRequest::mutable_key() {
// @@protoc_insertion_point(field_mutable:keyvaluepackage.DelKeyRequest.key)
return _internal_mutable_key();
}
inline const std::string& DelKeyRequest::_internal_key() const {
return key_.Get();
}
inline void DelKeyRequest::_internal_set_key(const std::string& value) {
key_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
}
inline void DelKeyRequest::set_key(std::string&& value) {
key_.Set(
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
// @@protoc_insertion_point(field_set_rvalue:keyvaluepackage.DelKeyRequest.key)
}
inline void DelKeyRequest::set_key(const char* value) {
GOOGLE_DCHECK(value != nullptr);
key_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
// @@protoc_insertion_point(field_set_char:keyvaluepackage.DelKeyRequest.key)
}
inline void DelKeyRequest::set_key(const char* value,
size_t size) {
key_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
reinterpret_cast<const char*>(value), size), GetArena());
// @@protoc_insertion_point(field_set_pointer:keyvaluepackage.DelKeyRequest.key)
}
inline std::string* DelKeyRequest::_internal_mutable_key() {
return key_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
}
inline std::string* DelKeyRequest::release_key() {
// @@protoc_insertion_point(field_release:keyvaluepackage.DelKeyRequest.key)
return key_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
inline void DelKeyRequest::set_allocated_key(std::string* key) {
if (key != nullptr) {
} else {
}
key_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), key,
GetArena());
// @@protoc_insertion_point(field_set_allocated:keyvaluepackage.DelKeyRequest.key)
}
// -------------------------------------------------------------------
// Reply
// string key = 1;
inline void Reply::clear_key() {
key_.ClearToEmpty();
}
inline const std::string& Reply::key() const {
// @@protoc_insertion_point(field_get:keyvaluepackage.Reply.key)
return _internal_key();
}
inline void Reply::set_key(const std::string& value) {
_internal_set_key(value);
// @@protoc_insertion_point(field_set:keyvaluepackage.Reply.key)
}
inline std::string* Reply::mutable_key() {
// @@protoc_insertion_point(field_mutable:keyvaluepackage.Reply.key)
return _internal_mutable_key();
}
inline const std::string& Reply::_internal_key() const {
return key_.Get();
}
inline void Reply::_internal_set_key(const std::string& value) {
key_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
}
inline void Reply::set_key(std::string&& value) {
key_.Set(
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
// @@protoc_insertion_point(field_set_rvalue:keyvaluepackage.Reply.key)
}
inline void Reply::set_key(const char* value) {
GOOGLE_DCHECK(value != nullptr);
key_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
// @@protoc_insertion_point(field_set_char:keyvaluepackage.Reply.key)
}
inline void Reply::set_key(const char* value,
size_t size) {
key_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
reinterpret_cast<const char*>(value), size), GetArena());
// @@protoc_insertion_point(field_set_pointer:keyvaluepackage.Reply.key)
}
inline std::string* Reply::_internal_mutable_key() {
return key_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
}
inline std::string* Reply::release_key() {
// @@protoc_insertion_point(field_release:keyvaluepackage.Reply.key)
return key_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
inline void Reply::set_allocated_key(std::string* key) {
if (key != nullptr) {
} else {
}
key_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), key,
GetArena());
// @@protoc_insertion_point(field_set_allocated:keyvaluepackage.Reply.key)
}
// string value = 2;
inline void Reply::clear_value() {
value_.ClearToEmpty();
}
inline const std::string& Reply::value() const {
// @@protoc_insertion_point(field_get:keyvaluepackage.Reply.value)
return _internal_value();
}
inline void Reply::set_value(const std::string& value) {
_internal_set_value(value);
// @@protoc_insertion_point(field_set:keyvaluepackage.Reply.value)
}
inline std::string* Reply::mutable_value() {
// @@protoc_insertion_point(field_mutable:keyvaluepackage.Reply.value)
return _internal_mutable_value();
}
inline const std::string& Reply::_internal_value() const {
return value_.Get();
}
inline void Reply::_internal_set_value(const std::string& value) {
value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, value, GetArena());
}
inline void Reply::set_value(std::string&& value) {
value_.Set(
::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::move(value), GetArena());
// @@protoc_insertion_point(field_set_rvalue:keyvaluepackage.Reply.value)
}
inline void Reply::set_value(const char* value) {
GOOGLE_DCHECK(value != nullptr);
value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(value), GetArena());
// @@protoc_insertion_point(field_set_char:keyvaluepackage.Reply.value)
}
inline void Reply::set_value(const char* value,
size_t size) {
value_.Set(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, ::std::string(
reinterpret_cast<const char*>(value), size), GetArena());
// @@protoc_insertion_point(field_set_pointer:keyvaluepackage.Reply.value)
}
inline std::string* Reply::_internal_mutable_value() {
return value_.Mutable(::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::EmptyDefault{}, GetArena());
}
inline std::string* Reply::release_value() {
// @@protoc_insertion_point(field_release:keyvaluepackage.Reply.value)
return value_.Release(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), GetArena());
}
inline void Reply::set_allocated_value(std::string* value) {
if (value != nullptr) {
} else {
}
value_.SetAllocated(&::PROTOBUF_NAMESPACE_ID::internal::GetEmptyStringAlreadyInited(), value,
GetArena());
// @@protoc_insertion_point(field_set_allocated:keyvaluepackage.Reply.value)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// @@protoc_insertion_point(namespace_scope)
} // namespace keyvaluepackage
// @@protoc_insertion_point(global_scope)
#include <google/protobuf/port_undef.inc>
#endif // GOOGLE_PROTOBUF_INCLUDED_GOOGLE_PROTOBUF_INCLUDED_keyvaluepackage_2eproto
// Copyright 2015 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
option java_multiple_files = true;
option java_package = "io.grpc.examples.helloworld";
option java_outer_classname = "HelloWorldProto";
option objc_class_prefix = "HLW";
package keyvaluepackage;
// The greeting service definition.
service KV {
// Sends a greeting
rpc GET (GetKeyRequest) returns (Reply) {}
rpc PUT (PutKeyRequest) returns (Reply) {}
rpc DEL (DelKeyRequest) returns (Reply){}
}
message GetKeyRequest{
string key=1;
}
message PutKeyRequest{
string key=1;
string value=2;
}
message DelKeyRequest{
string key=1;
}
message Reply{
string key=1;
string value=2;
}
// The request message containing the user's name.
//message HelloRequest {
// string name = 1;
//}
//message HelloWithSerial{
// string name=1;
// int32 seqNumber=2;
//}
//
//// The response message containing the greetings
//message HelloReply {
// string message = 1;
//}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment