-
Notifications
You must be signed in to change notification settings - Fork 0
/
shardnode.proto
81 lines (64 loc) · 1.51 KB
/
shardnode.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
syntax = "proto3";
option go_package = "github.com/dsg-uwaterloo/treebeard/api/shardnode";
package shardnode;
service ShardNode {
rpc BatchQuery (RequestBatch) returns (ReplyBatch) {}
rpc SendBlocks(SendBlocksRequest) returns (SendBlocksReply) {}
rpc AckSentBlocks(AckSentBlocksRequest) returns (AckSentBlocksReply) {}
rpc JoinRaftVoter (JoinRaftVoterRequest) returns (JoinRaftVoterReply) {}
}
message RequestBatch {
repeated ReadRequest read_requests = 1;
repeated WriteRequest write_requests = 2;
}
message ReplyBatch {
repeated ReadReply read_replies = 1;
repeated WriteReply write_replies = 2;
}
message ReadRequest {
string request_id = 1;
string block = 2;
}
message ReadReply {
string request_id = 1;
string value = 2;
}
message WriteRequest {
string request_id = 1;
string block = 2;
string value = 3;
}
message WriteReply {
string request_id = 1;
bool success = 2;
}
message JoinRaftVoterRequest {
int32 node_id = 1;
string node_addr = 2;
}
message JoinRaftVoterReply {
bool success = 1;
}
message SendBlocksRequest {
int32 maxBlocks = 1;
int32 storage_id = 3;
}
message Block {
string block = 1;
string value = 2;
int32 path = 3;
}
message SendBlocksReply {
repeated Block blocks = 1;
}
// it represents both acks and nacks
message Ack {
string block = 1;
bool is_ack = 2; // if flase: nack
}
message AckSentBlocksRequest {
repeated Ack acks = 1;
}
message AckSentBlocksReply {
bool success = 1;
}