Skip to content

Commit f805e6b

Browse files
ImeevMAlocker
authored andcommitted
proto: add FindRange, FindSpace and UpdateRanges
This patch adds three new internal RPCs: 1. FindSpace looks up a space in the space cache and returns its definition if the space is found. 2. FindRange looks up a range in the range cache and returns its description if the range is found. 3. UpdateCache updates the space and range caches on the server. Needed for tarantool/aeon#313
1 parent 3f438f2 commit f805e6b

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

aeon_internal.proto

+78
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,46 @@ syntax = "proto3";
22

33
import "aeon_error.proto";
44
import "aeon_value.proto";
5+
import "aeon_schema.proto";
56

67
package aeon;
78

89
// Internal API to Aeon - a distributed database based on Tarantool.
910
service InternalService {
1011
// Get the gRPC server sideservice configuration.
1112
rpc GetConfig(GetConfigRequest) returns (GetConfigResponse) {}
13+
// Find space by name in space cache.
14+
rpc FindSpace(FindSpaceRequest) returns (FindSpaceResponse) {}
15+
// Find range by space name and a key in range cache.
16+
rpc FindRange(FindRangeRequest) returns (FindRangeResponse) {}
17+
// Update space cache.
18+
rpc UpdateCache(UpdateCacheRequest) returns (UpdateCacheResponse) {}
19+
}
20+
21+
// Description of a range.
22+
message Range {
23+
// The shard where the range is located.
24+
string shard = 1;
25+
// The range ID.
26+
string id = 2;
27+
// The space to which the range belongs.
28+
string space = 3;
29+
// Format of the space.
30+
repeated FieldDef format = 4;
31+
// Key definition of the space.
32+
repeated KeyPartDef key_def = 5;
33+
// Minimum key of the range.
34+
Tuple key_begin = 6;
35+
// Supremum key of the range, not included into the range.
36+
Tuple key_end = 7;
37+
// The state of the range.
38+
string state = 8;
39+
// The epoch of the range.
40+
uint64 epoch = 9;
41+
// The timestamp of the last change to the range.
42+
uint64 timestamp = 10;
43+
// The context of the range.
44+
Value context = 11;
1245
}
1346

1447
// Get the gRPC server sideservice configuration.
@@ -44,3 +77,48 @@ message GetConfigResponse {
4477
// The gRPC server sideservice configuration.
4578
Config config = 2;
4679
}
80+
81+
// Find space by name in space cache.
82+
83+
message FindSpaceRequest {
84+
// Name of the space to find.
85+
string name = 1;
86+
}
87+
88+
message FindSpaceResponse {
89+
// Error information. Set only on failure.
90+
Error error = 1;
91+
// Name of the found space.
92+
string name = 2;
93+
// Format of the found space.
94+
repeated FieldDef format = 3;
95+
// Key definition of the found space.
96+
repeated KeyPartDef key_def = 4;
97+
// The engine of the found space.
98+
Engine engine = 5;
99+
}
100+
101+
// Find range by space name and a key in range cache.
102+
103+
message FindRangeRequest {
104+
// The name of the space in which to search for the range.
105+
string space = 1;
106+
// Key from the range.
107+
Tuple key = 2;
108+
}
109+
110+
message FindRangeResponse {
111+
// Error information. Set only on failure.
112+
Error error = 1;
113+
// Description of the found range.
114+
Range range = 2;
115+
}
116+
117+
// Update space and range caches.
118+
119+
message UpdateCacheRequest {}
120+
121+
message UpdateCacheResponse {
122+
// Error information. Set only on failure.
123+
Error error = 1;
124+
}

0 commit comments

Comments
 (0)