-
-
Notifications
You must be signed in to change notification settings - Fork 131
/
cluster.proto
101 lines (80 loc) · 1.8 KB
/
cluster.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
syntax = "proto3";
package clusterrpc;
import "eraftpb.proto";
service IndexService {
rpc ping (PingRequest) returns (PingReply);
rpc place_index (PlaceRequest) returns (ResultReply);
rpc list_indexes (ListRequest) returns (ListReply);
rpc place_document (DocumentRequest) returns (ResultReply);
rpc delete_document (DeleteRequest) returns (DeleteReply);
rpc search_index (SearchRequest) returns (SearchReply);
rpc get_summary (SummaryRequest) returns (SummaryReply);
rpc raft_request (RaftRequest) returns (RaftReply);
rpc join (JoinRequest) returns (ResultReply);
}
enum ResultCode {
SUCCESS = 0;
FAILURE = 1;
NO_RESULTS = 2;
UNKNOWNNNNN = 3;
MAGIC_UNICORN = 4;
}
message RaftRequest {
eraftpb.Message message = 1;
}
message JoinRequest {
uint64 id = 1;
string host = 2;
}
message RaftReply {
ResultCode code = 1;
}
message ResultReply {
ResultCode code = 1;
string message = 2;
}
message ListRequest {
}
message ListReply {
repeated string indexes = 1;
}
message PingReply {
string status = 1;
}
message PingRequest {
}
message SearchRequest {
string index = 1;
bytes query = 2;
}
message SearchReply {
ResultReply result = 1;
bytes doc = 2;
}
message PlaceRequest {
string index = 1;
bytes schema = 2;
}
message DocumentRequest {
string index = 1;
bytes document = 2;
}
message DeleteRequest {
string index = 1;
bytes terms = 2;
}
message ReplicaRequest {
string index = 1;
string from = 2;
string to = 3;
}
message SummaryRequest {
string index = 1;
}
message SummaryReply {
bytes summary = 1;
}
message DeleteReply {
string index = 1;
uint64 docs_affected = 2;
}