generated from openacid/gotmpl
-
Notifications
You must be signed in to change notification settings - Fork 2
/
traft.pb.go
5857 lines (5641 loc) · 128 KB
/
traft.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. DO NOT EDIT.
// source: traft.proto
package traft
import (
context "context"
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
io "io"
math "math"
math_bits "math/bits"
)
// 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.GoGoProtoPackageIsVersion3 // please upgrade the proto package
// Cmd defines the action a log record does
type Cmd struct {
Op string `protobuf:"bytes,10,opt,name=Op,proto3" json:"Op,omitempty"`
Key string `protobuf:"bytes,20,opt,name=Key,proto3" json:"Key,omitempty"`
// Types that are valid to be assigned to Value:
// *Cmd_VStr
// *Cmd_VI64
// *Cmd_VClusterConfig
Value isCmd_Value `protobuf_oneof:"Value"`
}
func (m *Cmd) Reset() { *m = Cmd{} }
func (m *Cmd) String() string { return proto.CompactTextString(m) }
func (*Cmd) ProtoMessage() {}
func (*Cmd) Descriptor() ([]byte, []int) {
return fileDescriptor_39aa4f94ef5dbc0b, []int{0}
}
func (m *Cmd) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Cmd) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Cmd.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Cmd) XXX_Merge(src proto.Message) {
xxx_messageInfo_Cmd.Merge(m, src)
}
func (m *Cmd) XXX_Size() int {
return m.Size()
}
func (m *Cmd) XXX_DiscardUnknown() {
xxx_messageInfo_Cmd.DiscardUnknown(m)
}
var xxx_messageInfo_Cmd proto.InternalMessageInfo
type isCmd_Value interface {
isCmd_Value()
Equal(interface{}) bool
MarshalTo([]byte) (int, error)
Size() int
}
type Cmd_VStr struct {
VStr string `protobuf:"bytes,31,opt,name=VStr,proto3,oneof" json:"VStr,omitempty"`
}
type Cmd_VI64 struct {
VI64 int64 `protobuf:"varint,32,opt,name=VI64,proto3,oneof" json:"VI64,omitempty"`
}
type Cmd_VClusterConfig struct {
VClusterConfig *Cluster `protobuf:"bytes,33,opt,name=VClusterConfig,proto3,oneof" json:"VClusterConfig,omitempty"`
}
func (*Cmd_VStr) isCmd_Value() {}
func (*Cmd_VI64) isCmd_Value() {}
func (*Cmd_VClusterConfig) isCmd_Value() {}
func (m *Cmd) GetValue() isCmd_Value {
if m != nil {
return m.Value
}
return nil
}
func (m *Cmd) GetOp() string {
if m != nil {
return m.Op
}
return ""
}
func (m *Cmd) GetKey() string {
if m != nil {
return m.Key
}
return ""
}
func (m *Cmd) GetVStr() string {
if x, ok := m.GetValue().(*Cmd_VStr); ok {
return x.VStr
}
return ""
}
func (m *Cmd) GetVI64() int64 {
if x, ok := m.GetValue().(*Cmd_VI64); ok {
return x.VI64
}
return 0
}
func (m *Cmd) GetVClusterConfig() *Cluster {
if x, ok := m.GetValue().(*Cmd_VClusterConfig); ok {
return x.VClusterConfig
}
return nil
}
// XXX_OneofWrappers is for the internal use of the proto package.
func (*Cmd) XXX_OneofWrappers() []interface{} {
return []interface{}{
(*Cmd_VStr)(nil),
(*Cmd_VI64)(nil),
(*Cmd_VClusterConfig)(nil),
}
}
// TailBitmap is a bitmap that has all its leading bits set to `1`.
// Thus it is compressed with an Offset of all-ones position and a trailing
// bitmap.
// It is used to describe LogRecord dependency etc.
//
// The data structure is as the following described:
//
// reclaimed
// |
// | Offset
// | |
// v v
// ..... X ... 01010...00111 00...
// bitIndex: 0123... ^ ^
// | |
// Words[0] Words[1]
//
type TailBitmap struct {
Offset int64 `protobuf:"varint,1,opt,name=Offset,proto3" json:"Offset,omitempty"`
Words []uint64 `protobuf:"varint,2,rep,packed,name=Words,proto3" json:"Words,omitempty"`
Reclamed int64 `protobuf:"varint,3,opt,name=Reclamed,proto3" json:"Reclamed,omitempty"`
}
func (m *TailBitmap) Reset() { *m = TailBitmap{} }
func (m *TailBitmap) String() string { return proto.CompactTextString(m) }
func (*TailBitmap) ProtoMessage() {}
func (*TailBitmap) Descriptor() ([]byte, []int) {
return fileDescriptor_39aa4f94ef5dbc0b, []int{1}
}
func (m *TailBitmap) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *TailBitmap) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_TailBitmap.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *TailBitmap) XXX_Merge(src proto.Message) {
xxx_messageInfo_TailBitmap.Merge(m, src)
}
func (m *TailBitmap) XXX_Size() int {
return m.Size()
}
func (m *TailBitmap) XXX_DiscardUnknown() {
xxx_messageInfo_TailBitmap.DiscardUnknown(m)
}
var xxx_messageInfo_TailBitmap proto.InternalMessageInfo
func (m *TailBitmap) GetOffset() int64 {
if m != nil {
return m.Offset
}
return 0
}
func (m *TailBitmap) GetWords() []uint64 {
if m != nil {
return m.Words
}
return nil
}
func (m *TailBitmap) GetReclamed() int64 {
if m != nil {
return m.Reclamed
}
return 0
}
// LogRecord is a log record
type LogRecord struct {
// Which leader initially proposed this log.
// Author may not be the same with Committer, if Author fails when trying to
// commit a log record.
//
// TODO It seems this field is useless. Because we already have `Accepted`.
// This is different from the original raft:
// raft does not have a explicit concept `accepted`, which is essential in
// paxos.
// Instead, The `committed` in raft is defined as: leader forwards its
// own term log to a quorum.
Author *LeaderId `protobuf:"bytes,1,opt,name=Author,proto3" json:"Author,omitempty"`
// Log sequence number.
Seq int64 `protobuf:"varint,10,opt,name=Seq,proto3" json:"Seq,omitempty"`
// Cmd describes what this log does.
Cmd *Cmd `protobuf:"bytes,30,opt,name=Cmd,proto3" json:"Cmd,omitempty"`
// The logs that must be executed before this one.
// Normally it is the least lsn on a leader that is not purged yet.
Depends *TailBitmap `protobuf:"bytes,32,opt,name=Depends,proto3" json:"Depends,omitempty"`
// Overrides describes what previous logs this log record overrides.
Overrides *TailBitmap `protobuf:"bytes,40,opt,name=Overrides,proto3" json:"Overrides,omitempty"`
}
func (m *LogRecord) Reset() { *m = LogRecord{} }
func (m *LogRecord) String() string { return proto.CompactTextString(m) }
func (*LogRecord) ProtoMessage() {}
func (*LogRecord) Descriptor() ([]byte, []int) {
return fileDescriptor_39aa4f94ef5dbc0b, []int{2}
}
func (m *LogRecord) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *LogRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_LogRecord.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *LogRecord) XXX_Merge(src proto.Message) {
xxx_messageInfo_LogRecord.Merge(m, src)
}
func (m *LogRecord) XXX_Size() int {
return m.Size()
}
func (m *LogRecord) XXX_DiscardUnknown() {
xxx_messageInfo_LogRecord.DiscardUnknown(m)
}
var xxx_messageInfo_LogRecord proto.InternalMessageInfo
func (m *LogRecord) GetAuthor() *LeaderId {
if m != nil {
return m.Author
}
return nil
}
func (m *LogRecord) GetSeq() int64 {
if m != nil {
return m.Seq
}
return 0
}
func (m *LogRecord) GetCmd() *Cmd {
if m != nil {
return m.Cmd
}
return nil
}
func (m *LogRecord) GetDepends() *TailBitmap {
if m != nil {
return m.Depends
}
return nil
}
func (m *LogRecord) GetOverrides() *TailBitmap {
if m != nil {
return m.Overrides
}
return nil
}
type LeaderId struct {
Term int64 `protobuf:"varint,1,opt,name=Term,proto3" json:"Term,omitempty"`
Id int64 `protobuf:"varint,2,opt,name=Id,proto3" json:"Id,omitempty"`
}
func (m *LeaderId) Reset() { *m = LeaderId{} }
func (m *LeaderId) String() string { return proto.CompactTextString(m) }
func (*LeaderId) ProtoMessage() {}
func (*LeaderId) Descriptor() ([]byte, []int) {
return fileDescriptor_39aa4f94ef5dbc0b, []int{3}
}
func (m *LeaderId) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *LeaderId) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_LeaderId.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *LeaderId) XXX_Merge(src proto.Message) {
xxx_messageInfo_LeaderId.Merge(m, src)
}
func (m *LeaderId) XXX_Size() int {
return m.Size()
}
func (m *LeaderId) XXX_DiscardUnknown() {
xxx_messageInfo_LeaderId.DiscardUnknown(m)
}
var xxx_messageInfo_LeaderId proto.InternalMessageInfo
func (m *LeaderId) GetTerm() int64 {
if m != nil {
return m.Term
}
return 0
}
func (m *LeaderId) GetId() int64 {
if m != nil {
return m.Id
}
return 0
}
type Node struct {
// replica id of this replica.
Id int64 `protobuf:"varint,3,opt,name=Id,proto3" json:"Id,omitempty"`
Config *Cluster `protobuf:"bytes,1,opt,name=Config,proto3" json:"Config,omitempty"`
// From which log seq number we keeps here.
LogOffset int64 `protobuf:"varint,4,opt,name=LogOffset,proto3" json:"LogOffset,omitempty"`
Logs []*LogRecord `protobuf:"bytes,2,rep,name=Logs,proto3" json:"Logs,omitempty"`
// local view of every replica, including this node too.
Status map[int64]*ReplicaStatus `protobuf:"bytes,6,rep,name=Status,proto3" json:"Status,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (m *Node) Reset() { *m = Node{} }
func (m *Node) String() string { return proto.CompactTextString(m) }
func (*Node) ProtoMessage() {}
func (*Node) Descriptor() ([]byte, []int) {
return fileDescriptor_39aa4f94ef5dbc0b, []int{4}
}
func (m *Node) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Node) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Node.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Node) XXX_Merge(src proto.Message) {
xxx_messageInfo_Node.Merge(m, src)
}
func (m *Node) XXX_Size() int {
return m.Size()
}
func (m *Node) XXX_DiscardUnknown() {
xxx_messageInfo_Node.DiscardUnknown(m)
}
var xxx_messageInfo_Node proto.InternalMessageInfo
func (m *Node) GetId() int64 {
if m != nil {
return m.Id
}
return 0
}
func (m *Node) GetConfig() *Cluster {
if m != nil {
return m.Config
}
return nil
}
func (m *Node) GetLogOffset() int64 {
if m != nil {
return m.LogOffset
}
return 0
}
func (m *Node) GetLogs() []*LogRecord {
if m != nil {
return m.Logs
}
return nil
}
func (m *Node) GetStatus() map[int64]*ReplicaStatus {
if m != nil {
return m.Status
}
return nil
}
type LogStatus struct {
Committer *LeaderId `protobuf:"bytes,4,opt,name=Committer,proto3" json:"Committer,omitempty"`
Accepted *TailBitmap `protobuf:"bytes,1,opt,name=Accepted,proto3" json:"Accepted,omitempty"`
}
func (m *LogStatus) Reset() { *m = LogStatus{} }
func (m *LogStatus) String() string { return proto.CompactTextString(m) }
func (*LogStatus) ProtoMessage() {}
func (*LogStatus) Descriptor() ([]byte, []int) {
return fileDescriptor_39aa4f94ef5dbc0b, []int{5}
}
func (m *LogStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *LogStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_LogStatus.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *LogStatus) XXX_Merge(src proto.Message) {
xxx_messageInfo_LogStatus.Merge(m, src)
}
func (m *LogStatus) XXX_Size() int {
return m.Size()
}
func (m *LogStatus) XXX_DiscardUnknown() {
xxx_messageInfo_LogStatus.DiscardUnknown(m)
}
var xxx_messageInfo_LogStatus proto.InternalMessageInfo
func (m *LogStatus) GetCommitter() *LeaderId {
if m != nil {
return m.Committer
}
return nil
}
func (m *LogStatus) GetAccepted() *TailBitmap {
if m != nil {
return m.Accepted
}
return nil
}
type ReplicaStatus struct {
// last seen term+id
// int64 Term = 3;
// int64 Id = 10;
// the last leader it voted for. or it is local term + local id.
// E.g., voted for itself.
//
// TODO cleanup comment:
// which replica it has voted for as a leader.
//
// Accepted is the same as VotedFor after receiving one log-replication
// message from the leader.
//
// Before receiving a message, VotedFor is the leader this replica knows of,
// Accepted is nil.
VotedFor *LeaderId `protobuf:"bytes,10,opt,name=VotedFor,proto3" json:"VotedFor,omitempty"`
// at what time the voted value expires,
// in unix time in nanosecond: 10^-9 second
VoteExpireAt int64 `protobuf:"varint,11,opt,name=VoteExpireAt,proto3" json:"VoteExpireAt,omitempty"`
// The Leader tried to commit all of the local logs.
// The Committer is the same as Author if a log entry is committed by its
// Author.
//
// If an Author fails and the log is finally committed by some other leader,
// Committer is a higher value than Author.
//
// It is similar to the vrnd/vballot concept in paxos.
// the Ballot number a value is accepted at.
Committer *LeaderId `protobuf:"bytes,4,opt,name=Committer,proto3" json:"Committer,omitempty"`
// What logs has been accepted by this replica.
Accepted *TailBitmap `protobuf:"bytes,1,opt,name=Accepted,proto3" json:"Accepted,omitempty"`
Committed *TailBitmap `protobuf:"bytes,2,opt,name=Committed,proto3" json:"Committed,omitempty"`
Applied *TailBitmap `protobuf:"bytes,3,opt,name=Applied,proto3" json:"Applied,omitempty"`
}
func (m *ReplicaStatus) Reset() { *m = ReplicaStatus{} }
func (m *ReplicaStatus) String() string { return proto.CompactTextString(m) }
func (*ReplicaStatus) ProtoMessage() {}
func (*ReplicaStatus) Descriptor() ([]byte, []int) {
return fileDescriptor_39aa4f94ef5dbc0b, []int{6}
}
func (m *ReplicaStatus) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ReplicaStatus) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ReplicaStatus.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *ReplicaStatus) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReplicaStatus.Merge(m, src)
}
func (m *ReplicaStatus) XXX_Size() int {
return m.Size()
}
func (m *ReplicaStatus) XXX_DiscardUnknown() {
xxx_messageInfo_ReplicaStatus.DiscardUnknown(m)
}
var xxx_messageInfo_ReplicaStatus proto.InternalMessageInfo
func (m *ReplicaStatus) GetVotedFor() *LeaderId {
if m != nil {
return m.VotedFor
}
return nil
}
func (m *ReplicaStatus) GetVoteExpireAt() int64 {
if m != nil {
return m.VoteExpireAt
}
return 0
}
func (m *ReplicaStatus) GetCommitter() *LeaderId {
if m != nil {
return m.Committer
}
return nil
}
func (m *ReplicaStatus) GetAccepted() *TailBitmap {
if m != nil {
return m.Accepted
}
return nil
}
func (m *ReplicaStatus) GetCommitted() *TailBitmap {
if m != nil {
return m.Committed
}
return nil
}
func (m *ReplicaStatus) GetApplied() *TailBitmap {
if m != nil {
return m.Applied
}
return nil
}
type ReplicaInfo struct {
Id int64 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
Addr string `protobuf:"bytes,2,opt,name=Addr,proto3" json:"Addr,omitempty"`
// Position indicates the index of this member in its cluster.
Position int64 `protobuf:"varint,3,opt,name=Position,proto3" json:"Position,omitempty"`
}
func (m *ReplicaInfo) Reset() { *m = ReplicaInfo{} }
func (m *ReplicaInfo) String() string { return proto.CompactTextString(m) }
func (*ReplicaInfo) ProtoMessage() {}
func (*ReplicaInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_39aa4f94ef5dbc0b, []int{7}
}
func (m *ReplicaInfo) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ReplicaInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ReplicaInfo.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *ReplicaInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReplicaInfo.Merge(m, src)
}
func (m *ReplicaInfo) XXX_Size() int {
return m.Size()
}
func (m *ReplicaInfo) XXX_DiscardUnknown() {
xxx_messageInfo_ReplicaInfo.DiscardUnknown(m)
}
var xxx_messageInfo_ReplicaInfo proto.InternalMessageInfo
func (m *ReplicaInfo) GetId() int64 {
if m != nil {
return m.Id
}
return 0
}
func (m *ReplicaInfo) GetAddr() string {
if m != nil {
return m.Addr
}
return ""
}
func (m *ReplicaInfo) GetPosition() int64 {
if m != nil {
return m.Position
}
return 0
}
type Cluster struct {
Members map[int64]*ReplicaInfo `protobuf:"bytes,11,rep,name=Members,proto3" json:"Members,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
Quorums []uint64 `protobuf:"varint,21,rep,packed,name=Quorums,proto3" json:"Quorums,omitempty"`
}
func (m *Cluster) Reset() { *m = Cluster{} }
func (m *Cluster) String() string { return proto.CompactTextString(m) }
func (*Cluster) ProtoMessage() {}
func (*Cluster) Descriptor() ([]byte, []int) {
return fileDescriptor_39aa4f94ef5dbc0b, []int{8}
}
func (m *Cluster) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *Cluster) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_Cluster.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *Cluster) XXX_Merge(src proto.Message) {
xxx_messageInfo_Cluster.Merge(m, src)
}
func (m *Cluster) XXX_Size() int {
return m.Size()
}
func (m *Cluster) XXX_DiscardUnknown() {
xxx_messageInfo_Cluster.DiscardUnknown(m)
}
var xxx_messageInfo_Cluster proto.InternalMessageInfo
func (m *Cluster) GetMembers() map[int64]*ReplicaInfo {
if m != nil {
return m.Members
}
return nil
}
func (m *Cluster) GetQuorums() []uint64 {
if m != nil {
return m.Quorums
}
return nil
}
type ElectReq struct {
// who initiates the election
Candidate *LeaderId `protobuf:"bytes,1,opt,name=Candidate,proto3" json:"Candidate,omitempty"`
// Latest leader that forwarded log to the candidate
Committer *LeaderId `protobuf:"bytes,2,opt,name=Committer,proto3" json:"Committer,omitempty"`
// what logs the candidate has.
Accepted *TailBitmap `protobuf:"bytes,3,opt,name=Accepted,proto3" json:"Accepted,omitempty"`
}
func (m *ElectReq) Reset() { *m = ElectReq{} }
func (m *ElectReq) String() string { return proto.CompactTextString(m) }
func (*ElectReq) ProtoMessage() {}
func (*ElectReq) Descriptor() ([]byte, []int) {
return fileDescriptor_39aa4f94ef5dbc0b, []int{9}
}
func (m *ElectReq) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ElectReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ElectReq.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *ElectReq) XXX_Merge(src proto.Message) {
xxx_messageInfo_ElectReq.Merge(m, src)
}
func (m *ElectReq) XXX_Size() int {
return m.Size()
}
func (m *ElectReq) XXX_DiscardUnknown() {
xxx_messageInfo_ElectReq.DiscardUnknown(m)
}
var xxx_messageInfo_ElectReq proto.InternalMessageInfo
func (m *ElectReq) GetCandidate() *LeaderId {
if m != nil {
return m.Candidate
}
return nil
}
func (m *ElectReq) GetCommitter() *LeaderId {
if m != nil {
return m.Committer
}
return nil
}
func (m *ElectReq) GetAccepted() *TailBitmap {
if m != nil {
return m.Accepted
}
return nil
}
type ElectReply struct {
OK bool `protobuf:"varint,10,opt,name=OK,proto3" json:"OK,omitempty"`
// the replica id this reply comes from
Id int64 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
// voted for a candidate or the previous voted other leader.
VotedFor *LeaderId `protobuf:"bytes,2,opt,name=VotedFor,proto3" json:"VotedFor,omitempty"`
// latest log committer.
Committer *LeaderId `protobuf:"bytes,4,opt,name=Committer,proto3" json:"Committer,omitempty"`
// what logs I have.
Accepted *TailBitmap `protobuf:"bytes,21,opt,name=Accepted,proto3" json:"Accepted,omitempty"`
Committed *TailBitmap `protobuf:"bytes,22,opt,name=Committed,proto3" json:"Committed,omitempty"`
// The logs that voter has but leader candidate does not have.
// For the leader to rebuild all possibly committed logs from a quorum.
Logs []*LogRecord `protobuf:"bytes,30,rep,name=Logs,proto3" json:"Logs,omitempty"`
}
func (m *ElectReply) Reset() { *m = ElectReply{} }
func (m *ElectReply) String() string { return proto.CompactTextString(m) }
func (*ElectReply) ProtoMessage() {}
func (*ElectReply) Descriptor() ([]byte, []int) {
return fileDescriptor_39aa4f94ef5dbc0b, []int{10}
}
func (m *ElectReply) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *ElectReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_ElectReply.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *ElectReply) XXX_Merge(src proto.Message) {
xxx_messageInfo_ElectReply.Merge(m, src)
}
func (m *ElectReply) XXX_Size() int {
return m.Size()
}
func (m *ElectReply) XXX_DiscardUnknown() {
xxx_messageInfo_ElectReply.DiscardUnknown(m)
}
var xxx_messageInfo_ElectReply proto.InternalMessageInfo
func (m *ElectReply) GetOK() bool {
if m != nil {
return m.OK
}
return false
}
func (m *ElectReply) GetId() int64 {
if m != nil {
return m.Id
}
return 0
}
func (m *ElectReply) GetVotedFor() *LeaderId {
if m != nil {
return m.VotedFor
}
return nil
}
func (m *ElectReply) GetCommitter() *LeaderId {
if m != nil {
return m.Committer
}
return nil
}
func (m *ElectReply) GetAccepted() *TailBitmap {
if m != nil {
return m.Accepted
}
return nil
}
func (m *ElectReply) GetCommitted() *TailBitmap {
if m != nil {
return m.Committed
}
return nil
}
func (m *ElectReply) GetLogs() []*LogRecord {
if m != nil {
return m.Logs
}
return nil
}
type LogForwardReq struct {
Committer *LeaderId `protobuf:"bytes,1,opt,name=Committer,proto3" json:"Committer,omitempty"`
Logs []*LogRecord `protobuf:"bytes,2,rep,name=Logs,proto3" json:"Logs,omitempty"`
// Committed indicates logs committed by leader.
// A follower should commit every log it has that is in Committed directly.
Committed *TailBitmap `protobuf:"bytes,3,opt,name=Committed,proto3" json:"Committed,omitempty"`
}
func (m *LogForwardReq) Reset() { *m = LogForwardReq{} }
func (m *LogForwardReq) String() string { return proto.CompactTextString(m) }
func (*LogForwardReq) ProtoMessage() {}
func (*LogForwardReq) Descriptor() ([]byte, []int) {
return fileDescriptor_39aa4f94ef5dbc0b, []int{11}
}
func (m *LogForwardReq) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *LogForwardReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_LogForwardReq.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *LogForwardReq) XXX_Merge(src proto.Message) {
xxx_messageInfo_LogForwardReq.Merge(m, src)
}
func (m *LogForwardReq) XXX_Size() int {
return m.Size()
}
func (m *LogForwardReq) XXX_DiscardUnknown() {
xxx_messageInfo_LogForwardReq.DiscardUnknown(m)
}
var xxx_messageInfo_LogForwardReq proto.InternalMessageInfo
func (m *LogForwardReq) GetCommitter() *LeaderId {
if m != nil {
return m.Committer
}
return nil
}
func (m *LogForwardReq) GetLogs() []*LogRecord {
if m != nil {
return m.Logs
}
return nil
}
func (m *LogForwardReq) GetCommitted() *TailBitmap {
if m != nil {
return m.Committed
}
return nil
}
type LogForwardReply struct {
OK bool `protobuf:"varint,10,opt,name=OK,proto3" json:"OK,omitempty"`
// A replica responding a VotedFor with the same value with
// ReplciateReq.Committer indicates the logs are accepted.
// Otherwise declined.
VotedFor *LeaderId `protobuf:"bytes,1,opt,name=VotedFor,proto3" json:"VotedFor,omitempty"`
Accepted *TailBitmap `protobuf:"bytes,2,opt,name=Accepted,proto3" json:"Accepted,omitempty"`
Committed *TailBitmap `protobuf:"bytes,3,opt,name=Committed,proto3" json:"Committed,omitempty"`
}
func (m *LogForwardReply) Reset() { *m = LogForwardReply{} }
func (m *LogForwardReply) String() string { return proto.CompactTextString(m) }
func (*LogForwardReply) ProtoMessage() {}
func (*LogForwardReply) Descriptor() ([]byte, []int) {
return fileDescriptor_39aa4f94ef5dbc0b, []int{12}
}
func (m *LogForwardReply) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *LogForwardReply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_LogForwardReply.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *LogForwardReply) XXX_Merge(src proto.Message) {
xxx_messageInfo_LogForwardReply.Merge(m, src)
}
func (m *LogForwardReply) XXX_Size() int {
return m.Size()
}
func (m *LogForwardReply) XXX_DiscardUnknown() {
xxx_messageInfo_LogForwardReply.DiscardUnknown(m)
}
var xxx_messageInfo_LogForwardReply proto.InternalMessageInfo
func (m *LogForwardReply) GetOK() bool {
if m != nil {
return m.OK
}
return false
}
func (m *LogForwardReply) GetVotedFor() *LeaderId {
if m != nil {
return m.VotedFor
}
return nil
}