forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 0
/
topodata.pb.go
542 lines (470 loc) · 18.7 KB
/
topodata.pb.go
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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
// Code generated by protoc-gen-go.
// source: topodata.proto
// DO NOT EDIT!
/*
Package topodata is a generated protocol buffer package.
It is generated from these files:
topodata.proto
It has these top-level messages:
KeyRange
TabletAlias
Tablet
Shard
Keyspace
ShardReplication
EndPoint
EndPoints
SrvShard
ShardReference
SrvKeyspace
*/
package topodata
import proto "github.com/golang/protobuf/proto"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
// KeyspaceIdType describes the type of the sharding key for a
// range-based sharded keyspace.
type KeyspaceIdType int32
const (
// UNSET is the default value, when range-based sharding is not used.
KeyspaceIdType_UNSET KeyspaceIdType = 0
// UINT64 is when uint64 value is used.
// This is represented as 'unsigned bigint' in mysql
KeyspaceIdType_UINT64 KeyspaceIdType = 1
// BYTES is when an array of bytes is used.
// This is represented as 'varbinary' in mysql
KeyspaceIdType_BYTES KeyspaceIdType = 2
)
var KeyspaceIdType_name = map[int32]string{
0: "UNSET",
1: "UINT64",
2: "BYTES",
}
var KeyspaceIdType_value = map[string]int32{
"UNSET": 0,
"UINT64": 1,
"BYTES": 2,
}
func (x KeyspaceIdType) String() string {
return proto.EnumName(KeyspaceIdType_name, int32(x))
}
// TabletType represents the type of a given tablet.
type TabletType int32
const (
TabletType_UNKNOWN TabletType = 0
TabletType_IDLE TabletType = 1
TabletType_MASTER TabletType = 2
TabletType_REPLICA TabletType = 3
TabletType_RDONLY TabletType = 4
TabletType_BATCH TabletType = 4
TabletType_SPARE TabletType = 5
TabletType_EXPERIMENTAL TabletType = 6
TabletType_SCHEMA_UPGRADE TabletType = 7
TabletType_BACKUP TabletType = 8
TabletType_RESTORE TabletType = 9
TabletType_WORKER TabletType = 10
TabletType_SCRAP TabletType = 11
)
var TabletType_name = map[int32]string{
0: "UNKNOWN",
1: "IDLE",
2: "MASTER",
3: "REPLICA",
4: "RDONLY",
// Duplicate value: 4: "BATCH",
5: "SPARE",
6: "EXPERIMENTAL",
7: "SCHEMA_UPGRADE",
8: "BACKUP",
9: "RESTORE",
10: "WORKER",
11: "SCRAP",
}
var TabletType_value = map[string]int32{
"UNKNOWN": 0,
"IDLE": 1,
"MASTER": 2,
"REPLICA": 3,
"RDONLY": 4,
"BATCH": 4,
"SPARE": 5,
"EXPERIMENTAL": 6,
"SCHEMA_UPGRADE": 7,
"BACKUP": 8,
"RESTORE": 9,
"WORKER": 10,
"SCRAP": 11,
}
func (x TabletType) String() string {
return proto.EnumName(TabletType_name, int32(x))
}
// KeyRange describes a range of sharding keys, when range-based
// sharding is used.
type KeyRange struct {
Start []byte `protobuf:"bytes,1,opt,name=start,proto3" json:"start,omitempty"`
End []byte `protobuf:"bytes,2,opt,name=end,proto3" json:"end,omitempty"`
}
func (m *KeyRange) Reset() { *m = KeyRange{} }
func (m *KeyRange) String() string { return proto.CompactTextString(m) }
func (*KeyRange) ProtoMessage() {}
// TabletAlias is a globally unique tablet identifier.
type TabletAlias struct {
// cell is the cell (or datacenter) the tablet is in
Cell string `protobuf:"bytes,1,opt,name=cell" json:"cell,omitempty"`
// uid is a unique id for this tablet within the shard
// (this is the MySQL server id as well).
Uid uint32 `protobuf:"varint,2,opt,name=uid" json:"uid,omitempty"`
}
func (m *TabletAlias) Reset() { *m = TabletAlias{} }
func (m *TabletAlias) String() string { return proto.CompactTextString(m) }
func (*TabletAlias) ProtoMessage() {}
// Tablet represents information about a running instance of vttablet.
type Tablet struct {
// alias is the unique name of the tablet.
Alias *TabletAlias `protobuf:"bytes,1,opt,name=alias" json:"alias,omitempty"`
// Fully qualified domain name of the host.
Hostname string `protobuf:"bytes,2,opt,name=hostname" json:"hostname,omitempty"`
// IP address, stored as a string.
Ip string `protobuf:"bytes,3,opt,name=ip" json:"ip,omitempty"`
// Map of named ports. Normally this should include vt, grpc, and mysql.
PortMap map[string]int32 `protobuf:"bytes,4,rep,name=port_map" json:"port_map,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
// Keyspace name.
Keyspace string `protobuf:"bytes,5,opt,name=keyspace" json:"keyspace,omitempty"`
// Shard name. If range based sharding is used, it should match
// key_range.
Shard string `protobuf:"bytes,6,opt,name=shard" json:"shard,omitempty"`
// If range based sharding is used, range for the tablet's shard.
KeyRange *KeyRange `protobuf:"bytes,7,opt,name=key_range" json:"key_range,omitempty"`
// type is the current type of the tablet.
Type TabletType `protobuf:"varint,8,opt,name=type,enum=topodata.TabletType" json:"type,omitempty"`
// It this is set, it is used as the database name instead of the
// normal "vt_" + keyspace.
DbNameOverride string `protobuf:"bytes,9,opt,name=db_name_override" json:"db_name_override,omitempty"`
// tablet tags
Tags map[string]string `protobuf:"bytes,10,rep,name=tags" json:"tags,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
// tablet health information
HealthMap map[string]string `protobuf:"bytes,11,rep,name=health_map" json:"health_map,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
}
func (m *Tablet) Reset() { *m = Tablet{} }
func (m *Tablet) String() string { return proto.CompactTextString(m) }
func (*Tablet) ProtoMessage() {}
func (m *Tablet) GetAlias() *TabletAlias {
if m != nil {
return m.Alias
}
return nil
}
func (m *Tablet) GetPortMap() map[string]int32 {
if m != nil {
return m.PortMap
}
return nil
}
func (m *Tablet) GetKeyRange() *KeyRange {
if m != nil {
return m.KeyRange
}
return nil
}
func (m *Tablet) GetTags() map[string]string {
if m != nil {
return m.Tags
}
return nil
}
func (m *Tablet) GetHealthMap() map[string]string {
if m != nil {
return m.HealthMap
}
return nil
}
// A Shard contains data about a subset of the data whithin a keyspace.
type Shard struct {
// master_alias is the tablet alias of the master for the shard.
// If it is unset, then there is no master in this shard yet.
MasterAlias *TabletAlias `protobuf:"bytes,1,opt,name=master_alias" json:"master_alias,omitempty"`
// key_range is the KeyRange for this shard. It can be unset if:
// - we are not using range-based sharding in this shard.
// - the shard covers the entire keyrange.
// This must match the shard name based on our other conventions, but
// helpful to have it decomposed here.
KeyRange *KeyRange `protobuf:"bytes,2,opt,name=key_range" json:"key_range,omitempty"`
// served_types has at most one entry per TabletType
ServedTypes []*Shard_ServedType `protobuf:"bytes,3,rep,name=served_types" json:"served_types,omitempty"`
// SourceShards is the list of shards we're replicating from,
// using filtered replication.
SourceShards []*Shard_SourceShard `protobuf:"bytes,4,rep,name=source_shards" json:"source_shards,omitempty"`
// Cells is the list of cells that contain tablets for this shard.
Cells []string `protobuf:"bytes,5,rep,name=cells" json:"cells,omitempty"`
// tablet_controls has at most one entry per TabletType
TabletControls []*Shard_TabletControl `protobuf:"bytes,6,rep,name=tablet_controls" json:"tablet_controls,omitempty"`
}
func (m *Shard) Reset() { *m = Shard{} }
func (m *Shard) String() string { return proto.CompactTextString(m) }
func (*Shard) ProtoMessage() {}
func (m *Shard) GetMasterAlias() *TabletAlias {
if m != nil {
return m.MasterAlias
}
return nil
}
func (m *Shard) GetKeyRange() *KeyRange {
if m != nil {
return m.KeyRange
}
return nil
}
func (m *Shard) GetServedTypes() []*Shard_ServedType {
if m != nil {
return m.ServedTypes
}
return nil
}
func (m *Shard) GetSourceShards() []*Shard_SourceShard {
if m != nil {
return m.SourceShards
}
return nil
}
func (m *Shard) GetTabletControls() []*Shard_TabletControl {
if m != nil {
return m.TabletControls
}
return nil
}
// ServedType is an entry in the served_types
type Shard_ServedType struct {
TabletType TabletType `protobuf:"varint,1,opt,name=tablet_type,enum=topodata.TabletType" json:"tablet_type,omitempty"`
Cells []string `protobuf:"bytes,2,rep,name=cells" json:"cells,omitempty"`
}
func (m *Shard_ServedType) Reset() { *m = Shard_ServedType{} }
func (m *Shard_ServedType) String() string { return proto.CompactTextString(m) }
func (*Shard_ServedType) ProtoMessage() {}
// SourceShard represents a data source for filtered replication
// accross shards. When this is used in a destination shard, the master
// of that shard will run filtered replication.
type Shard_SourceShard struct {
// Uid is the unique ID for this SourceShard object.
Uid uint32 `protobuf:"varint,1,opt,name=uid" json:"uid,omitempty"`
// the source keyspace
Keyspace string `protobuf:"bytes,2,opt,name=keyspace" json:"keyspace,omitempty"`
// the source shard
Shard string `protobuf:"bytes,3,opt,name=shard" json:"shard,omitempty"`
// the source shard keyrange
KeyRange *KeyRange `protobuf:"bytes,4,opt,name=key_range" json:"key_range,omitempty"`
// the source table list to replicate
Tables []string `protobuf:"bytes,5,rep,name=tables" json:"tables,omitempty"`
}
func (m *Shard_SourceShard) Reset() { *m = Shard_SourceShard{} }
func (m *Shard_SourceShard) String() string { return proto.CompactTextString(m) }
func (*Shard_SourceShard) ProtoMessage() {}
func (m *Shard_SourceShard) GetKeyRange() *KeyRange {
if m != nil {
return m.KeyRange
}
return nil
}
// TabletControl controls tablet's behavior
type Shard_TabletControl struct {
// which tablet type is affected
TabletType TabletType `protobuf:"varint,1,opt,name=tablet_type,enum=topodata.TabletType" json:"tablet_type,omitempty"`
Cells []string `protobuf:"bytes,2,rep,name=cells" json:"cells,omitempty"`
// what to do
DisableQueryService bool `protobuf:"varint,3,opt,name=disable_query_service" json:"disable_query_service,omitempty"`
BlacklistedTables []string `protobuf:"bytes,4,rep,name=blacklisted_tables" json:"blacklisted_tables,omitempty"`
}
func (m *Shard_TabletControl) Reset() { *m = Shard_TabletControl{} }
func (m *Shard_TabletControl) String() string { return proto.CompactTextString(m) }
func (*Shard_TabletControl) ProtoMessage() {}
// A Keyspace contains data about a keyspace.
type Keyspace struct {
// name of the column used for sharding
// empty if the keyspace is not sharded
ShardingColumnName string `protobuf:"bytes,1,opt,name=sharding_column_name" json:"sharding_column_name,omitempty"`
// type of the column used for sharding
// KIT_UNSET if the keyspace is not sharded
ShardingColumnType KeyspaceIdType `protobuf:"varint,2,opt,name=sharding_column_type,enum=topodata.KeyspaceIdType" json:"sharding_column_type,omitempty"`
// SplitShardCount stores the number of jobs to run to be sure to
// always have at most one job per shard (used during resharding).
SplitShardCount int32 `protobuf:"varint,3,opt,name=split_shard_count" json:"split_shard_count,omitempty"`
// ServedFrom will redirect the appropriate traffic to
// another keyspace.
ServedFroms []*Keyspace_ServedFrom `protobuf:"bytes,4,rep,name=served_froms" json:"served_froms,omitempty"`
}
func (m *Keyspace) Reset() { *m = Keyspace{} }
func (m *Keyspace) String() string { return proto.CompactTextString(m) }
func (*Keyspace) ProtoMessage() {}
func (m *Keyspace) GetServedFroms() []*Keyspace_ServedFrom {
if m != nil {
return m.ServedFroms
}
return nil
}
// ServedFrom indicates a relationship between a TabletType and the
// keyspace name that's serving it.
type Keyspace_ServedFrom struct {
// the tablet type (key for the map)
TabletType TabletType `protobuf:"varint,1,opt,name=tablet_type,enum=topodata.TabletType" json:"tablet_type,omitempty"`
// the cells to limit this to
Cells []string `protobuf:"bytes,2,rep,name=cells" json:"cells,omitempty"`
// the keyspace name that's serving it
Keyspace string `protobuf:"bytes,3,opt,name=keyspace" json:"keyspace,omitempty"`
}
func (m *Keyspace_ServedFrom) Reset() { *m = Keyspace_ServedFrom{} }
func (m *Keyspace_ServedFrom) String() string { return proto.CompactTextString(m) }
func (*Keyspace_ServedFrom) ProtoMessage() {}
// ShardReplication describes the MySQL replication relationships
// whithin a cell.
type ShardReplication struct {
// Note there can be only one Node in this array
// for a given tablet.
Nodes []*ShardReplication_Node `protobuf:"bytes,1,rep,name=nodes" json:"nodes,omitempty"`
}
func (m *ShardReplication) Reset() { *m = ShardReplication{} }
func (m *ShardReplication) String() string { return proto.CompactTextString(m) }
func (*ShardReplication) ProtoMessage() {}
func (m *ShardReplication) GetNodes() []*ShardReplication_Node {
if m != nil {
return m.Nodes
}
return nil
}
// Node describes a tablet instance within the cell
type ShardReplication_Node struct {
TabletAlias *TabletAlias `protobuf:"bytes,1,opt,name=tablet_alias" json:"tablet_alias,omitempty"`
}
func (m *ShardReplication_Node) Reset() { *m = ShardReplication_Node{} }
func (m *ShardReplication_Node) String() string { return proto.CompactTextString(m) }
func (*ShardReplication_Node) ProtoMessage() {}
func (m *ShardReplication_Node) GetTabletAlias() *TabletAlias {
if m != nil {
return m.TabletAlias
}
return nil
}
// EndPoint corresponds to a single tablet.
type EndPoint struct {
// The uid of the tablet.
Uid uint32 `protobuf:"varint,1,opt,name=uid" json:"uid,omitempty"`
// The host the tablet is running on (FQDN).
Host string `protobuf:"bytes,2,opt,name=host" json:"host,omitempty"`
// The ports opened for service.
PortMap map[string]int32 `protobuf:"bytes,3,rep,name=port_map" json:"port_map,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"varint,2,opt,name=value"`
// The health entries.
HealthMap map[string]string `protobuf:"bytes,4,rep,name=health_map" json:"health_map,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value"`
}
func (m *EndPoint) Reset() { *m = EndPoint{} }
func (m *EndPoint) String() string { return proto.CompactTextString(m) }
func (*EndPoint) ProtoMessage() {}
func (m *EndPoint) GetPortMap() map[string]int32 {
if m != nil {
return m.PortMap
}
return nil
}
func (m *EndPoint) GetHealthMap() map[string]string {
if m != nil {
return m.HealthMap
}
return nil
}
// EndPoints corresponds to a list of tablets.
type EndPoints struct {
Entries []*EndPoint `protobuf:"bytes,1,rep,name=entries" json:"entries,omitempty"`
}
func (m *EndPoints) Reset() { *m = EndPoints{} }
func (m *EndPoints) String() string { return proto.CompactTextString(m) }
func (*EndPoints) ProtoMessage() {}
func (m *EndPoints) GetEntries() []*EndPoint {
if m != nil {
return m.Entries
}
return nil
}
// SrvShard is a rollup node for the shard itself.
type SrvShard struct {
// Copied from Shard.
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
KeyRange *KeyRange `protobuf:"bytes,2,opt,name=key_range" json:"key_range,omitempty"`
// The cell that master tablet resides in.
MasterCell string `protobuf:"bytes,3,opt,name=master_cell" json:"master_cell,omitempty"`
}
func (m *SrvShard) Reset() { *m = SrvShard{} }
func (m *SrvShard) String() string { return proto.CompactTextString(m) }
func (*SrvShard) ProtoMessage() {}
func (m *SrvShard) GetKeyRange() *KeyRange {
if m != nil {
return m.KeyRange
}
return nil
}
// ShardReference is used as a pointer from a SrvKeyspace to a SrvShard
type ShardReference struct {
// Copied from Shard.
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
KeyRange *KeyRange `protobuf:"bytes,2,opt,name=key_range" json:"key_range,omitempty"`
}
func (m *ShardReference) Reset() { *m = ShardReference{} }
func (m *ShardReference) String() string { return proto.CompactTextString(m) }
func (*ShardReference) ProtoMessage() {}
func (m *ShardReference) GetKeyRange() *KeyRange {
if m != nil {
return m.KeyRange
}
return nil
}
// SrvKeyspace is a rollup node for the keyspace itself.
type SrvKeyspace struct {
// The partitions this keyspace is serving, per tablet type.
Partitions []*SrvKeyspace_KeyspacePartition `protobuf:"bytes,1,rep,name=partitions" json:"partitions,omitempty"`
// copied from Keyspace
ShardingColumnName string `protobuf:"bytes,2,opt,name=sharding_column_name" json:"sharding_column_name,omitempty"`
ShardingColumnType KeyspaceIdType `protobuf:"varint,3,opt,name=sharding_column_type,enum=topodata.KeyspaceIdType" json:"sharding_column_type,omitempty"`
ServedFrom []*SrvKeyspace_ServedFrom `protobuf:"bytes,4,rep,name=served_from" json:"served_from,omitempty"`
SplitShardCount int32 `protobuf:"varint,5,opt,name=split_shard_count" json:"split_shard_count,omitempty"`
}
func (m *SrvKeyspace) Reset() { *m = SrvKeyspace{} }
func (m *SrvKeyspace) String() string { return proto.CompactTextString(m) }
func (*SrvKeyspace) ProtoMessage() {}
func (m *SrvKeyspace) GetPartitions() []*SrvKeyspace_KeyspacePartition {
if m != nil {
return m.Partitions
}
return nil
}
func (m *SrvKeyspace) GetServedFrom() []*SrvKeyspace_ServedFrom {
if m != nil {
return m.ServedFrom
}
return nil
}
type SrvKeyspace_KeyspacePartition struct {
// The type this partition applies to.
ServedType TabletType `protobuf:"varint,1,opt,name=served_type,enum=topodata.TabletType" json:"served_type,omitempty"`
// List of non-overlapping continuous shards sorted by range.
ShardReferences []*ShardReference `protobuf:"bytes,2,rep,name=shard_references" json:"shard_references,omitempty"`
}
func (m *SrvKeyspace_KeyspacePartition) Reset() { *m = SrvKeyspace_KeyspacePartition{} }
func (m *SrvKeyspace_KeyspacePartition) String() string { return proto.CompactTextString(m) }
func (*SrvKeyspace_KeyspacePartition) ProtoMessage() {}
func (m *SrvKeyspace_KeyspacePartition) GetShardReferences() []*ShardReference {
if m != nil {
return m.ShardReferences
}
return nil
}
// ServedFrom indicates a relationship between a TabletType and the
// keyspace name that's serving it.
type SrvKeyspace_ServedFrom struct {
// the tablet type
TabletType TabletType `protobuf:"varint,1,opt,name=tablet_type,enum=topodata.TabletType" json:"tablet_type,omitempty"`
// the keyspace name that's serving it
Keyspace string `protobuf:"bytes,2,opt,name=keyspace" json:"keyspace,omitempty"`
}
func (m *SrvKeyspace_ServedFrom) Reset() { *m = SrvKeyspace_ServedFrom{} }
func (m *SrvKeyspace_ServedFrom) String() string { return proto.CompactTextString(m) }
func (*SrvKeyspace_ServedFrom) ProtoMessage() {}
func init() {
proto.RegisterEnum("topodata.KeyspaceIdType", KeyspaceIdType_name, KeyspaceIdType_value)
proto.RegisterEnum("topodata.TabletType", TabletType_name, TabletType_value)
}