-
Notifications
You must be signed in to change notification settings - Fork 0
/
raft.proto
108 lines (87 loc) · 2.12 KB
/
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
syntax = "proto3";
package raft;
message Entry {
uint64 Index = 1;
uint64 Term = 2;
uint64 CommandType = 3;
bytes Command = 4;
}
message RequestVoteRequest {
uint64 Term = 1;
string CandidateID = 2;
uint64 LastLogIndex = 3;
uint64 LastLogTerm = 4;
}
message RequestVoteResponse {
uint64 Term = 1;
bool VoteGranted = 2;
}
message AppendEntriesRequest {
uint64 Term = 1;
string LeaderID = 2;
uint64 PrevLogIndex = 3;
uint64 PrevLogTerm = 4;
uint64 LeaderCommit = 5;
repeated Entry Entries = 6;
}
message AppendEntriesResponse {
uint64 Term = 1;
bool Success = 2;
uint64 NextIndex = 3;
}
message InstallSnapshotRequest {
uint64 Term = 1;
string LeaderID = 2;
uint64 LastIncludedIndex = 3;
uint64 LastIncludedTerm = 4;
uint64 Offset = 5;
bool Done = 6;
bytes Data = 7;
}
message InstallSnapshotResponse {
uint64 Term = 1;
uint64 Offset = 2;
uint64 NextIndex = 3;
}
message Member {
string Address = 1;
bool NonVoting = 2;
}
message ConfigurationStorage {
repeated Member Members = 1;
}
message DefaultCommand {
uint64 Operation = 1;
Member Member = 2;
}
message GetLeaderRequest {
}
message GetLeaderResponse {
uint64 Term = 1;
string LeaderID = 2;
}
message AddMemberRequest {
Member Member = 1;
}
message AddMemberResponse {
bool Success = 1;
string LeaderID = 2;
}
message RemoveMemberRequest {
string Address = 1;
}
message RemoveMemberResponse {
bool Success = 1;
string LeaderID = 2;
}
message SetMetaRequest {
[]byte Meta = 1;
}
message SetMetaResponse {
bool Success = 1;
}
message GetMetaRequest {
}
message GetMetaResponse {
[]byte Meta = 1;
}