-
Notifications
You must be signed in to change notification settings - Fork 0
/
raft.proto
52 lines (41 loc) · 911 Bytes
/
raft.proto
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
44
45
46
47
48
49
50
51
52
syntax = "proto3";
message VoteRequest {
int32 candidate_id = 1;
int32 term = 2;
int32 log_length = 3;
int32 last_log_term = 4;
}
message VoteResponse {
bool vote_granted = 1;
int32 term = 2;
int32 id = 3;
int32 currentLease = 4;
}
message LogRequest {
int32 leaderId = 1;
int32 currentTerm = 2;
int32 prefixLen = 3;
int32 prefixTerm = 4;
int32 leaderCommit = 5;
repeated string suffix = 6;
int32 leaderLease = 7;
}
message LogResponse {
int32 nodeId = 1;
int32 currentTerm = 2;
int32 ack = 3;
bool Success = 4;
}
message ServeClientArgs {
string Request = 1;
}
message ServeClientReply {
string Data = 1;
int32 LeaderID = 2;
bool Success = 3;
}
service RaftService {
rpc receiveVoteRequest(VoteRequest) returns (VoteResponse);
rpc serveClient(ServeClientArgs) returns (ServeClientReply);
rpc receiveLogRequest(LogRequest) returns (LogResponse);
}