-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbarus.proto
More file actions
140 lines (102 loc) · 2.45 KB
/
barus.proto
File metadata and controls
140 lines (102 loc) · 2.45 KB
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
132
133
134
135
136
137
138
139
140
syntax = "proto3";
package barus;
// Barus Key-Value Store Service
service BarusService {
// List all tables
rpc ListTables(ListTablesRequest) returns (ListTablesResponse);
// Create a new table
rpc CreateTable(CreateTableRequest) returns (CreateTableResponse);
// Get table information
rpc GetTable(GetTableRequest) returns (GetTableResponse);
// Drop a table
rpc DropTable(DropTableRequest) returns (DropTableResponse);
// Truncate a table (remove all data while keeping table schema)
rpc Truncate(TruncateRequest) returns (TruncateResponse);
// Get a value by key
rpc Get(GetRequest) returns (GetResponse);
// Put a key-value pair
rpc Put(PutRequest) returns (PutResponse);
// Delete a key
rpc Delete(DeleteRequest) returns (DeleteResponse);
// Health check
rpc Health(HealthRequest) returns (HealthResponse);
// Flush WAL to disk
rpc FlushWAL(FlushWALRequest) returns (FlushWALResponse);
// Get database status
rpc GetDBStatus(GetDBStatusRequest) returns (GetDBStatusResponse);
// Flush memtable to disk
rpc FlushMemtable(FlushMemtableRequest) returns (FlushMemtableResponse);
}
message GetRequest {
string table = 1;
string key = 2;
}
message GetResponse {
string key = 1;
string value = 2;
}
message PutRequest {
string table = 1;
string key = 2;
string value = 3;
}
message PutResponse {
string message = 1;
}
message DeleteRequest {
string table = 1;
string key = 2;
}
message DeleteResponse {
string message = 1;
}
message HealthRequest {}
message HealthResponse {
string status = 1;
}
message FlushWALRequest {}
message FlushWALResponse {
string message = 1;
}
message CreateTableRequest {
string table = 1;
}
message CreateTableResponse {
string message = 1;
}
message ListTablesRequest {}
message ListTablesResponse {
repeated TableInfo tables = 1;
}
message TableInfo {
string table_name = 1;
}
message DropTableRequest {
string table = 1;
}
message DropTableResponse {
string message = 1;
}
message TruncateRequest {
// Table to truncate
string table = 1;
}
message TruncateResponse {
// Human readable message or empty on success
string message = 1;
}
message GetTableRequest {
string table = 1;
}
message GetTableResponse {
string table_name = 1;
}
message GetDBStatusRequest {}
message GetDBStatusResponse {
uint64 memtable_size = 1;
uint64 table_count = 2;
}
message FlushMemtableRequest {}
message FlushMemtableResponse {
string message = 1;
}