-
Notifications
You must be signed in to change notification settings - Fork 134
/
Copy pathkeyspacepb.proto
81 lines (66 loc) · 1.93 KB
/
keyspacepb.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";
package keyspacepb;
import "pdpb.proto";
import "gogoproto/gogo.proto";
import "rustproto.proto";
option (gogoproto.sizer_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
option (rustproto.lite_runtime_all) = true;
option java_package = "org.tikv.kvproto";
// Keyspace provides services to manage keyspaces.
service Keyspace {
rpc LoadKeyspace (LoadKeyspaceRequest) returns (LoadKeyspaceResponse) {}
// WatchKeyspaces first return all current keyspaces' metadata as its first response.
// Then, it returns responses containing keyspaces that had their metadata changed.
rpc WatchKeyspaces (WatchKeyspacesRequest) returns (stream WatchKeyspacesResponse) {}
rpc UpdateKeyspaceState(UpdateKeyspaceStateRequest) returns (UpdateKeyspaceStateResponse) {}
rpc GetAllKeyspaces(GetAllKeyspacesRequest) returns (GetAllKeyspacesResponse) {}
}
message KeyspaceMeta {
uint32 id = 1;
string name = 2;
KeyspaceState state = 3;
int64 created_at = 4;
int64 state_changed_at = 5;
map<string, string> config = 7;
}
enum KeyspaceState {
ENABLED = 0;
DISABLED = 1;
ARCHIVED = 2;
TOMBSTONE = 3;
}
message LoadKeyspaceRequest {
pdpb.RequestHeader header = 1;
string name = 2;
}
message LoadKeyspaceResponse {
pdpb.ResponseHeader header = 1;
KeyspaceMeta keyspace = 2;
}
message WatchKeyspacesRequest {
pdpb.RequestHeader header = 1;
}
message WatchKeyspacesResponse {
pdpb.ResponseHeader header = 1;
repeated KeyspaceMeta keyspaces = 2;
}
message UpdateKeyspaceStateRequest{
pdpb.RequestHeader header = 1;
uint32 id = 2;
KeyspaceState state = 3;
}
message UpdateKeyspaceStateResponse{
pdpb.ResponseHeader header = 1;
KeyspaceMeta keyspace = 2;
}
message GetAllKeyspacesRequest{
pdpb.RequestHeader header = 1;
uint32 start_id = 2;
uint32 limit = 3;
}
message GetAllKeyspacesResponse{
pdpb.ResponseHeader header = 1;
repeated KeyspaceMeta keyspaces = 2;
}