forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvtgate.proto
307 lines (267 loc) · 8.01 KB
/
vtgate.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
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
// Data definitions for service vtgateservice.
syntax = "proto3";
package vtgate;
option java_package="com.youtube.vitess.proto";
import "query.proto";
import "topodata.proto";
import "vtrpc.proto";
// Session objects are session cookies and are invalidated on
// use. Query results will contain updated session values.
// Their content should be opaque to the user.
message Session {
bool in_transaction = 1;
message ShardSession {
query.Target target = 1;
int64 transaction_id = 2;
}
repeated ShardSession shard_sessions = 2;
}
// ExecuteRequest is the payload to Execute
message ExecuteRequest {
vtrpc.CallerID caller_id = 1;
Session session = 2;
query.BoundQuery query = 3;
topodata.TabletType tablet_type = 4;
bool not_in_transaction = 5;
}
// ExecuteResponse is the returned value from Execute
message ExecuteResponse {
vtrpc.RPCError error = 1;
Session session = 2;
query.QueryResult result = 3;
}
// ExecuteShardsRequest is the payload to ExecuteShards
message ExecuteShardsRequest {
vtrpc.CallerID caller_id = 1;
Session session = 2;
query.BoundQuery query = 3;
string keyspace = 4;
repeated string shards = 5;
topodata.TabletType tablet_type = 6;
bool not_in_transaction = 7;
}
// ExecuteShardsResponse is the returned value from ExecuteShards
message ExecuteShardsResponse {
vtrpc.RPCError error = 1;
Session session = 2;
query.QueryResult result = 3;
}
// ExecuteKeyspaceIdsRequest is the payload to ExecuteKeyspaceIds
message ExecuteKeyspaceIdsRequest {
vtrpc.CallerID caller_id = 1;
Session session = 2;
query.BoundQuery query = 3;
string keyspace = 4;
repeated bytes keyspace_ids = 5;
topodata.TabletType tablet_type = 6;
bool not_in_transaction = 7;
}
// ExecuteKeyspaceIdsResponse is the returned value from ExecuteKeyspaceIds
message ExecuteKeyspaceIdsResponse {
vtrpc.RPCError error = 1;
Session session = 2;
query.QueryResult result = 3;
}
// ExecuteKeyRangesRequest is the payload to ExecuteKeyRanges
message ExecuteKeyRangesRequest {
vtrpc.CallerID caller_id = 1;
Session session = 2;
query.BoundQuery query = 3;
string keyspace = 4;
repeated topodata.KeyRange key_ranges = 5;
topodata.TabletType tablet_type = 6;
bool not_in_transaction = 7;
}
// ExecuteKeyRangesResponse is the returned value from ExecuteKeyRanges
message ExecuteKeyRangesResponse {
vtrpc.RPCError error = 1;
Session session = 2;
query.QueryResult result = 3;
}
// ExecuteEntityIdsRequest is the payload to ExecuteEntityIds
message ExecuteEntityIdsRequest {
vtrpc.CallerID caller_id = 1;
Session session = 2;
query.BoundQuery query = 3;
string keyspace = 4;
string entity_column_name = 5;
message EntityId {
enum Type {
TYPE_NULL = 0;
TYPE_BYTES = 1;
TYPE_INT = 2;
TYPE_UINT = 3;
TYPE_FLOAT = 4;
}
Type xid_type = 1;
bytes xid_bytes = 2;
int64 xid_int = 3;
uint64 xid_uint = 4;
double xid_float = 5;
bytes keyspace_id = 6;
}
repeated EntityId entity_keyspace_ids = 6;
topodata.TabletType tablet_type = 7;
bool not_in_transaction = 8;
}
// ExecuteEntityIdsResponse is the returned value from ExecuteEntityIds
message ExecuteEntityIdsResponse {
vtrpc.RPCError error = 1;
Session session = 2;
query.QueryResult result = 3;
}
// BoundShardQuery represents a single query request for the
// specified list of shards. This is used in a list for
// ExecuteBatchShardsRequest.
message BoundShardQuery {
query.BoundQuery query = 1;
string keyspace = 2;
repeated string shards = 3;
}
// ExecuteBatchShardsRequest is the payload to ExecuteBatchShards
message ExecuteBatchShardsRequest {
vtrpc.CallerID caller_id = 1;
Session session = 2;
repeated BoundShardQuery queries = 3;
topodata.TabletType tablet_type = 4;
bool as_transaction = 5;
}
// ExecuteBatchShardsResponse is the returned value from ExecuteBatchShards
message ExecuteBatchShardsResponse {
vtrpc.RPCError error = 1;
Session session = 2;
repeated query.QueryResult results = 3;
}
// BoundKeyspaceIdQuery represents a single query request for the
// specified list of keyspace ids. This is used in a list for
// ExecuteBatchKeyspaceIdsRequest.
message BoundKeyspaceIdQuery {
query.BoundQuery query = 1;
string keyspace = 2;
repeated bytes keyspace_ids = 3;
}
// ExecuteBatchKeyspaceIdsRequest is the payload to ExecuteBatchKeyspaceId
message ExecuteBatchKeyspaceIdsRequest {
vtrpc.CallerID caller_id = 1;
Session session = 2;
repeated BoundKeyspaceIdQuery queries = 3;
topodata.TabletType tablet_type = 4;
bool as_transaction = 5;
}
// ExecuteBatchKeyspaceIdsResponse is the returned value from ExecuteBatchKeyspaceId
message ExecuteBatchKeyspaceIdsResponse {
vtrpc.RPCError error = 1;
Session session = 2;
repeated query.QueryResult results = 3;
}
// StreamExecuteRequest is the payload to StreamExecute
message StreamExecuteRequest {
vtrpc.CallerID caller_id = 1;
query.BoundQuery query = 2;
topodata.TabletType tablet_type = 3;
}
// StreamExecuteResponse is the returned value from StreamExecute
message StreamExecuteResponse {
vtrpc.RPCError error = 1;
query.QueryResult result = 2;
}
// StreamExecuteShardsRequest is the payload to StreamExecuteShards
message StreamExecuteShardsRequest {
vtrpc.CallerID caller_id = 1;
query.BoundQuery query = 2;
string keyspace = 3;
repeated string shards = 4;
topodata.TabletType tablet_type = 5;
}
// StreamExecuteShardsResponse is the returned value from StreamExecuteShards
message StreamExecuteShardsResponse {
vtrpc.RPCError error = 1;
query.QueryResult result = 2;
}
// StreamExecuteKeyspaceIdsRequest is the payload to StreamExecuteKeyspaceIds
message StreamExecuteKeyspaceIdsRequest {
vtrpc.CallerID caller_id = 1;
query.BoundQuery query = 2;
string keyspace = 3;
repeated bytes keyspace_ids = 4;
topodata.TabletType tablet_type = 5;
}
// StreamExecuteKeyspaceIdsResponse is the returned value from StreamExecuteKeyspaceIds
message StreamExecuteKeyspaceIdsResponse {
vtrpc.RPCError error = 1;
query.QueryResult result = 2;
}
// StreamExecuteKeyRangesRequest is the payload to StreamExecuteKeyRanges
message StreamExecuteKeyRangesRequest {
vtrpc.CallerID caller_id = 1;
query.BoundQuery query = 2;
string keyspace = 3;
repeated topodata.KeyRange key_ranges = 4;
topodata.TabletType tablet_type = 5;
}
// StreamExecuteKeyRangesResponse is the returned value from StreamExecuteKeyRanges
message StreamExecuteKeyRangesResponse {
vtrpc.RPCError error = 1;
query.QueryResult result = 2;
}
// BeginRequest is the payload to Begin
message BeginRequest {
vtrpc.CallerID caller_id = 1;
}
// BeginResponse is the returned value from Begin
message BeginResponse {
vtrpc.RPCError error = 1;
Session session = 2;
}
// CommitRequest is the payload to Commit
message CommitRequest {
vtrpc.CallerID caller_id = 1;
Session session = 2;
}
// CommitResponse is the returned value from Commit
message CommitResponse {
vtrpc.RPCError error = 1;
}
// RollbackRequest is the payload to Rollback
message RollbackRequest {
vtrpc.CallerID caller_id = 1;
Session session = 2;
}
// RollbackResponse is the returned value from Rollback
message RollbackResponse {
vtrpc.RPCError error = 1;
}
// SplitQueryRequest is the payload to SplitQuery
message SplitQueryRequest {
vtrpc.CallerID caller_id = 1;
string keyspace = 2;
query.BoundQuery query = 3;
string split_column = 4;
int64 split_count = 5;
}
// SplitQueryResponse is the returned value from SplitQuery
message SplitQueryResponse {
message KeyRangePart {
string keyspace = 1;
repeated topodata.KeyRange key_ranges = 2;
}
message ShardPart {
string keyspace = 1;
repeated string shards = 2;
}
message Part {
query.BoundQuery query = 1;
KeyRangePart key_range_part = 2;
ShardPart shard_part = 3;
int64 size = 4;
}
repeated Part splits = 1;
}
// GetSrvKeyspaceRequest is the payload to GetSrvKeyspace
message GetSrvKeyspaceRequest {
string keyspace = 1;
}
// GetSrvKeyspaceResponse is the returned value from GetSrvKeyspace
message GetSrvKeyspaceResponse {
topodata.SrvKeyspace srv_keyspace = 1;
}