-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
meta.thrift
1310 lines (1085 loc) · 31.9 KB
/
meta.thrift
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
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Copyright (c) 2018 vesoft inc. All rights reserved.
*
* This source code is licensed under Apache 2.0 License,
* attached with Common Clause Condition 1.0, found in the LICENSES directory.
*/
namespace cpp nebula.meta
namespace java com.vesoft.nebula.meta
namespace go nebula.meta
namespace js nebula.meta
namespace csharp nebula.meta
namespace py nebula2.meta
include "common.thrift"
/*
*
* Note: In order to support multiple languages, all strings
* have to be defined as **binary** in the thrift file
*
*/
typedef i64 (cpp.type = "nebula::SchemaVer") SchemaVer
typedef i64 (cpp.type = "nebula::ClusterID") ClusterID
enum AlterSchemaOp {
ADD = 0x01,
CHANGE = 0x02,
DROP = 0x03,
UNKNOWN = 0x04,
} (cpp.enum_strict)
/*
* GOD is A global senior administrator.like root of Linux systems.
* ADMIN is an administrator for a given Graph Space.
* USER is a normal user for a given Graph Space. A User can access (read and write)
* the data in the Graph Space.
* GUEST is a read-only role for a given Graph Space. A Guest cannot modify the data
* in the Graph Space.
*
* Refer to header file src/graph/PermissionManager.h for details.
*/
enum RoleType {
GOD = 0x01,
ADMIN = 0x02,
DBA = 0x03,
USER = 0x04,
GUEST = 0x05,
} (cpp.enum_strict)
union ID {
1: common.GraphSpaceID space_id,
2: common.TagID tag_id,
3: common.EdgeType edge_type,
4: common.IndexID index_id,
5: ClusterID cluster_id,
}
// Geo shape type
enum GeoShape {
ANY = 0,
POINT = 1,
LINESTRING = 2,
POLYGON = 3,
} (cpp.enum_strict)
// These are all data types supported in the graph properties
enum PropertyType {
UNKNOWN = 0,
// Simple types
BOOL = 1,
INT64 = 2, // This is the same as INT in v1
VID = 3, // Deprecated, only supported by v1
FLOAT = 4,
DOUBLE = 5,
STRING = 6,
// String with fixed length. If the string content is shorteri
// than the given length, '\0' will be padded to the end
FIXED_STRING = 7, // New in v2
INT8 = 8, // New in v2
INT16 = 9, // New in v2
INT32 = 10, // New in v2
// Date time
TIMESTAMP = 21,
DATE = 24,
DATETIME = 25,
TIME = 26,
// Geo spatial
GEOGRAPHY = 31,
} (cpp.enum_strict)
struct ColumnTypeDef {
1: required PropertyType type,
// type_length is valid for fixed_string type
2: optional i16 type_length = 0,
// geo_shape is valid for geography type
3: optional GeoShape geo_shape,
}
struct ColumnDef {
1: required binary name,
2: required ColumnTypeDef type,
3: optional binary default_value,
4: optional bool nullable = false,
5: optional binary comment,
}
struct SchemaProp {
1: optional i64 ttl_duration,
2: optional binary ttl_col,
3: optional binary comment,
}
struct Schema {
1: list<ColumnDef> columns,
2: SchemaProp schema_prop,
}
struct IdName {
1: ID id,
2: binary name,
}
enum IsolationLevel {
DEFAULT = 0x00, // allow add half edge(either in or out edge succeeded)
TOSS = 0x01, // add in and out edge atomic
} (cpp.enum_strict)
struct SpaceDesc {
1: binary space_name,
2: i32 partition_num = 0,
3: i32 replica_factor = 0,
4: binary charset_name,
5: binary collate_name,
6: ColumnTypeDef vid_type = {"type": PropertyType.FIXED_STRING, "type_length": 8},
7: optional binary group_name,
8: optional IsolationLevel isolation_level,
9: optional binary comment,
}
struct SpaceItem {
1: common.GraphSpaceID space_id,
2: SpaceDesc properties,
}
struct TagItem {
1: common.TagID tag_id,
2: binary tag_name,
3: SchemaVer version,
4: Schema schema,
}
struct AlterSchemaItem {
1: AlterSchemaOp op,
2: Schema schema,
}
struct EdgeItem {
1: common.EdgeType edge_type,
2: binary edge_name,
3: SchemaVer version,
4: Schema schema,
}
struct IndexItem {
1: common.IndexID index_id,
2: binary index_name,
3: common.SchemaID schema_id
4: binary schema_name,
5: list<ColumnDef> fields,
6: optional binary comment,
}
enum HostStatus {
ONLINE = 0x00,
OFFLINE = 0x01,
UNKNOWN = 0x02,
} (cpp.enum_strict)
enum SnapshotStatus {
VALID = 0x00,
INVALID = 0x01,
} (cpp.enum_strict)
struct HostItem {
1: common.HostAddr hostAddr,
2: HostStatus status,
3: map<binary, list<common.PartitionID>>
(cpp.template = "std::unordered_map") leader_parts,
4: map<binary, list<common.PartitionID>>
(cpp.template = "std::unordered_map") all_parts,
5: HostRole role,
6: binary git_info_sha,
7: optional binary zone_name,
// version of binary
8: optional binary version,
}
struct UserItem {
1: binary account,
// Disable user if lock status is true.
2: bool is_lock,
// The number of queries an account can issue per hour
3: i32 max_queries_per_hour,
// The number of updates an account can issue per hour
4: i32 max_updates_per_hour,
// The number of times an account can connect to the server per hour
5: i32 max_connections_per_hour,
// The number of simultaneous connections to the server by an account
6: i32 max_user_connections,
}
struct RoleItem {
1: binary user_id,
2: common.GraphSpaceID space_id,
3: RoleType role_type,
}
struct ExecResp {
1: common.ErrorCode code,
// For custom kv operations, it is useless.
2: ID id,
// Valid if ret equals E_LEADER_CHANGED.
3: common.HostAddr leader,
}
// Job related data structures
enum AdminJobOp {
ADD = 0x01,
SHOW_All = 0x02,
SHOW = 0x03,
STOP = 0x04,
RECOVER = 0x05,
} (cpp.enum_strict)
struct AdminJobReq {
1: AdminJobOp op,
2: AdminCmd cmd,
3: list<binary> paras,
}
enum AdminCmd {
COMPACT = 0,
FLUSH = 1,
REBUILD_TAG_INDEX = 2,
REBUILD_EDGE_INDEX = 3,
REBUILD_FULLTEXT_INDEX = 4,
STATS = 5,
DATA_BALANCE = 6,
DOWNLOAD = 7,
INGEST = 8,
UNKNOWN = 99,
} (cpp.enum_strict)
enum JobStatus {
QUEUE = 0x01,
RUNNING = 0x02,
FINISHED = 0x03,
FAILED = 0x04,
STOPPED = 0x05,
INVALID = 0xFF,
} (cpp.enum_strict)
struct JobDesc {
1: i32 id,
2: AdminCmd cmd,
3: list<string> paras,
4: JobStatus status,
5: i64 start_time,
6: i64 stop_time,
}
struct TaskDesc {
1: i32 task_id,
2: common.HostAddr host,
3: JobStatus status,
4: i64 start_time,
5: i64 stop_time,
6: i32 job_id,
}
struct AdminJobResult {
// used in a new added job, e.g. "flush" "compact"
// other job type which also need jobId in their result
// will use other filed. e.g. JobDesc::id
1: optional i32 job_id,
// used in "show jobs" and "show job <id>"
2: optional list<JobDesc> job_desc,
// used in "show job <id>"
3: optional list<TaskDesc> task_desc,
// used in "recover job"
4: optional i32 recovered_job_num,
}
struct AdminJobResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: AdminJobResult result,
}
struct Correlativity {
1: common.PartitionID part_id,
2: double proportion,
}
struct StatsItem {
// The number of vertices of tagName
1: map<binary, i64>
(cpp.template = "std::unordered_map") tag_vertices,
// The number of out edges of edgeName
2: map<binary, i64>
(cpp.template = "std::unordered_map") edges,
// The number of vertices of current space
3: i64 space_vertices,
// The number of edges of current space
4: i64 space_edges,
// Used to describe the proportion of positive edges
// between the current partition and other partitions.
5: map<common.PartitionID, list<Correlativity>>
(cpp.template = "std::unordered_map") positive_part_correlativity,
// Used to describe the proportion of negative edges
// between the current partition and other partitions.
6: map<common.PartitionID, list<Correlativity>>
(cpp.template = "std::unordered_map") negative_part_correlativity,
7: JobStatus status,
}
// Graph space related operations.
struct CreateSpaceReq {
1: SpaceDesc properties,
2: bool if_not_exists,
}
struct CreateSpaceAsReq {
1: binary old_space_name,
2: binary new_space_name,
}
struct DropSpaceReq {
1: binary space_name
2: bool if_exists,
}
struct ListSpacesReq {
}
struct ListSpacesResp {
1: common.ErrorCode code,
// Valid if ret equals E_LEADER_CHANGED.
2: common.HostAddr leader,
3: list<IdName> spaces,
}
struct GetSpaceReq {
1: binary space_name,
}
struct GetSpaceResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: SpaceItem item,
}
// Tags related operations
struct CreateTagReq {
1: common.GraphSpaceID space_id,
2: binary tag_name,
3: Schema schema,
4: bool if_not_exists,
}
struct AlterTagReq {
1: common.GraphSpaceID space_id,
2: binary tag_name,
3: list<AlterSchemaItem> tag_items,
4: SchemaProp schema_prop,
}
struct DropTagReq {
1: common.GraphSpaceID space_id,
2: binary tag_name,
3: bool if_exists,
}
struct ListTagsReq {
1: common.GraphSpaceID space_id,
}
struct ListTagsResp {
1: common.ErrorCode code,
// Valid if ret equals E_LEADER_CHANGED.
2: common.HostAddr leader,
3: list<TagItem> tags,
}
struct GetTagReq {
1: common.GraphSpaceID space_id,
2: binary tag_name,
3: SchemaVer version,
}
struct GetTagResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: Schema schema,
}
// Edge related operations.
struct CreateEdgeReq {
1: common.GraphSpaceID space_id,
2: binary edge_name,
3: Schema schema,
4: bool if_not_exists,
}
struct AlterEdgeReq {
1: common.GraphSpaceID space_id,
2: binary edge_name,
3: list<AlterSchemaItem> edge_items,
4: SchemaProp schema_prop,
}
struct GetEdgeReq {
1: common.GraphSpaceID space_id,
2: binary edge_name,
3: SchemaVer version,
}
struct GetEdgeResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: Schema schema,
}
struct DropEdgeReq {
1: common.GraphSpaceID space_id,
2: binary edge_name,
3: bool if_exists,
}
struct ListEdgesReq {
1: common.GraphSpaceID space_id,
}
struct ListEdgesResp {
1: common.ErrorCode code,
// Valid if ret equals E_LEADER_CHANGED.
2: common.HostAddr leader,
3: list<EdgeItem> edges,
}
enum ListHostType {
// nebula 1.0 show hosts, show leader, partition info
ALLOC = 0x00,
GRAPH = 0x01,
META = 0x02,
STORAGE = 0x03,
} (cpp.enum_strict)
struct ListHostsReq {
1: ListHostType type
}
struct ListHostsResp {
1: common.ErrorCode code,
// Valid if ret equals E_LEADER_CHANGED.
2: common.HostAddr leader,
3: list<HostItem> hosts,
}
struct PartItem {
1: required common.PartitionID part_id,
2: optional common.HostAddr leader,
3: required list<common.HostAddr> peers,
4: required list<common.HostAddr> losts,
}
struct ListPartsReq {
1: common.GraphSpaceID space_id,
2: list<common.PartitionID> part_ids;
}
struct ListPartsResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: list<PartItem> parts,
}
struct GetPartsAllocReq {
1: common.GraphSpaceID space_id,
}
struct GetPartsAllocResp {
1: common.ErrorCode code,
// Valid if ret equals E_LEADER_CHANGED.
2: common.HostAddr leader,
3: map<common.PartitionID, list<common.HostAddr>>(cpp.template = "std::unordered_map") parts,
4: optional map<common.PartitionID, i64>(cpp.template = "std::unordered_map") terms,
}
struct MultiPutReq {
// segment is used to avoid conflict with system data.
// it should be comprised of numbers and letters.
1: binary segment,
2: list<common.KeyValue> pairs,
}
struct GetReq {
1: binary segment,
2: binary key,
}
struct GetResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: binary value,
}
struct MultiGetReq {
1: binary segment,
2: list<binary> keys,
}
struct MultiGetResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: list<binary> values,
}
struct RemoveReq {
1: binary segment,
2: binary key,
}
struct RemoveRangeReq {
1: binary segment,
2: binary start,
3: binary end,
}
struct ScanReq {
1: binary segment,
2: binary start,
3: binary end,
}
struct ScanResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: list<binary> values,
}
struct HBResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: ClusterID cluster_id,
4: i64 last_update_time_in_ms,
5: i32 meta_version,
}
enum HostRole {
GRAPH = 0x00,
META = 0x01,
STORAGE = 0x02,
LISTENER = 0x03,
UNKNOWN = 0x04
} (cpp.enum_strict)
struct LeaderInfo {
1: common.PartitionID part_id,
2: i64 term
}
struct HBReq {
1: HostRole role,
2: common.HostAddr host,
3: ClusterID cluster_id,
4: optional map<common.GraphSpaceID, list<LeaderInfo>>
(cpp.template = "std::unordered_map") leader_partIds;
5: binary git_info_sha,
// version of binary
6: optional binary version,
}
struct IndexFieldDef {
1: required binary name,
// type_length is required if the field type is STRING.
2: optional i16 type_length,
}
struct CreateTagIndexReq {
1: common.GraphSpaceID space_id,
2: binary index_name,
3: binary tag_name,
4: list<IndexFieldDef> fields,
5: bool if_not_exists,
6: optional binary comment,
}
struct DropTagIndexReq {
1: common.GraphSpaceID space_id,
2: binary index_name,
3: bool if_exists,
}
struct GetTagIndexReq {
1: common.GraphSpaceID space_id,
2: binary index_name,
}
struct GetTagIndexResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: IndexItem item,
}
struct ListTagIndexesReq {
1: common.GraphSpaceID space_id,
}
struct ListTagIndexesResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: list<IndexItem> items,
}
struct CreateEdgeIndexReq {
1: common.GraphSpaceID space_id,
2: binary index_name,
3: binary edge_name,
4: list<IndexFieldDef> fields,
5: bool if_not_exists,
6: optional binary comment,
}
struct DropEdgeIndexReq {
1: common.GraphSpaceID space_id,
2: binary index_name,
3: bool if_exists,
}
struct GetEdgeIndexReq {
1: common.GraphSpaceID space_id,
2: binary index_name,
}
struct GetEdgeIndexResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: IndexItem item,
}
struct ListEdgeIndexesReq {
1: common.GraphSpaceID space_id,
}
struct ListEdgeIndexesResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: list<IndexItem> items,
}
struct RebuildIndexReq {
1: common.GraphSpaceID space_id,
2: binary index_name,
}
struct CreateUserReq {
1: binary account,
2: binary encoded_pwd,
3: bool if_not_exists,
}
struct DropUserReq {
1: binary account,
2: bool if_exists,
}
struct AlterUserReq {
1: binary account,
2: binary encoded_pwd,
}
struct GrantRoleReq {
1: RoleItem role_item,
}
struct RevokeRoleReq {
1: RoleItem role_item,
}
struct ListUsersReq {
}
struct ListUsersResp {
1: common.ErrorCode code,
// Valid if ret equals E_LEADER_CHANGED.
2: common.HostAddr leader,
// map<account, encoded password>
3: map<binary, binary> (cpp.template = "std::unordered_map") users,
}
struct ListRolesReq {
1: common.GraphSpaceID space_id,
}
struct ListRolesResp {
1: common.ErrorCode code,
// Valid if ret equals E_LEADER_CHANGED.
2: common.HostAddr leader,
3: list<RoleItem> roles,
}
struct GetUserRolesReq {
1: binary account,
}
struct ChangePasswordReq {
1: binary account,
2: binary new_encoded_pwd,
3: binary old_encoded_pwd,
}
struct BalanceReq {
1: optional common.GraphSpaceID space_id,
// Specify the balance id to check the status of the related balance plan
2: optional i64 id,
3: optional list<common.HostAddr> host_del,
4: optional bool stop,
5: optional bool reset,
}
enum TaskResult {
SUCCEEDED = 0x00,
FAILED = 0x01,
IN_PROGRESS = 0x02,
INVALID = 0x03,
} (cpp.enum_strict)
struct BalanceTask {
1: binary id,
2: TaskResult result,
}
struct BalanceResp {
1: common.ErrorCode code,
2: i64 id,
// Valid if code equals E_LEADER_CHANGED.
3: common.HostAddr leader,
4: list<BalanceTask> tasks,
}
struct LeaderBalanceReq {
}
enum ConfigModule {
UNKNOWN = 0x00,
ALL = 0x01,
GRAPH = 0x02,
META = 0x03,
STORAGE = 0x04,
} (cpp.enum_strict)
enum ConfigMode {
IMMUTABLE = 0x00,
REBOOT = 0x01,
MUTABLE = 0x02,
IGNORED = 0x03,
} (cpp.enum_strict)
struct ConfigItem {
1: ConfigModule module,
2: binary name,
3: ConfigMode mode,
4: common.Value value,
}
struct RegConfigReq {
1: list<ConfigItem> items,
}
struct GetConfigReq {
1: ConfigItem item,
}
struct GetConfigResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: list<ConfigItem> items,
}
struct SetConfigReq {
1: ConfigItem item,
}
struct ListConfigsReq {
1: binary space,
2: ConfigModule module,
}
struct ListConfigsResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: list<ConfigItem> items,
}
struct CreateSnapshotReq {
}
struct DropSnapshotReq {
1: binary name,
}
struct ListSnapshotsReq {
}
struct Snapshot {
1: binary name,
2: SnapshotStatus status,
3: binary hosts,
}
struct ListSnapshotsResp {
1: common.ErrorCode code,
// Valid if code equals E_LEADER_CHANGED.
2: common.HostAddr leader,
3: list<Snapshot> snapshots,
}
struct ListIndexStatusReq {
1: common.GraphSpaceID space_id,
}
struct IndexStatus {
1: binary name,
2: binary status,
}
struct ListIndexStatusResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: list<IndexStatus> statuses,
}
// Zone related interface
struct AddZoneReq {
1: binary zone_name,
2: list<common.HostAddr> nodes,
}
struct DropZoneReq {
1: binary zone_name,
}
struct AddHostIntoZoneReq {
1: common.HostAddr node,
2: binary zone_name,
}
struct DropHostFromZoneReq {
1: common.HostAddr node,
2: binary zone_name,
}
struct GetZoneReq {
1: binary zone_name,
}
struct GetZoneResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: list<common.HostAddr> hosts,
}
struct ListZonesReq {
}
struct Zone {
1: binary zone_name,
2: list<common.HostAddr> nodes,
}
struct ListZonesResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: list<Zone> zones,
}
struct AddGroupReq {
1: binary group_name,
2: list<binary> zone_names,
}
struct DropGroupReq {
1: binary group_name,
}
struct AddZoneIntoGroupReq {
1: binary zone_name,
2: binary group_name,
}
struct DropZoneFromGroupReq {
1: binary zone_name,
2: binary group_name,
}
struct GetGroupReq {
1: binary group_name,
}
struct GetGroupResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: list<binary> zone_names,
}
struct ListGroupsReq {
}
struct Group {
1: binary group_name,
2: list<binary> zone_names,
}
struct ListGroupsResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: list<Group> groups,
}
enum ListenerType {
UNKNOWN = 0x00,
ELASTICSEARCH = 0x01,
} (cpp.enum_strict)
struct AddListenerReq {
1: common.GraphSpaceID space_id,
2: ListenerType type,
3: list<common.HostAddr> hosts,
}
struct RemoveListenerReq {
1: common.GraphSpaceID space_id,
2: ListenerType type,
}
struct ListListenerReq {
1: common.GraphSpaceID space_id,
}
struct ListenerInfo {
1: ListenerType type,
2: common.HostAddr host,
3: common.PartitionID part_id,
4: HostStatus status,
}
struct ListListenerResp {
1: common.ErrorCode code,
2: common.HostAddr leader,
3: list<ListenerInfo> listeners,
}
struct GetStatsReq {
1: common.GraphSpaceID space_id,
}
struct GetStatsResp {
1: common.ErrorCode code,
// Valid if ret equals E_LEADER_CHANGED.
2: common.HostAddr leader,
3: StatsItem stats,
}
struct BackupInfo {
1: common.HostAddr host,
2: list<common.CheckpointInfo> info,
}
struct SpaceBackupInfo {
1: SpaceDesc space,
2: list<BackupInfo> info,
}
struct BackupMeta {
// space_name => SpaceBackupInfo
1: map<common.GraphSpaceID, SpaceBackupInfo> (cpp.template = "std::unordered_map") backup_info,