-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchord.proto
131 lines (99 loc) · 2.68 KB
/
chord.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
syntax = "proto3";
service ChordService {
rpc Register (RegisterRequest) returns (RegisterResponse) {}
rpc Deregister (DeregisterRequest) returns (DeregisterResponse) {}
rpc PopulateFingerTable (PopulateFingerTableRequest) returns (PopulateFingerTableResponse) {}
rpc GetChordInfo (GetChordInfoRequest) returns (GetChordInfoResponse) {}
rpc GetFingerTable (GetFingerTableRequest) returns (GetFingerTableResponse) {}
rpc GetID (GetIDRequest) returns (GetIDResponse) {}
rpc Save (SaveRequest) returns (SaveResponse) {}
rpc Remove (RemoveRequest) returns (RemoveResponse) {}
rpc Find (FindRequest) returns (FindResponse) {}
rpc GetKeys (GetKeysRequest) returns (GetKeysResponse) {}
rpc RemoveOwnKeys (RemoveOwnKeysRequest) returns (RemoveOwnKeysResponse) {}
rpc PromptUpdate (PromptUpdateRequest) returns (PromptUpdateResponse) {}
rpc GetSelfType (GetSelfTypeRequest) returns (GetSelfTypeResponse) {}
}
message RegisterRequest {
string ip_address = 1;
int32 port_number = 2;
}
message RegisterResponse {
int32 node_id = 1;
int32 m = 2;
string error_message = 3;
}
message DeregisterRequest {
int32 node_id = 1;
}
message DeregisterResponse {
bool successful = 1;
string message = 2;
}
message PopulateFingerTableRequest {
int32 node_id = 1;
}
message IDStringPair {
int32 node_id = 1;
string ip_addr_port_num = 2;
}
message PopulateFingerTableResponse {
IDStringPair predecessor = 1;
repeated IDStringPair finger_table = 2;
}
message GetChordInfoRequest {}
message GetChordInfoResponse {
repeated IDStringPair chord_ring = 1;
}
message GetFingerTableRequest {}
message GetFingerTableResponse {
repeated IDStringPair finger_table = 1;
}
message SaveRequest {
string key = 1;
string text = 2;
}
message SaveResponse {
bool successful = 1;
int32 node_id = 2;
string error_message = 3;
}
message RemoveRequest {
string key = 1;
}
message RemoveResponse {
bool successful = 1;
int32 node_id = 2;
string error_message = 3;
}
message FindRequest {
string key = 1;
}
message FindResponse {
bool successful = 1;
int32 node_id = 2;
string ip_addr_port_num = 3;
string error_message = 4;
}
message KeyValuePair {
string key = 1;
string value = 2;
}
message GetKeysRequest {}
message GetKeysResponse {
repeated KeyValuePair keys = 1;
}
message RemoveOwnKeysRequest {
repeated int32 keys = 1;
}
message RemoveOwnKeysResponse {}
message GetSelfTypeRequest {}
message GetSelfTypeResponse {
string type = 1;
}
message GetIDRequest {}
message GetIDResponse {
int32 id = 1;
}
message PromptUpdateRequest {}
message PromptUpdateResponse {}