forked from pingcap/tidb
/
raft_cmdpb.pb.go
6859 lines (6571 loc) · 161 KB
/
raft_cmdpb.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
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
// Code generated by protoc-gen-gogo.
// source: raft_cmdpb.proto
// DO NOT EDIT!
/*
Package raft_cmdpb is a generated protocol buffer package.
It is generated from these files:
raft_cmdpb.proto
It has these top-level messages:
GetRequest
GetResponse
PutRequest
PutResponse
DeleteRequest
DeleteResponse
SnapRequest
SnapResponse
Request
Response
ChangePeerRequest
ChangePeerResponse
SplitRequest
SplitResponse
CompactLogRequest
CompactLogResponse
TransferLeaderRequest
TransferLeaderResponse
VerifyHashRequest
VerifyHashResponse
AdminRequest
AdminResponse
RegionLeaderRequest
RegionLeaderResponse
RegionDetailRequest
RegionDetailResponse
StatusRequest
StatusResponse
RaftRequestHeader
RaftResponseHeader
RaftCmdRequest
RaftCmdResponse
*/
package raft_cmdpb
import (
"fmt"
"io"
"math"
proto "github.com/golang/protobuf/proto"
metapb "github.com/pingcap/kvproto/pkg/metapb"
errorpb "github.com/pingcap/kvproto/pkg/errorpb"
eraftpb "github.com/pingcap/kvproto/pkg/eraftpb"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type CmdType int32
const (
CmdType_Invalid CmdType = 0
CmdType_Get CmdType = 1
CmdType_Put CmdType = 3
CmdType_Delete CmdType = 4
CmdType_Snap CmdType = 5
)
var CmdType_name = map[int32]string{
0: "Invalid",
1: "Get",
3: "Put",
4: "Delete",
5: "Snap",
}
var CmdType_value = map[string]int32{
"Invalid": 0,
"Get": 1,
"Put": 3,
"Delete": 4,
"Snap": 5,
}
func (x CmdType) Enum() *CmdType {
p := new(CmdType)
*p = x
return p
}
func (x CmdType) String() string {
return proto.EnumName(CmdType_name, int32(x))
}
func (x *CmdType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(CmdType_value, data, "CmdType")
if err != nil {
return err
}
*x = CmdType(value)
return nil
}
func (CmdType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{0} }
type AdminCmdType int32
const (
AdminCmdType_InvalidAdmin AdminCmdType = 0
AdminCmdType_ChangePeer AdminCmdType = 1
AdminCmdType_Split AdminCmdType = 2
AdminCmdType_CompactLog AdminCmdType = 3
AdminCmdType_TransferLeader AdminCmdType = 4
AdminCmdType_ComputeHash AdminCmdType = 5
AdminCmdType_VerifyHash AdminCmdType = 6
)
var AdminCmdType_name = map[int32]string{
0: "InvalidAdmin",
1: "ChangePeer",
2: "Split",
3: "CompactLog",
4: "TransferLeader",
5: "ComputeHash",
6: "VerifyHash",
}
var AdminCmdType_value = map[string]int32{
"InvalidAdmin": 0,
"ChangePeer": 1,
"Split": 2,
"CompactLog": 3,
"TransferLeader": 4,
"ComputeHash": 5,
"VerifyHash": 6,
}
func (x AdminCmdType) Enum() *AdminCmdType {
p := new(AdminCmdType)
*p = x
return p
}
func (x AdminCmdType) String() string {
return proto.EnumName(AdminCmdType_name, int32(x))
}
func (x *AdminCmdType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(AdminCmdType_value, data, "AdminCmdType")
if err != nil {
return err
}
*x = AdminCmdType(value)
return nil
}
func (AdminCmdType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{1} }
type StatusCmdType int32
const (
StatusCmdType_InvalidStatus StatusCmdType = 0
StatusCmdType_RegionLeader StatusCmdType = 1
StatusCmdType_RegionDetail StatusCmdType = 2
)
var StatusCmdType_name = map[int32]string{
0: "InvalidStatus",
1: "RegionLeader",
2: "RegionDetail",
}
var StatusCmdType_value = map[string]int32{
"InvalidStatus": 0,
"RegionLeader": 1,
"RegionDetail": 2,
}
func (x StatusCmdType) Enum() *StatusCmdType {
p := new(StatusCmdType)
*p = x
return p
}
func (x StatusCmdType) String() string {
return proto.EnumName(StatusCmdType_name, int32(x))
}
func (x *StatusCmdType) UnmarshalJSON(data []byte) error {
value, err := proto.UnmarshalJSONEnum(StatusCmdType_value, data, "StatusCmdType")
if err != nil {
return err
}
*x = StatusCmdType(value)
return nil
}
func (StatusCmdType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{2} }
type GetRequest struct {
Cf *string `protobuf:"bytes,1,opt,name=cf" json:"cf,omitempty"`
Key []byte `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *GetRequest) Reset() { *m = GetRequest{} }
func (m *GetRequest) String() string { return proto.CompactTextString(m) }
func (*GetRequest) ProtoMessage() {}
func (*GetRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{0} }
func (m *GetRequest) GetCf() string {
if m != nil && m.Cf != nil {
return *m.Cf
}
return ""
}
func (m *GetRequest) GetKey() []byte {
if m != nil {
return m.Key
}
return nil
}
type GetResponse struct {
Value []byte `protobuf:"bytes,1,opt,name=value" json:"value,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *GetResponse) Reset() { *m = GetResponse{} }
func (m *GetResponse) String() string { return proto.CompactTextString(m) }
func (*GetResponse) ProtoMessage() {}
func (*GetResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{1} }
func (m *GetResponse) GetValue() []byte {
if m != nil {
return m.Value
}
return nil
}
type PutRequest struct {
Cf *string `protobuf:"bytes,1,opt,name=cf" json:"cf,omitempty"`
Key []byte `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"`
Value []byte `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *PutRequest) Reset() { *m = PutRequest{} }
func (m *PutRequest) String() string { return proto.CompactTextString(m) }
func (*PutRequest) ProtoMessage() {}
func (*PutRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{2} }
func (m *PutRequest) GetCf() string {
if m != nil && m.Cf != nil {
return *m.Cf
}
return ""
}
func (m *PutRequest) GetKey() []byte {
if m != nil {
return m.Key
}
return nil
}
func (m *PutRequest) GetValue() []byte {
if m != nil {
return m.Value
}
return nil
}
type PutResponse struct {
XXX_unrecognized []byte `json:"-"`
}
func (m *PutResponse) Reset() { *m = PutResponse{} }
func (m *PutResponse) String() string { return proto.CompactTextString(m) }
func (*PutResponse) ProtoMessage() {}
func (*PutResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{3} }
type DeleteRequest struct {
Cf *string `protobuf:"bytes,1,opt,name=cf" json:"cf,omitempty"`
Key []byte `protobuf:"bytes,2,opt,name=key" json:"key,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *DeleteRequest) Reset() { *m = DeleteRequest{} }
func (m *DeleteRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteRequest) ProtoMessage() {}
func (*DeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{4} }
func (m *DeleteRequest) GetCf() string {
if m != nil && m.Cf != nil {
return *m.Cf
}
return ""
}
func (m *DeleteRequest) GetKey() []byte {
if m != nil {
return m.Key
}
return nil
}
type DeleteResponse struct {
XXX_unrecognized []byte `json:"-"`
}
func (m *DeleteResponse) Reset() { *m = DeleteResponse{} }
func (m *DeleteResponse) String() string { return proto.CompactTextString(m) }
func (*DeleteResponse) ProtoMessage() {}
func (*DeleteResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{5} }
type SnapRequest struct {
XXX_unrecognized []byte `json:"-"`
}
func (m *SnapRequest) Reset() { *m = SnapRequest{} }
func (m *SnapRequest) String() string { return proto.CompactTextString(m) }
func (*SnapRequest) ProtoMessage() {}
func (*SnapRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{6} }
type SnapResponse struct {
Region *metapb.Region `protobuf:"bytes,1,opt,name=region" json:"region,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *SnapResponse) Reset() { *m = SnapResponse{} }
func (m *SnapResponse) String() string { return proto.CompactTextString(m) }
func (*SnapResponse) ProtoMessage() {}
func (*SnapResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{7} }
func (m *SnapResponse) GetRegion() *metapb.Region {
if m != nil {
return m.Region
}
return nil
}
type Request struct {
CmdType *CmdType `protobuf:"varint,1,opt,name=cmd_type,json=cmdType,enum=raft_cmdpb.CmdType" json:"cmd_type,omitempty"`
Get *GetRequest `protobuf:"bytes,2,opt,name=get" json:"get,omitempty"`
Put *PutRequest `protobuf:"bytes,4,opt,name=put" json:"put,omitempty"`
Delete *DeleteRequest `protobuf:"bytes,5,opt,name=delete" json:"delete,omitempty"`
Snap *SnapRequest `protobuf:"bytes,6,opt,name=snap" json:"snap,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *Request) Reset() { *m = Request{} }
func (m *Request) String() string { return proto.CompactTextString(m) }
func (*Request) ProtoMessage() {}
func (*Request) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{8} }
func (m *Request) GetCmdType() CmdType {
if m != nil && m.CmdType != nil {
return *m.CmdType
}
return CmdType_Invalid
}
func (m *Request) GetGet() *GetRequest {
if m != nil {
return m.Get
}
return nil
}
func (m *Request) GetPut() *PutRequest {
if m != nil {
return m.Put
}
return nil
}
func (m *Request) GetDelete() *DeleteRequest {
if m != nil {
return m.Delete
}
return nil
}
func (m *Request) GetSnap() *SnapRequest {
if m != nil {
return m.Snap
}
return nil
}
type Response struct {
CmdType *CmdType `protobuf:"varint,1,opt,name=cmd_type,json=cmdType,enum=raft_cmdpb.CmdType" json:"cmd_type,omitempty"`
Get *GetResponse `protobuf:"bytes,2,opt,name=get" json:"get,omitempty"`
Put *PutResponse `protobuf:"bytes,4,opt,name=put" json:"put,omitempty"`
Delete *DeleteResponse `protobuf:"bytes,5,opt,name=delete" json:"delete,omitempty"`
Snap *SnapResponse `protobuf:"bytes,6,opt,name=snap" json:"snap,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *Response) Reset() { *m = Response{} }
func (m *Response) String() string { return proto.CompactTextString(m) }
func (*Response) ProtoMessage() {}
func (*Response) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{9} }
func (m *Response) GetCmdType() CmdType {
if m != nil && m.CmdType != nil {
return *m.CmdType
}
return CmdType_Invalid
}
func (m *Response) GetGet() *GetResponse {
if m != nil {
return m.Get
}
return nil
}
func (m *Response) GetPut() *PutResponse {
if m != nil {
return m.Put
}
return nil
}
func (m *Response) GetDelete() *DeleteResponse {
if m != nil {
return m.Delete
}
return nil
}
func (m *Response) GetSnap() *SnapResponse {
if m != nil {
return m.Snap
}
return nil
}
type ChangePeerRequest struct {
// This can be only called in internal RaftStore now.
ChangeType *eraftpb.ConfChangeType `protobuf:"varint,1,opt,name=change_type,json=changeType,enum=eraftpb.ConfChangeType" json:"change_type,omitempty"`
Peer *metapb.Peer `protobuf:"bytes,2,opt,name=peer" json:"peer,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *ChangePeerRequest) Reset() { *m = ChangePeerRequest{} }
func (m *ChangePeerRequest) String() string { return proto.CompactTextString(m) }
func (*ChangePeerRequest) ProtoMessage() {}
func (*ChangePeerRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{10} }
func (m *ChangePeerRequest) GetChangeType() eraftpb.ConfChangeType {
if m != nil && m.ChangeType != nil {
return *m.ChangeType
}
return eraftpb.ConfChangeType_AddNode
}
func (m *ChangePeerRequest) GetPeer() *metapb.Peer {
if m != nil {
return m.Peer
}
return nil
}
type ChangePeerResponse struct {
Region *metapb.Region `protobuf:"bytes,1,opt,name=region" json:"region,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *ChangePeerResponse) Reset() { *m = ChangePeerResponse{} }
func (m *ChangePeerResponse) String() string { return proto.CompactTextString(m) }
func (*ChangePeerResponse) ProtoMessage() {}
func (*ChangePeerResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{11} }
func (m *ChangePeerResponse) GetRegion() *metapb.Region {
if m != nil {
return m.Region
}
return nil
}
type SplitRequest struct {
// This can be only called in internal RaftStore now.
// The split_key must be in the been splitting region.
SplitKey []byte `protobuf:"bytes,1,opt,name=split_key,json=splitKey" json:"split_key,omitempty"`
// We split the region into two, first uses the origin
// parent region id, and the second uses the new_region_id.
// We must guarantee that the new_region_id is global unique.
NewRegionId *uint64 `protobuf:"varint,2,opt,name=new_region_id,json=newRegionId" json:"new_region_id,omitempty"`
// The peer ids for the new split region.
NewPeerIds []uint64 `protobuf:"varint,3,rep,name=new_peer_ids,json=newPeerIds" json:"new_peer_ids,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *SplitRequest) Reset() { *m = SplitRequest{} }
func (m *SplitRequest) String() string { return proto.CompactTextString(m) }
func (*SplitRequest) ProtoMessage() {}
func (*SplitRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{12} }
func (m *SplitRequest) GetSplitKey() []byte {
if m != nil {
return m.SplitKey
}
return nil
}
func (m *SplitRequest) GetNewRegionId() uint64 {
if m != nil && m.NewRegionId != nil {
return *m.NewRegionId
}
return 0
}
func (m *SplitRequest) GetNewPeerIds() []uint64 {
if m != nil {
return m.NewPeerIds
}
return nil
}
type SplitResponse struct {
Left *metapb.Region `protobuf:"bytes,1,opt,name=left" json:"left,omitempty"`
Right *metapb.Region `protobuf:"bytes,2,opt,name=right" json:"right,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *SplitResponse) Reset() { *m = SplitResponse{} }
func (m *SplitResponse) String() string { return proto.CompactTextString(m) }
func (*SplitResponse) ProtoMessage() {}
func (*SplitResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{13} }
func (m *SplitResponse) GetLeft() *metapb.Region {
if m != nil {
return m.Left
}
return nil
}
func (m *SplitResponse) GetRight() *metapb.Region {
if m != nil {
return m.Right
}
return nil
}
type CompactLogRequest struct {
CompactIndex *uint64 `protobuf:"varint,1,opt,name=compact_index,json=compactIndex" json:"compact_index,omitempty"`
CompactTerm *uint64 `protobuf:"varint,2,opt,name=compact_term,json=compactTerm" json:"compact_term,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *CompactLogRequest) Reset() { *m = CompactLogRequest{} }
func (m *CompactLogRequest) String() string { return proto.CompactTextString(m) }
func (*CompactLogRequest) ProtoMessage() {}
func (*CompactLogRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{14} }
func (m *CompactLogRequest) GetCompactIndex() uint64 {
if m != nil && m.CompactIndex != nil {
return *m.CompactIndex
}
return 0
}
func (m *CompactLogRequest) GetCompactTerm() uint64 {
if m != nil && m.CompactTerm != nil {
return *m.CompactTerm
}
return 0
}
type CompactLogResponse struct {
XXX_unrecognized []byte `json:"-"`
}
func (m *CompactLogResponse) Reset() { *m = CompactLogResponse{} }
func (m *CompactLogResponse) String() string { return proto.CompactTextString(m) }
func (*CompactLogResponse) ProtoMessage() {}
func (*CompactLogResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{15} }
type TransferLeaderRequest struct {
Peer *metapb.Peer `protobuf:"bytes,1,opt,name=peer" json:"peer,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *TransferLeaderRequest) Reset() { *m = TransferLeaderRequest{} }
func (m *TransferLeaderRequest) String() string { return proto.CompactTextString(m) }
func (*TransferLeaderRequest) ProtoMessage() {}
func (*TransferLeaderRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{16} }
func (m *TransferLeaderRequest) GetPeer() *metapb.Peer {
if m != nil {
return m.Peer
}
return nil
}
type TransferLeaderResponse struct {
XXX_unrecognized []byte `json:"-"`
}
func (m *TransferLeaderResponse) Reset() { *m = TransferLeaderResponse{} }
func (m *TransferLeaderResponse) String() string { return proto.CompactTextString(m) }
func (*TransferLeaderResponse) ProtoMessage() {}
func (*TransferLeaderResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{17} }
type VerifyHashRequest struct {
Index *uint64 `protobuf:"varint,1,opt,name=index" json:"index,omitempty"`
Hash []byte `protobuf:"bytes,2,opt,name=hash" json:"hash,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *VerifyHashRequest) Reset() { *m = VerifyHashRequest{} }
func (m *VerifyHashRequest) String() string { return proto.CompactTextString(m) }
func (*VerifyHashRequest) ProtoMessage() {}
func (*VerifyHashRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{18} }
func (m *VerifyHashRequest) GetIndex() uint64 {
if m != nil && m.Index != nil {
return *m.Index
}
return 0
}
func (m *VerifyHashRequest) GetHash() []byte {
if m != nil {
return m.Hash
}
return nil
}
type VerifyHashResponse struct {
XXX_unrecognized []byte `json:"-"`
}
func (m *VerifyHashResponse) Reset() { *m = VerifyHashResponse{} }
func (m *VerifyHashResponse) String() string { return proto.CompactTextString(m) }
func (*VerifyHashResponse) ProtoMessage() {}
func (*VerifyHashResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{19} }
type AdminRequest struct {
CmdType *AdminCmdType `protobuf:"varint,1,opt,name=cmd_type,json=cmdType,enum=raft_cmdpb.AdminCmdType" json:"cmd_type,omitempty"`
ChangePeer *ChangePeerRequest `protobuf:"bytes,2,opt,name=change_peer,json=changePeer" json:"change_peer,omitempty"`
Split *SplitRequest `protobuf:"bytes,3,opt,name=split" json:"split,omitempty"`
CompactLog *CompactLogRequest `protobuf:"bytes,4,opt,name=compact_log,json=compactLog" json:"compact_log,omitempty"`
TransferLeader *TransferLeaderRequest `protobuf:"bytes,5,opt,name=transfer_leader,json=transferLeader" json:"transfer_leader,omitempty"`
VerifyHash *VerifyHashRequest `protobuf:"bytes,6,opt,name=verify_hash,json=verifyHash" json:"verify_hash,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *AdminRequest) Reset() { *m = AdminRequest{} }
func (m *AdminRequest) String() string { return proto.CompactTextString(m) }
func (*AdminRequest) ProtoMessage() {}
func (*AdminRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{20} }
func (m *AdminRequest) GetCmdType() AdminCmdType {
if m != nil && m.CmdType != nil {
return *m.CmdType
}
return AdminCmdType_InvalidAdmin
}
func (m *AdminRequest) GetChangePeer() *ChangePeerRequest {
if m != nil {
return m.ChangePeer
}
return nil
}
func (m *AdminRequest) GetSplit() *SplitRequest {
if m != nil {
return m.Split
}
return nil
}
func (m *AdminRequest) GetCompactLog() *CompactLogRequest {
if m != nil {
return m.CompactLog
}
return nil
}
func (m *AdminRequest) GetTransferLeader() *TransferLeaderRequest {
if m != nil {
return m.TransferLeader
}
return nil
}
func (m *AdminRequest) GetVerifyHash() *VerifyHashRequest {
if m != nil {
return m.VerifyHash
}
return nil
}
type AdminResponse struct {
CmdType *AdminCmdType `protobuf:"varint,1,opt,name=cmd_type,json=cmdType,enum=raft_cmdpb.AdminCmdType" json:"cmd_type,omitempty"`
ChangePeer *ChangePeerResponse `protobuf:"bytes,2,opt,name=change_peer,json=changePeer" json:"change_peer,omitempty"`
Split *SplitResponse `protobuf:"bytes,3,opt,name=split" json:"split,omitempty"`
CompactLog *CompactLogResponse `protobuf:"bytes,4,opt,name=compact_log,json=compactLog" json:"compact_log,omitempty"`
TransferLeader *TransferLeaderResponse `protobuf:"bytes,5,opt,name=transfer_leader,json=transferLeader" json:"transfer_leader,omitempty"`
VerifyHash *VerifyHashResponse `protobuf:"bytes,6,opt,name=verify_hash,json=verifyHash" json:"verify_hash,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *AdminResponse) Reset() { *m = AdminResponse{} }
func (m *AdminResponse) String() string { return proto.CompactTextString(m) }
func (*AdminResponse) ProtoMessage() {}
func (*AdminResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{21} }
func (m *AdminResponse) GetCmdType() AdminCmdType {
if m != nil && m.CmdType != nil {
return *m.CmdType
}
return AdminCmdType_InvalidAdmin
}
func (m *AdminResponse) GetChangePeer() *ChangePeerResponse {
if m != nil {
return m.ChangePeer
}
return nil
}
func (m *AdminResponse) GetSplit() *SplitResponse {
if m != nil {
return m.Split
}
return nil
}
func (m *AdminResponse) GetCompactLog() *CompactLogResponse {
if m != nil {
return m.CompactLog
}
return nil
}
func (m *AdminResponse) GetTransferLeader() *TransferLeaderResponse {
if m != nil {
return m.TransferLeader
}
return nil
}
func (m *AdminResponse) GetVerifyHash() *VerifyHashResponse {
if m != nil {
return m.VerifyHash
}
return nil
}
// For get the leader of the region.
type RegionLeaderRequest struct {
XXX_unrecognized []byte `json:"-"`
}
func (m *RegionLeaderRequest) Reset() { *m = RegionLeaderRequest{} }
func (m *RegionLeaderRequest) String() string { return proto.CompactTextString(m) }
func (*RegionLeaderRequest) ProtoMessage() {}
func (*RegionLeaderRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{22} }
type RegionLeaderResponse struct {
Leader *metapb.Peer `protobuf:"bytes,1,opt,name=leader" json:"leader,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *RegionLeaderResponse) Reset() { *m = RegionLeaderResponse{} }
func (m *RegionLeaderResponse) String() string { return proto.CompactTextString(m) }
func (*RegionLeaderResponse) ProtoMessage() {}
func (*RegionLeaderResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{23} }
func (m *RegionLeaderResponse) GetLeader() *metapb.Peer {
if m != nil {
return m.Leader
}
return nil
}
// For getting more information of the region.
// We add some admin operations (ChangePeer, Split...) into the pb job list,
// then pd server will peek the first one, handle it and then pop it from the job lib.
// But sometimes, the pd server may crash before popping. When another pd server
// starts and finds the job is running but not finished, it will first check whether
// the raft server already has handled this job.
// E,g, for ChangePeer, if we add Peer10 into region1 and find region1 has already had
// Peer10, we can think this ChangePeer is finished, and can pop this job from job list
// directly.
type RegionDetailRequest struct {
XXX_unrecognized []byte `json:"-"`
}
func (m *RegionDetailRequest) Reset() { *m = RegionDetailRequest{} }
func (m *RegionDetailRequest) String() string { return proto.CompactTextString(m) }
func (*RegionDetailRequest) ProtoMessage() {}
func (*RegionDetailRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{24} }
type RegionDetailResponse struct {
Region *metapb.Region `protobuf:"bytes,1,opt,name=region" json:"region,omitempty"`
Leader *metapb.Peer `protobuf:"bytes,2,opt,name=leader" json:"leader,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *RegionDetailResponse) Reset() { *m = RegionDetailResponse{} }
func (m *RegionDetailResponse) String() string { return proto.CompactTextString(m) }
func (*RegionDetailResponse) ProtoMessage() {}
func (*RegionDetailResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{25} }
func (m *RegionDetailResponse) GetRegion() *metapb.Region {
if m != nil {
return m.Region
}
return nil
}
func (m *RegionDetailResponse) GetLeader() *metapb.Peer {
if m != nil {
return m.Leader
}
return nil
}
type StatusRequest struct {
CmdType *StatusCmdType `protobuf:"varint,1,opt,name=cmd_type,json=cmdType,enum=raft_cmdpb.StatusCmdType" json:"cmd_type,omitempty"`
RegionLeader *RegionLeaderRequest `protobuf:"bytes,2,opt,name=region_leader,json=regionLeader" json:"region_leader,omitempty"`
RegionDetail *RegionDetailRequest `protobuf:"bytes,3,opt,name=region_detail,json=regionDetail" json:"region_detail,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *StatusRequest) Reset() { *m = StatusRequest{} }
func (m *StatusRequest) String() string { return proto.CompactTextString(m) }
func (*StatusRequest) ProtoMessage() {}
func (*StatusRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{26} }
func (m *StatusRequest) GetCmdType() StatusCmdType {
if m != nil && m.CmdType != nil {
return *m.CmdType
}
return StatusCmdType_InvalidStatus
}
func (m *StatusRequest) GetRegionLeader() *RegionLeaderRequest {
if m != nil {
return m.RegionLeader
}
return nil
}
func (m *StatusRequest) GetRegionDetail() *RegionDetailRequest {
if m != nil {
return m.RegionDetail
}
return nil
}
type StatusResponse struct {
CmdType *StatusCmdType `protobuf:"varint,1,opt,name=cmd_type,json=cmdType,enum=raft_cmdpb.StatusCmdType" json:"cmd_type,omitempty"`
RegionLeader *RegionLeaderResponse `protobuf:"bytes,2,opt,name=region_leader,json=regionLeader" json:"region_leader,omitempty"`
RegionDetail *RegionDetailResponse `protobuf:"bytes,3,opt,name=region_detail,json=regionDetail" json:"region_detail,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *StatusResponse) Reset() { *m = StatusResponse{} }
func (m *StatusResponse) String() string { return proto.CompactTextString(m) }
func (*StatusResponse) ProtoMessage() {}
func (*StatusResponse) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{27} }
func (m *StatusResponse) GetCmdType() StatusCmdType {
if m != nil && m.CmdType != nil {
return *m.CmdType
}
return StatusCmdType_InvalidStatus
}
func (m *StatusResponse) GetRegionLeader() *RegionLeaderResponse {
if m != nil {
return m.RegionLeader
}
return nil
}
func (m *StatusResponse) GetRegionDetail() *RegionDetailResponse {
if m != nil {
return m.RegionDetail
}
return nil
}
type RaftRequestHeader struct {
RegionId *uint64 `protobuf:"varint,1,opt,name=region_id,json=regionId" json:"region_id,omitempty"`
Peer *metapb.Peer `protobuf:"bytes,2,opt,name=peer" json:"peer,omitempty"`
// true for read linearization
ReadQuorum *bool `protobuf:"varint,3,opt,name=read_quorum,json=readQuorum" json:"read_quorum,omitempty"`
// 16 bytes, to distinguish request.
Uuid []byte `protobuf:"bytes,4,opt,name=uuid" json:"uuid,omitempty"`
RegionEpoch *metapb.RegionEpoch `protobuf:"bytes,5,opt,name=region_epoch,json=regionEpoch" json:"region_epoch,omitempty"`
Term *uint64 `protobuf:"varint,6,opt,name=term" json:"term,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *RaftRequestHeader) Reset() { *m = RaftRequestHeader{} }
func (m *RaftRequestHeader) String() string { return proto.CompactTextString(m) }
func (*RaftRequestHeader) ProtoMessage() {}
func (*RaftRequestHeader) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{28} }
func (m *RaftRequestHeader) GetRegionId() uint64 {
if m != nil && m.RegionId != nil {
return *m.RegionId
}
return 0
}
func (m *RaftRequestHeader) GetPeer() *metapb.Peer {
if m != nil {
return m.Peer
}
return nil
}
func (m *RaftRequestHeader) GetReadQuorum() bool {
if m != nil && m.ReadQuorum != nil {
return *m.ReadQuorum
}
return false
}
func (m *RaftRequestHeader) GetUuid() []byte {
if m != nil {
return m.Uuid
}
return nil
}
func (m *RaftRequestHeader) GetRegionEpoch() *metapb.RegionEpoch {
if m != nil {
return m.RegionEpoch
}
return nil
}
func (m *RaftRequestHeader) GetTerm() uint64 {
if m != nil && m.Term != nil {
return *m.Term
}
return 0
}
type RaftResponseHeader struct {
Error *errorpb.Error `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"`
Uuid []byte `protobuf:"bytes,2,opt,name=uuid" json:"uuid,omitempty"`
CurrentTerm *uint64 `protobuf:"varint,3,opt,name=current_term,json=currentTerm" json:"current_term,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *RaftResponseHeader) Reset() { *m = RaftResponseHeader{} }
func (m *RaftResponseHeader) String() string { return proto.CompactTextString(m) }
func (*RaftResponseHeader) ProtoMessage() {}
func (*RaftResponseHeader) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{29} }
func (m *RaftResponseHeader) GetError() *errorpb.Error {
if m != nil {
return m.Error
}
return nil
}
func (m *RaftResponseHeader) GetUuid() []byte {
if m != nil {
return m.Uuid
}
return nil
}
func (m *RaftResponseHeader) GetCurrentTerm() uint64 {
if m != nil && m.CurrentTerm != nil {
return *m.CurrentTerm
}
return 0
}
type RaftCmdRequest struct {
Header *RaftRequestHeader `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
// We can't enclose normal requests and administrator request
// at same time.
Requests []*Request `protobuf:"bytes,2,rep,name=requests" json:"requests,omitempty"`
AdminRequest *AdminRequest `protobuf:"bytes,3,opt,name=admin_request,json=adminRequest" json:"admin_request,omitempty"`
StatusRequest *StatusRequest `protobuf:"bytes,4,opt,name=status_request,json=statusRequest" json:"status_request,omitempty"`
XXX_unrecognized []byte `json:"-"`
}
func (m *RaftCmdRequest) Reset() { *m = RaftCmdRequest{} }
func (m *RaftCmdRequest) String() string { return proto.CompactTextString(m) }
func (*RaftCmdRequest) ProtoMessage() {}
func (*RaftCmdRequest) Descriptor() ([]byte, []int) { return fileDescriptorRaftCmdpb, []int{30} }