-
Notifications
You must be signed in to change notification settings - Fork 2
/
phxrpc_kvraft_stub.h
executable file
·44 lines (27 loc) · 1.05 KB
/
phxrpc_kvraft_stub.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* phxrpc_kvraft_stub.h
Generated by phxrpc_pb2client from kvraft.proto
Please DO NOT edit unless you know exactly what you are doing.
*/
#pragma once
#include "kvraft.pb.h"
namespace phxrpc {
class BaseMessageHandlerFactory;
class BaseTcpStream;
class ClientMonitor;
}
class KVRaftStub {
public:
KVRaftStub(phxrpc::BaseTcpStream &socket, phxrpc::ClientMonitor &client_monitor,
phxrpc::BaseMessageHandlerFactory &msg_handler_factory);
virtual ~KVRaftStub();
void set_keep_alive(const bool keep_alive);
int PHXEcho(const google::protobuf::StringValue &req, google::protobuf::StringValue *resp);
int RequestVote(const kvraft::RequestVoteArgs &req, kvraft::RequestVoteReply *resp);
int AppendEntries(const kvraft::AppendEntriesArgs &req, kvraft::AppendEntriesReply *resp);
int Command(const kvraft::KVArgs &req, kvraft::KVReply *resp);
private:
phxrpc::BaseTcpStream &socket_;
phxrpc::ClientMonitor &client_monitor_;
bool keep_alive_{false};
phxrpc::BaseMessageHandlerFactory &msg_handler_factory_;
};