raft.pb.go 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646
  1. // Code generated by protoc-gen-gogo. DO NOT EDIT.
  2. // source: raft.proto
  3. /*
  4. Package raftpb is a generated protocol buffer package.
  5. It is generated from these files:
  6. raft.proto
  7. It has these top-level messages:
  8. Entry
  9. SnapshotMetadata
  10. Snapshot
  11. Message
  12. HardState
  13. ConfState
  14. ConfChange
  15. ConfChangeSingle
  16. ConfChangeV2
  17. */
  18. package raftpb
  19. import (
  20. "fmt"
  21. proto "github.com/golang/protobuf/proto"
  22. math "math"
  23. _ "github.com/gogo/protobuf/gogoproto"
  24. io "io"
  25. )
  26. // Reference imports to suppress errors if they are not otherwise used.
  27. var _ = proto.Marshal
  28. var _ = fmt.Errorf
  29. var _ = math.Inf
  30. // This is a compile-time assertion to ensure that this generated file
  31. // is compatible with the proto package it is being compiled against.
  32. // A compilation error at this line likely means your copy of the
  33. // proto package needs to be updated.
  34. const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
  35. type EntryType int32
  36. const (
  37. EntryNormal EntryType = 0
  38. EntryConfChange EntryType = 1
  39. EntryConfChangeV2 EntryType = 2
  40. )
  41. var EntryType_name = map[int32]string{
  42. 0: "EntryNormal",
  43. 1: "EntryConfChange",
  44. 2: "EntryConfChangeV2",
  45. }
  46. var EntryType_value = map[string]int32{
  47. "EntryNormal": 0,
  48. "EntryConfChange": 1,
  49. "EntryConfChangeV2": 2,
  50. }
  51. func (x EntryType) Enum() *EntryType {
  52. p := new(EntryType)
  53. *p = x
  54. return p
  55. }
  56. func (x EntryType) String() string {
  57. return proto.EnumName(EntryType_name, int32(x))
  58. }
  59. func (x *EntryType) UnmarshalJSON(data []byte) error {
  60. value, err := proto.UnmarshalJSONEnum(EntryType_value, data, "EntryType")
  61. if err != nil {
  62. return err
  63. }
  64. *x = EntryType(value)
  65. return nil
  66. }
  67. func (EntryType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaft, []int{0} }
  68. type MessageType int32
  69. const (
  70. MsgHup MessageType = 0
  71. MsgBeat MessageType = 1
  72. MsgProp MessageType = 2
  73. MsgApp MessageType = 3
  74. MsgAppResp MessageType = 4
  75. MsgVote MessageType = 5
  76. MsgVoteResp MessageType = 6
  77. MsgSnap MessageType = 7
  78. MsgHeartbeat MessageType = 8
  79. MsgHeartbeatResp MessageType = 9
  80. MsgUnreachable MessageType = 10
  81. MsgSnapStatus MessageType = 11
  82. MsgCheckQuorum MessageType = 12
  83. MsgTransferLeader MessageType = 13
  84. MsgTimeoutNow MessageType = 14
  85. MsgReadIndex MessageType = 15
  86. MsgReadIndexResp MessageType = 16
  87. MsgPreVote MessageType = 17
  88. MsgPreVoteResp MessageType = 18
  89. )
  90. var MessageType_name = map[int32]string{
  91. 0: "MsgHup",
  92. 1: "MsgBeat",
  93. 2: "MsgProp",
  94. 3: "MsgApp",
  95. 4: "MsgAppResp",
  96. 5: "MsgVote",
  97. 6: "MsgVoteResp",
  98. 7: "MsgSnap",
  99. 8: "MsgHeartbeat",
  100. 9: "MsgHeartbeatResp",
  101. 10: "MsgUnreachable",
  102. 11: "MsgSnapStatus",
  103. 12: "MsgCheckQuorum",
  104. 13: "MsgTransferLeader",
  105. 14: "MsgTimeoutNow",
  106. 15: "MsgReadIndex",
  107. 16: "MsgReadIndexResp",
  108. 17: "MsgPreVote",
  109. 18: "MsgPreVoteResp",
  110. }
  111. var MessageType_value = map[string]int32{
  112. "MsgHup": 0,
  113. "MsgBeat": 1,
  114. "MsgProp": 2,
  115. "MsgApp": 3,
  116. "MsgAppResp": 4,
  117. "MsgVote": 5,
  118. "MsgVoteResp": 6,
  119. "MsgSnap": 7,
  120. "MsgHeartbeat": 8,
  121. "MsgHeartbeatResp": 9,
  122. "MsgUnreachable": 10,
  123. "MsgSnapStatus": 11,
  124. "MsgCheckQuorum": 12,
  125. "MsgTransferLeader": 13,
  126. "MsgTimeoutNow": 14,
  127. "MsgReadIndex": 15,
  128. "MsgReadIndexResp": 16,
  129. "MsgPreVote": 17,
  130. "MsgPreVoteResp": 18,
  131. }
  132. func (x MessageType) Enum() *MessageType {
  133. p := new(MessageType)
  134. *p = x
  135. return p
  136. }
  137. func (x MessageType) String() string {
  138. return proto.EnumName(MessageType_name, int32(x))
  139. }
  140. func (x *MessageType) UnmarshalJSON(data []byte) error {
  141. value, err := proto.UnmarshalJSONEnum(MessageType_value, data, "MessageType")
  142. if err != nil {
  143. return err
  144. }
  145. *x = MessageType(value)
  146. return nil
  147. }
  148. func (MessageType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaft, []int{1} }
  149. // ConfChangeTransition specifies the behavior of a configuration change with
  150. // respect to joint consensus.
  151. type ConfChangeTransition int32
  152. const (
  153. // Automatically use the simple protocol if possible, otherwise fall back
  154. // to ConfChangeJointImplicit. Most applications will want to use this.
  155. ConfChangeTransitionAuto ConfChangeTransition = 0
  156. // Use joint consensus unconditionally, and transition out of them
  157. // automatically (by proposing a zero configuration change).
  158. //
  159. // This option is suitable for applications that want to minimize the time
  160. // spent in the joint configuration and do not store the joint configuration
  161. // in the state machine (outside of InitialState).
  162. ConfChangeTransitionJointImplicit ConfChangeTransition = 1
  163. // Use joint consensus and remain in the joint configuration until the
  164. // application proposes a no-op configuration change. This is suitable for
  165. // applications that want to explicitly control the transitions, for example
  166. // to use a custom payload (via the Context field).
  167. ConfChangeTransitionJointExplicit ConfChangeTransition = 2
  168. )
  169. var ConfChangeTransition_name = map[int32]string{
  170. 0: "ConfChangeTransitionAuto",
  171. 1: "ConfChangeTransitionJointImplicit",
  172. 2: "ConfChangeTransitionJointExplicit",
  173. }
  174. var ConfChangeTransition_value = map[string]int32{
  175. "ConfChangeTransitionAuto": 0,
  176. "ConfChangeTransitionJointImplicit": 1,
  177. "ConfChangeTransitionJointExplicit": 2,
  178. }
  179. func (x ConfChangeTransition) Enum() *ConfChangeTransition {
  180. p := new(ConfChangeTransition)
  181. *p = x
  182. return p
  183. }
  184. func (x ConfChangeTransition) String() string {
  185. return proto.EnumName(ConfChangeTransition_name, int32(x))
  186. }
  187. func (x *ConfChangeTransition) UnmarshalJSON(data []byte) error {
  188. value, err := proto.UnmarshalJSONEnum(ConfChangeTransition_value, data, "ConfChangeTransition")
  189. if err != nil {
  190. return err
  191. }
  192. *x = ConfChangeTransition(value)
  193. return nil
  194. }
  195. func (ConfChangeTransition) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaft, []int{2} }
  196. type ConfChangeType int32
  197. const (
  198. ConfChangeAddNode ConfChangeType = 0
  199. ConfChangeRemoveNode ConfChangeType = 1
  200. ConfChangeUpdateNode ConfChangeType = 2
  201. ConfChangeAddLearnerNode ConfChangeType = 3
  202. )
  203. var ConfChangeType_name = map[int32]string{
  204. 0: "ConfChangeAddNode",
  205. 1: "ConfChangeRemoveNode",
  206. 2: "ConfChangeUpdateNode",
  207. 3: "ConfChangeAddLearnerNode",
  208. }
  209. var ConfChangeType_value = map[string]int32{
  210. "ConfChangeAddNode": 0,
  211. "ConfChangeRemoveNode": 1,
  212. "ConfChangeUpdateNode": 2,
  213. "ConfChangeAddLearnerNode": 3,
  214. }
  215. func (x ConfChangeType) Enum() *ConfChangeType {
  216. p := new(ConfChangeType)
  217. *p = x
  218. return p
  219. }
  220. func (x ConfChangeType) String() string {
  221. return proto.EnumName(ConfChangeType_name, int32(x))
  222. }
  223. func (x *ConfChangeType) UnmarshalJSON(data []byte) error {
  224. value, err := proto.UnmarshalJSONEnum(ConfChangeType_value, data, "ConfChangeType")
  225. if err != nil {
  226. return err
  227. }
  228. *x = ConfChangeType(value)
  229. return nil
  230. }
  231. func (ConfChangeType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaft, []int{3} }
  232. type Entry struct {
  233. Term uint64 `protobuf:"varint,2,opt,name=Term" json:"Term"`
  234. Index uint64 `protobuf:"varint,3,opt,name=Index" json:"Index"`
  235. Type EntryType `protobuf:"varint,1,opt,name=Type,enum=raftpb.EntryType" json:"Type"`
  236. Data []byte `protobuf:"bytes,4,opt,name=Data" json:"Data,omitempty"`
  237. XXX_unrecognized []byte `json:"-"`
  238. }
  239. func (m *Entry) Reset() { *m = Entry{} }
  240. func (m *Entry) String() string { return proto.CompactTextString(m) }
  241. func (*Entry) ProtoMessage() {}
  242. func (*Entry) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{0} }
  243. type SnapshotMetadata struct {
  244. ConfState ConfState `protobuf:"bytes,1,opt,name=conf_state,json=confState" json:"conf_state"`
  245. Index uint64 `protobuf:"varint,2,opt,name=index" json:"index"`
  246. Term uint64 `protobuf:"varint,3,opt,name=term" json:"term"`
  247. XXX_unrecognized []byte `json:"-"`
  248. }
  249. func (m *SnapshotMetadata) Reset() { *m = SnapshotMetadata{} }
  250. func (m *SnapshotMetadata) String() string { return proto.CompactTextString(m) }
  251. func (*SnapshotMetadata) ProtoMessage() {}
  252. func (*SnapshotMetadata) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{1} }
  253. type Snapshot struct {
  254. Data []byte `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"`
  255. Metadata SnapshotMetadata `protobuf:"bytes,2,opt,name=metadata" json:"metadata"`
  256. XXX_unrecognized []byte `json:"-"`
  257. }
  258. func (m *Snapshot) Reset() { *m = Snapshot{} }
  259. func (m *Snapshot) String() string { return proto.CompactTextString(m) }
  260. func (*Snapshot) ProtoMessage() {}
  261. func (*Snapshot) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{2} }
  262. type Message struct {
  263. Type MessageType `protobuf:"varint,1,opt,name=type,enum=raftpb.MessageType" json:"type"`
  264. To uint64 `protobuf:"varint,2,opt,name=to" json:"to"`
  265. From uint64 `protobuf:"varint,3,opt,name=from" json:"from"`
  266. Term uint64 `protobuf:"varint,4,opt,name=term" json:"term"`
  267. LogTerm uint64 `protobuf:"varint,5,opt,name=logTerm" json:"logTerm"`
  268. Index uint64 `protobuf:"varint,6,opt,name=index" json:"index"`
  269. Entries []Entry `protobuf:"bytes,7,rep,name=entries" json:"entries"`
  270. Commit uint64 `protobuf:"varint,8,opt,name=commit" json:"commit"`
  271. Snapshot Snapshot `protobuf:"bytes,9,opt,name=snapshot" json:"snapshot"`
  272. Reject bool `protobuf:"varint,10,opt,name=reject" json:"reject"`
  273. RejectHint uint64 `protobuf:"varint,11,opt,name=rejectHint" json:"rejectHint"`
  274. Context []byte `protobuf:"bytes,12,opt,name=context" json:"context,omitempty"`
  275. XXX_unrecognized []byte `json:"-"`
  276. }
  277. func (m *Message) Reset() { *m = Message{} }
  278. func (m *Message) String() string { return proto.CompactTextString(m) }
  279. func (*Message) ProtoMessage() {}
  280. func (*Message) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{3} }
  281. type HardState struct {
  282. Term uint64 `protobuf:"varint,1,opt,name=term" json:"term"`
  283. Vote uint64 `protobuf:"varint,2,opt,name=vote" json:"vote"`
  284. Commit uint64 `protobuf:"varint,3,opt,name=commit" json:"commit"`
  285. XXX_unrecognized []byte `json:"-"`
  286. }
  287. func (m *HardState) Reset() { *m = HardState{} }
  288. func (m *HardState) String() string { return proto.CompactTextString(m) }
  289. func (*HardState) ProtoMessage() {}
  290. func (*HardState) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{4} }
  291. type ConfState struct {
  292. // The voters in the incoming config. (If the configuration is not joint,
  293. // then the outgoing config is empty).
  294. Voters []uint64 `protobuf:"varint,1,rep,name=voters" json:"voters,omitempty"`
  295. // The learners in the incoming config.
  296. Learners []uint64 `protobuf:"varint,2,rep,name=learners" json:"learners,omitempty"`
  297. // The voters in the outgoing config.
  298. VotersOutgoing []uint64 `protobuf:"varint,3,rep,name=voters_outgoing,json=votersOutgoing" json:"voters_outgoing,omitempty"`
  299. // The nodes that will become learners when the outgoing config is removed.
  300. // These nodes are necessarily currently in nodes_joint (or they would have
  301. // been added to the incoming config right away).
  302. LearnersNext []uint64 `protobuf:"varint,4,rep,name=learners_next,json=learnersNext" json:"learners_next,omitempty"`
  303. // If set, the config is joint and Raft will automatically transition into
  304. // the final config (i.e. remove the outgoing config) when this is safe.
  305. AutoLeave bool `protobuf:"varint,5,opt,name=auto_leave,json=autoLeave" json:"auto_leave"`
  306. XXX_unrecognized []byte `json:"-"`
  307. }
  308. func (m *ConfState) Reset() { *m = ConfState{} }
  309. func (m *ConfState) String() string { return proto.CompactTextString(m) }
  310. func (*ConfState) ProtoMessage() {}
  311. func (*ConfState) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{5} }
  312. type ConfChange struct {
  313. Type ConfChangeType `protobuf:"varint,2,opt,name=type,enum=raftpb.ConfChangeType" json:"type"`
  314. NodeID uint64 `protobuf:"varint,3,opt,name=node_id,json=nodeId" json:"node_id"`
  315. Context []byte `protobuf:"bytes,4,opt,name=context" json:"context,omitempty"`
  316. // NB: this is used only by etcd to thread through a unique identifier.
  317. // Ideally it should really use the Context instead. No counterpart to
  318. // this field exists in ConfChangeV2.
  319. ID uint64 `protobuf:"varint,1,opt,name=id" json:"id"`
  320. XXX_unrecognized []byte `json:"-"`
  321. }
  322. func (m *ConfChange) Reset() { *m = ConfChange{} }
  323. func (m *ConfChange) String() string { return proto.CompactTextString(m) }
  324. func (*ConfChange) ProtoMessage() {}
  325. func (*ConfChange) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{6} }
  326. // ConfChangeSingle is an individual configuration change operation. Multiple
  327. // such operations can be carried out atomically via a ConfChangeV2.
  328. type ConfChangeSingle struct {
  329. Type ConfChangeType `protobuf:"varint,1,opt,name=type,enum=raftpb.ConfChangeType" json:"type"`
  330. NodeID uint64 `protobuf:"varint,2,opt,name=node_id,json=nodeId" json:"node_id"`
  331. XXX_unrecognized []byte `json:"-"`
  332. }
  333. func (m *ConfChangeSingle) Reset() { *m = ConfChangeSingle{} }
  334. func (m *ConfChangeSingle) String() string { return proto.CompactTextString(m) }
  335. func (*ConfChangeSingle) ProtoMessage() {}
  336. func (*ConfChangeSingle) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{7} }
  337. // ConfChangeV2 messages initiate configuration changes. They support both the
  338. // simple "one at a time" membership change protocol and full Joint Consensus
  339. // allowing for arbitrary changes in membership.
  340. //
  341. // The supplied context is treated as an opaque payload and can be used to
  342. // attach an action on the state machine to the application of the config change
  343. // proposal. Note that contrary to Joint Consensus as outlined in the Raft
  344. // paper[1], configuration changes become active when they are *applied* to the
  345. // state machine (not when they are appended to the log).
  346. //
  347. // The simple protocol can be used whenever only a single change is made.
  348. //
  349. // Non-simple changes require the use of Joint Consensus, for which two
  350. // configuration changes are run. The first configuration change specifies the
  351. // desired changes and transitions the Raft group into the joint configuration,
  352. // in which quorum requires a majority of both the pre-changes and post-changes
  353. // configuration. Joint Consensus avoids entering fragile intermediate
  354. // configurations that could compromise survivability. For example, without the
  355. // use of Joint Consensus and running across three availability zones with a
  356. // replication factor of three, it is not possible to replace a voter without
  357. // entering an intermediate configuration that does not survive the outage of
  358. // one availability zone.
  359. //
  360. // The provided ConfChangeTransition specifies how (and whether) Joint Consensus
  361. // is used, and assigns the task of leaving the joint configuration either to
  362. // Raft or the application. Leaving the joint configuration is accomplished by
  363. // proposing a ConfChangeV2 with only and optionally the Context field
  364. // populated.
  365. //
  366. // For details on Raft membership changes, see:
  367. //
  368. // [1]: https://github.com/ongardie/dissertation/blob/master/online-trim.pdf
  369. type ConfChangeV2 struct {
  370. Transition ConfChangeTransition `protobuf:"varint,1,opt,name=transition,enum=raftpb.ConfChangeTransition" json:"transition"`
  371. Changes []ConfChangeSingle `protobuf:"bytes,2,rep,name=changes" json:"changes"`
  372. Context []byte `protobuf:"bytes,3,opt,name=context" json:"context,omitempty"`
  373. XXX_unrecognized []byte `json:"-"`
  374. }
  375. func (m *ConfChangeV2) Reset() { *m = ConfChangeV2{} }
  376. func (m *ConfChangeV2) String() string { return proto.CompactTextString(m) }
  377. func (*ConfChangeV2) ProtoMessage() {}
  378. func (*ConfChangeV2) Descriptor() ([]byte, []int) { return fileDescriptorRaft, []int{8} }
  379. func init() {
  380. proto.RegisterType((*Entry)(nil), "raftpb.Entry")
  381. proto.RegisterType((*SnapshotMetadata)(nil), "raftpb.SnapshotMetadata")
  382. proto.RegisterType((*Snapshot)(nil), "raftpb.Snapshot")
  383. proto.RegisterType((*Message)(nil), "raftpb.Message")
  384. proto.RegisterType((*HardState)(nil), "raftpb.HardState")
  385. proto.RegisterType((*ConfState)(nil), "raftpb.ConfState")
  386. proto.RegisterType((*ConfChange)(nil), "raftpb.ConfChange")
  387. proto.RegisterType((*ConfChangeSingle)(nil), "raftpb.ConfChangeSingle")
  388. proto.RegisterType((*ConfChangeV2)(nil), "raftpb.ConfChangeV2")
  389. proto.RegisterEnum("raftpb.EntryType", EntryType_name, EntryType_value)
  390. proto.RegisterEnum("raftpb.MessageType", MessageType_name, MessageType_value)
  391. proto.RegisterEnum("raftpb.ConfChangeTransition", ConfChangeTransition_name, ConfChangeTransition_value)
  392. proto.RegisterEnum("raftpb.ConfChangeType", ConfChangeType_name, ConfChangeType_value)
  393. }
  394. func (m *Entry) Marshal() (dAtA []byte, err error) {
  395. size := m.Size()
  396. dAtA = make([]byte, size)
  397. n, err := m.MarshalTo(dAtA)
  398. if err != nil {
  399. return nil, err
  400. }
  401. return dAtA[:n], nil
  402. }
  403. func (m *Entry) MarshalTo(dAtA []byte) (int, error) {
  404. var i int
  405. _ = i
  406. var l int
  407. _ = l
  408. dAtA[i] = 0x8
  409. i++
  410. i = encodeVarintRaft(dAtA, i, uint64(m.Type))
  411. dAtA[i] = 0x10
  412. i++
  413. i = encodeVarintRaft(dAtA, i, uint64(m.Term))
  414. dAtA[i] = 0x18
  415. i++
  416. i = encodeVarintRaft(dAtA, i, uint64(m.Index))
  417. if m.Data != nil {
  418. dAtA[i] = 0x22
  419. i++
  420. i = encodeVarintRaft(dAtA, i, uint64(len(m.Data)))
  421. i += copy(dAtA[i:], m.Data)
  422. }
  423. if m.XXX_unrecognized != nil {
  424. i += copy(dAtA[i:], m.XXX_unrecognized)
  425. }
  426. return i, nil
  427. }
  428. func (m *SnapshotMetadata) Marshal() (dAtA []byte, err error) {
  429. size := m.Size()
  430. dAtA = make([]byte, size)
  431. n, err := m.MarshalTo(dAtA)
  432. if err != nil {
  433. return nil, err
  434. }
  435. return dAtA[:n], nil
  436. }
  437. func (m *SnapshotMetadata) MarshalTo(dAtA []byte) (int, error) {
  438. var i int
  439. _ = i
  440. var l int
  441. _ = l
  442. dAtA[i] = 0xa
  443. i++
  444. i = encodeVarintRaft(dAtA, i, uint64(m.ConfState.Size()))
  445. n1, err := m.ConfState.MarshalTo(dAtA[i:])
  446. if err != nil {
  447. return 0, err
  448. }
  449. i += n1
  450. dAtA[i] = 0x10
  451. i++
  452. i = encodeVarintRaft(dAtA, i, uint64(m.Index))
  453. dAtA[i] = 0x18
  454. i++
  455. i = encodeVarintRaft(dAtA, i, uint64(m.Term))
  456. if m.XXX_unrecognized != nil {
  457. i += copy(dAtA[i:], m.XXX_unrecognized)
  458. }
  459. return i, nil
  460. }
  461. func (m *Snapshot) Marshal() (dAtA []byte, err error) {
  462. size := m.Size()
  463. dAtA = make([]byte, size)
  464. n, err := m.MarshalTo(dAtA)
  465. if err != nil {
  466. return nil, err
  467. }
  468. return dAtA[:n], nil
  469. }
  470. func (m *Snapshot) MarshalTo(dAtA []byte) (int, error) {
  471. var i int
  472. _ = i
  473. var l int
  474. _ = l
  475. if m.Data != nil {
  476. dAtA[i] = 0xa
  477. i++
  478. i = encodeVarintRaft(dAtA, i, uint64(len(m.Data)))
  479. i += copy(dAtA[i:], m.Data)
  480. }
  481. dAtA[i] = 0x12
  482. i++
  483. i = encodeVarintRaft(dAtA, i, uint64(m.Metadata.Size()))
  484. n2, err := m.Metadata.MarshalTo(dAtA[i:])
  485. if err != nil {
  486. return 0, err
  487. }
  488. i += n2
  489. if m.XXX_unrecognized != nil {
  490. i += copy(dAtA[i:], m.XXX_unrecognized)
  491. }
  492. return i, nil
  493. }
  494. func (m *Message) Marshal() (dAtA []byte, err error) {
  495. size := m.Size()
  496. dAtA = make([]byte, size)
  497. n, err := m.MarshalTo(dAtA)
  498. if err != nil {
  499. return nil, err
  500. }
  501. return dAtA[:n], nil
  502. }
  503. func (m *Message) MarshalTo(dAtA []byte) (int, error) {
  504. var i int
  505. _ = i
  506. var l int
  507. _ = l
  508. dAtA[i] = 0x8
  509. i++
  510. i = encodeVarintRaft(dAtA, i, uint64(m.Type))
  511. dAtA[i] = 0x10
  512. i++
  513. i = encodeVarintRaft(dAtA, i, uint64(m.To))
  514. dAtA[i] = 0x18
  515. i++
  516. i = encodeVarintRaft(dAtA, i, uint64(m.From))
  517. dAtA[i] = 0x20
  518. i++
  519. i = encodeVarintRaft(dAtA, i, uint64(m.Term))
  520. dAtA[i] = 0x28
  521. i++
  522. i = encodeVarintRaft(dAtA, i, uint64(m.LogTerm))
  523. dAtA[i] = 0x30
  524. i++
  525. i = encodeVarintRaft(dAtA, i, uint64(m.Index))
  526. if len(m.Entries) > 0 {
  527. for _, msg := range m.Entries {
  528. dAtA[i] = 0x3a
  529. i++
  530. i = encodeVarintRaft(dAtA, i, uint64(msg.Size()))
  531. n, err := msg.MarshalTo(dAtA[i:])
  532. if err != nil {
  533. return 0, err
  534. }
  535. i += n
  536. }
  537. }
  538. dAtA[i] = 0x40
  539. i++
  540. i = encodeVarintRaft(dAtA, i, uint64(m.Commit))
  541. dAtA[i] = 0x4a
  542. i++
  543. i = encodeVarintRaft(dAtA, i, uint64(m.Snapshot.Size()))
  544. n3, err := m.Snapshot.MarshalTo(dAtA[i:])
  545. if err != nil {
  546. return 0, err
  547. }
  548. i += n3
  549. dAtA[i] = 0x50
  550. i++
  551. if m.Reject {
  552. dAtA[i] = 1
  553. } else {
  554. dAtA[i] = 0
  555. }
  556. i++
  557. dAtA[i] = 0x58
  558. i++
  559. i = encodeVarintRaft(dAtA, i, uint64(m.RejectHint))
  560. if m.Context != nil {
  561. dAtA[i] = 0x62
  562. i++
  563. i = encodeVarintRaft(dAtA, i, uint64(len(m.Context)))
  564. i += copy(dAtA[i:], m.Context)
  565. }
  566. if m.XXX_unrecognized != nil {
  567. i += copy(dAtA[i:], m.XXX_unrecognized)
  568. }
  569. return i, nil
  570. }
  571. func (m *HardState) Marshal() (dAtA []byte, err error) {
  572. size := m.Size()
  573. dAtA = make([]byte, size)
  574. n, err := m.MarshalTo(dAtA)
  575. if err != nil {
  576. return nil, err
  577. }
  578. return dAtA[:n], nil
  579. }
  580. func (m *HardState) MarshalTo(dAtA []byte) (int, error) {
  581. var i int
  582. _ = i
  583. var l int
  584. _ = l
  585. dAtA[i] = 0x8
  586. i++
  587. i = encodeVarintRaft(dAtA, i, uint64(m.Term))
  588. dAtA[i] = 0x10
  589. i++
  590. i = encodeVarintRaft(dAtA, i, uint64(m.Vote))
  591. dAtA[i] = 0x18
  592. i++
  593. i = encodeVarintRaft(dAtA, i, uint64(m.Commit))
  594. if m.XXX_unrecognized != nil {
  595. i += copy(dAtA[i:], m.XXX_unrecognized)
  596. }
  597. return i, nil
  598. }
  599. func (m *ConfState) Marshal() (dAtA []byte, err error) {
  600. size := m.Size()
  601. dAtA = make([]byte, size)
  602. n, err := m.MarshalTo(dAtA)
  603. if err != nil {
  604. return nil, err
  605. }
  606. return dAtA[:n], nil
  607. }
  608. func (m *ConfState) MarshalTo(dAtA []byte) (int, error) {
  609. var i int
  610. _ = i
  611. var l int
  612. _ = l
  613. if len(m.Voters) > 0 {
  614. for _, num := range m.Voters {
  615. dAtA[i] = 0x8
  616. i++
  617. i = encodeVarintRaft(dAtA, i, uint64(num))
  618. }
  619. }
  620. if len(m.Learners) > 0 {
  621. for _, num := range m.Learners {
  622. dAtA[i] = 0x10
  623. i++
  624. i = encodeVarintRaft(dAtA, i, uint64(num))
  625. }
  626. }
  627. if len(m.VotersOutgoing) > 0 {
  628. for _, num := range m.VotersOutgoing {
  629. dAtA[i] = 0x18
  630. i++
  631. i = encodeVarintRaft(dAtA, i, uint64(num))
  632. }
  633. }
  634. if len(m.LearnersNext) > 0 {
  635. for _, num := range m.LearnersNext {
  636. dAtA[i] = 0x20
  637. i++
  638. i = encodeVarintRaft(dAtA, i, uint64(num))
  639. }
  640. }
  641. dAtA[i] = 0x28
  642. i++
  643. if m.AutoLeave {
  644. dAtA[i] = 1
  645. } else {
  646. dAtA[i] = 0
  647. }
  648. i++
  649. if m.XXX_unrecognized != nil {
  650. i += copy(dAtA[i:], m.XXX_unrecognized)
  651. }
  652. return i, nil
  653. }
  654. func (m *ConfChange) Marshal() (dAtA []byte, err error) {
  655. size := m.Size()
  656. dAtA = make([]byte, size)
  657. n, err := m.MarshalTo(dAtA)
  658. if err != nil {
  659. return nil, err
  660. }
  661. return dAtA[:n], nil
  662. }
  663. func (m *ConfChange) MarshalTo(dAtA []byte) (int, error) {
  664. var i int
  665. _ = i
  666. var l int
  667. _ = l
  668. dAtA[i] = 0x8
  669. i++
  670. i = encodeVarintRaft(dAtA, i, uint64(m.ID))
  671. dAtA[i] = 0x10
  672. i++
  673. i = encodeVarintRaft(dAtA, i, uint64(m.Type))
  674. dAtA[i] = 0x18
  675. i++
  676. i = encodeVarintRaft(dAtA, i, uint64(m.NodeID))
  677. if m.Context != nil {
  678. dAtA[i] = 0x22
  679. i++
  680. i = encodeVarintRaft(dAtA, i, uint64(len(m.Context)))
  681. i += copy(dAtA[i:], m.Context)
  682. }
  683. if m.XXX_unrecognized != nil {
  684. i += copy(dAtA[i:], m.XXX_unrecognized)
  685. }
  686. return i, nil
  687. }
  688. func (m *ConfChangeSingle) Marshal() (dAtA []byte, err error) {
  689. size := m.Size()
  690. dAtA = make([]byte, size)
  691. n, err := m.MarshalTo(dAtA)
  692. if err != nil {
  693. return nil, err
  694. }
  695. return dAtA[:n], nil
  696. }
  697. func (m *ConfChangeSingle) MarshalTo(dAtA []byte) (int, error) {
  698. var i int
  699. _ = i
  700. var l int
  701. _ = l
  702. dAtA[i] = 0x8
  703. i++
  704. i = encodeVarintRaft(dAtA, i, uint64(m.Type))
  705. dAtA[i] = 0x10
  706. i++
  707. i = encodeVarintRaft(dAtA, i, uint64(m.NodeID))
  708. if m.XXX_unrecognized != nil {
  709. i += copy(dAtA[i:], m.XXX_unrecognized)
  710. }
  711. return i, nil
  712. }
  713. func (m *ConfChangeV2) Marshal() (dAtA []byte, err error) {
  714. size := m.Size()
  715. dAtA = make([]byte, size)
  716. n, err := m.MarshalTo(dAtA)
  717. if err != nil {
  718. return nil, err
  719. }
  720. return dAtA[:n], nil
  721. }
  722. func (m *ConfChangeV2) MarshalTo(dAtA []byte) (int, error) {
  723. var i int
  724. _ = i
  725. var l int
  726. _ = l
  727. dAtA[i] = 0x8
  728. i++
  729. i = encodeVarintRaft(dAtA, i, uint64(m.Transition))
  730. if len(m.Changes) > 0 {
  731. for _, msg := range m.Changes {
  732. dAtA[i] = 0x12
  733. i++
  734. i = encodeVarintRaft(dAtA, i, uint64(msg.Size()))
  735. n, err := msg.MarshalTo(dAtA[i:])
  736. if err != nil {
  737. return 0, err
  738. }
  739. i += n
  740. }
  741. }
  742. if m.Context != nil {
  743. dAtA[i] = 0x1a
  744. i++
  745. i = encodeVarintRaft(dAtA, i, uint64(len(m.Context)))
  746. i += copy(dAtA[i:], m.Context)
  747. }
  748. if m.XXX_unrecognized != nil {
  749. i += copy(dAtA[i:], m.XXX_unrecognized)
  750. }
  751. return i, nil
  752. }
  753. func encodeVarintRaft(dAtA []byte, offset int, v uint64) int {
  754. for v >= 1<<7 {
  755. dAtA[offset] = uint8(v&0x7f | 0x80)
  756. v >>= 7
  757. offset++
  758. }
  759. dAtA[offset] = uint8(v)
  760. return offset + 1
  761. }
  762. func (m *Entry) Size() (n int) {
  763. var l int
  764. _ = l
  765. n += 1 + sovRaft(uint64(m.Type))
  766. n += 1 + sovRaft(uint64(m.Term))
  767. n += 1 + sovRaft(uint64(m.Index))
  768. if m.Data != nil {
  769. l = len(m.Data)
  770. n += 1 + l + sovRaft(uint64(l))
  771. }
  772. if m.XXX_unrecognized != nil {
  773. n += len(m.XXX_unrecognized)
  774. }
  775. return n
  776. }
  777. func (m *SnapshotMetadata) Size() (n int) {
  778. var l int
  779. _ = l
  780. l = m.ConfState.Size()
  781. n += 1 + l + sovRaft(uint64(l))
  782. n += 1 + sovRaft(uint64(m.Index))
  783. n += 1 + sovRaft(uint64(m.Term))
  784. if m.XXX_unrecognized != nil {
  785. n += len(m.XXX_unrecognized)
  786. }
  787. return n
  788. }
  789. func (m *Snapshot) Size() (n int) {
  790. var l int
  791. _ = l
  792. if m.Data != nil {
  793. l = len(m.Data)
  794. n += 1 + l + sovRaft(uint64(l))
  795. }
  796. l = m.Metadata.Size()
  797. n += 1 + l + sovRaft(uint64(l))
  798. if m.XXX_unrecognized != nil {
  799. n += len(m.XXX_unrecognized)
  800. }
  801. return n
  802. }
  803. func (m *Message) Size() (n int) {
  804. var l int
  805. _ = l
  806. n += 1 + sovRaft(uint64(m.Type))
  807. n += 1 + sovRaft(uint64(m.To))
  808. n += 1 + sovRaft(uint64(m.From))
  809. n += 1 + sovRaft(uint64(m.Term))
  810. n += 1 + sovRaft(uint64(m.LogTerm))
  811. n += 1 + sovRaft(uint64(m.Index))
  812. if len(m.Entries) > 0 {
  813. for _, e := range m.Entries {
  814. l = e.Size()
  815. n += 1 + l + sovRaft(uint64(l))
  816. }
  817. }
  818. n += 1 + sovRaft(uint64(m.Commit))
  819. l = m.Snapshot.Size()
  820. n += 1 + l + sovRaft(uint64(l))
  821. n += 2
  822. n += 1 + sovRaft(uint64(m.RejectHint))
  823. if m.Context != nil {
  824. l = len(m.Context)
  825. n += 1 + l + sovRaft(uint64(l))
  826. }
  827. if m.XXX_unrecognized != nil {
  828. n += len(m.XXX_unrecognized)
  829. }
  830. return n
  831. }
  832. func (m *HardState) Size() (n int) {
  833. var l int
  834. _ = l
  835. n += 1 + sovRaft(uint64(m.Term))
  836. n += 1 + sovRaft(uint64(m.Vote))
  837. n += 1 + sovRaft(uint64(m.Commit))
  838. if m.XXX_unrecognized != nil {
  839. n += len(m.XXX_unrecognized)
  840. }
  841. return n
  842. }
  843. func (m *ConfState) Size() (n int) {
  844. var l int
  845. _ = l
  846. if len(m.Voters) > 0 {
  847. for _, e := range m.Voters {
  848. n += 1 + sovRaft(uint64(e))
  849. }
  850. }
  851. if len(m.Learners) > 0 {
  852. for _, e := range m.Learners {
  853. n += 1 + sovRaft(uint64(e))
  854. }
  855. }
  856. if len(m.VotersOutgoing) > 0 {
  857. for _, e := range m.VotersOutgoing {
  858. n += 1 + sovRaft(uint64(e))
  859. }
  860. }
  861. if len(m.LearnersNext) > 0 {
  862. for _, e := range m.LearnersNext {
  863. n += 1 + sovRaft(uint64(e))
  864. }
  865. }
  866. n += 2
  867. if m.XXX_unrecognized != nil {
  868. n += len(m.XXX_unrecognized)
  869. }
  870. return n
  871. }
  872. func (m *ConfChange) Size() (n int) {
  873. var l int
  874. _ = l
  875. n += 1 + sovRaft(uint64(m.ID))
  876. n += 1 + sovRaft(uint64(m.Type))
  877. n += 1 + sovRaft(uint64(m.NodeID))
  878. if m.Context != nil {
  879. l = len(m.Context)
  880. n += 1 + l + sovRaft(uint64(l))
  881. }
  882. if m.XXX_unrecognized != nil {
  883. n += len(m.XXX_unrecognized)
  884. }
  885. return n
  886. }
  887. func (m *ConfChangeSingle) Size() (n int) {
  888. var l int
  889. _ = l
  890. n += 1 + sovRaft(uint64(m.Type))
  891. n += 1 + sovRaft(uint64(m.NodeID))
  892. if m.XXX_unrecognized != nil {
  893. n += len(m.XXX_unrecognized)
  894. }
  895. return n
  896. }
  897. func (m *ConfChangeV2) Size() (n int) {
  898. var l int
  899. _ = l
  900. n += 1 + sovRaft(uint64(m.Transition))
  901. if len(m.Changes) > 0 {
  902. for _, e := range m.Changes {
  903. l = e.Size()
  904. n += 1 + l + sovRaft(uint64(l))
  905. }
  906. }
  907. if m.Context != nil {
  908. l = len(m.Context)
  909. n += 1 + l + sovRaft(uint64(l))
  910. }
  911. if m.XXX_unrecognized != nil {
  912. n += len(m.XXX_unrecognized)
  913. }
  914. return n
  915. }
  916. func sovRaft(x uint64) (n int) {
  917. for {
  918. n++
  919. x >>= 7
  920. if x == 0 {
  921. break
  922. }
  923. }
  924. return n
  925. }
  926. func sozRaft(x uint64) (n int) {
  927. return sovRaft(uint64((x << 1) ^ uint64((int64(x) >> 63))))
  928. }
  929. func (m *Entry) Unmarshal(dAtA []byte) error {
  930. l := len(dAtA)
  931. iNdEx := 0
  932. for iNdEx < l {
  933. preIndex := iNdEx
  934. var wire uint64
  935. for shift := uint(0); ; shift += 7 {
  936. if shift >= 64 {
  937. return ErrIntOverflowRaft
  938. }
  939. if iNdEx >= l {
  940. return io.ErrUnexpectedEOF
  941. }
  942. b := dAtA[iNdEx]
  943. iNdEx++
  944. wire |= (uint64(b) & 0x7F) << shift
  945. if b < 0x80 {
  946. break
  947. }
  948. }
  949. fieldNum := int32(wire >> 3)
  950. wireType := int(wire & 0x7)
  951. if wireType == 4 {
  952. return fmt.Errorf("proto: Entry: wiretype end group for non-group")
  953. }
  954. if fieldNum <= 0 {
  955. return fmt.Errorf("proto: Entry: illegal tag %d (wire type %d)", fieldNum, wire)
  956. }
  957. switch fieldNum {
  958. case 1:
  959. if wireType != 0 {
  960. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  961. }
  962. m.Type = 0
  963. for shift := uint(0); ; shift += 7 {
  964. if shift >= 64 {
  965. return ErrIntOverflowRaft
  966. }
  967. if iNdEx >= l {
  968. return io.ErrUnexpectedEOF
  969. }
  970. b := dAtA[iNdEx]
  971. iNdEx++
  972. m.Type |= (EntryType(b) & 0x7F) << shift
  973. if b < 0x80 {
  974. break
  975. }
  976. }
  977. case 2:
  978. if wireType != 0 {
  979. return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
  980. }
  981. m.Term = 0
  982. for shift := uint(0); ; shift += 7 {
  983. if shift >= 64 {
  984. return ErrIntOverflowRaft
  985. }
  986. if iNdEx >= l {
  987. return io.ErrUnexpectedEOF
  988. }
  989. b := dAtA[iNdEx]
  990. iNdEx++
  991. m.Term |= (uint64(b) & 0x7F) << shift
  992. if b < 0x80 {
  993. break
  994. }
  995. }
  996. case 3:
  997. if wireType != 0 {
  998. return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
  999. }
  1000. m.Index = 0
  1001. for shift := uint(0); ; shift += 7 {
  1002. if shift >= 64 {
  1003. return ErrIntOverflowRaft
  1004. }
  1005. if iNdEx >= l {
  1006. return io.ErrUnexpectedEOF
  1007. }
  1008. b := dAtA[iNdEx]
  1009. iNdEx++
  1010. m.Index |= (uint64(b) & 0x7F) << shift
  1011. if b < 0x80 {
  1012. break
  1013. }
  1014. }
  1015. case 4:
  1016. if wireType != 2 {
  1017. return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
  1018. }
  1019. var byteLen int
  1020. for shift := uint(0); ; shift += 7 {
  1021. if shift >= 64 {
  1022. return ErrIntOverflowRaft
  1023. }
  1024. if iNdEx >= l {
  1025. return io.ErrUnexpectedEOF
  1026. }
  1027. b := dAtA[iNdEx]
  1028. iNdEx++
  1029. byteLen |= (int(b) & 0x7F) << shift
  1030. if b < 0x80 {
  1031. break
  1032. }
  1033. }
  1034. if byteLen < 0 {
  1035. return ErrInvalidLengthRaft
  1036. }
  1037. postIndex := iNdEx + byteLen
  1038. if postIndex > l {
  1039. return io.ErrUnexpectedEOF
  1040. }
  1041. m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
  1042. if m.Data == nil {
  1043. m.Data = []byte{}
  1044. }
  1045. iNdEx = postIndex
  1046. default:
  1047. iNdEx = preIndex
  1048. skippy, err := skipRaft(dAtA[iNdEx:])
  1049. if err != nil {
  1050. return err
  1051. }
  1052. if skippy < 0 {
  1053. return ErrInvalidLengthRaft
  1054. }
  1055. if (iNdEx + skippy) > l {
  1056. return io.ErrUnexpectedEOF
  1057. }
  1058. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1059. iNdEx += skippy
  1060. }
  1061. }
  1062. if iNdEx > l {
  1063. return io.ErrUnexpectedEOF
  1064. }
  1065. return nil
  1066. }
  1067. func (m *SnapshotMetadata) Unmarshal(dAtA []byte) error {
  1068. l := len(dAtA)
  1069. iNdEx := 0
  1070. for iNdEx < l {
  1071. preIndex := iNdEx
  1072. var wire uint64
  1073. for shift := uint(0); ; shift += 7 {
  1074. if shift >= 64 {
  1075. return ErrIntOverflowRaft
  1076. }
  1077. if iNdEx >= l {
  1078. return io.ErrUnexpectedEOF
  1079. }
  1080. b := dAtA[iNdEx]
  1081. iNdEx++
  1082. wire |= (uint64(b) & 0x7F) << shift
  1083. if b < 0x80 {
  1084. break
  1085. }
  1086. }
  1087. fieldNum := int32(wire >> 3)
  1088. wireType := int(wire & 0x7)
  1089. if wireType == 4 {
  1090. return fmt.Errorf("proto: SnapshotMetadata: wiretype end group for non-group")
  1091. }
  1092. if fieldNum <= 0 {
  1093. return fmt.Errorf("proto: SnapshotMetadata: illegal tag %d (wire type %d)", fieldNum, wire)
  1094. }
  1095. switch fieldNum {
  1096. case 1:
  1097. if wireType != 2 {
  1098. return fmt.Errorf("proto: wrong wireType = %d for field ConfState", wireType)
  1099. }
  1100. var msglen int
  1101. for shift := uint(0); ; shift += 7 {
  1102. if shift >= 64 {
  1103. return ErrIntOverflowRaft
  1104. }
  1105. if iNdEx >= l {
  1106. return io.ErrUnexpectedEOF
  1107. }
  1108. b := dAtA[iNdEx]
  1109. iNdEx++
  1110. msglen |= (int(b) & 0x7F) << shift
  1111. if b < 0x80 {
  1112. break
  1113. }
  1114. }
  1115. if msglen < 0 {
  1116. return ErrInvalidLengthRaft
  1117. }
  1118. postIndex := iNdEx + msglen
  1119. if postIndex > l {
  1120. return io.ErrUnexpectedEOF
  1121. }
  1122. if err := m.ConfState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1123. return err
  1124. }
  1125. iNdEx = postIndex
  1126. case 2:
  1127. if wireType != 0 {
  1128. return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
  1129. }
  1130. m.Index = 0
  1131. for shift := uint(0); ; shift += 7 {
  1132. if shift >= 64 {
  1133. return ErrIntOverflowRaft
  1134. }
  1135. if iNdEx >= l {
  1136. return io.ErrUnexpectedEOF
  1137. }
  1138. b := dAtA[iNdEx]
  1139. iNdEx++
  1140. m.Index |= (uint64(b) & 0x7F) << shift
  1141. if b < 0x80 {
  1142. break
  1143. }
  1144. }
  1145. case 3:
  1146. if wireType != 0 {
  1147. return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
  1148. }
  1149. m.Term = 0
  1150. for shift := uint(0); ; shift += 7 {
  1151. if shift >= 64 {
  1152. return ErrIntOverflowRaft
  1153. }
  1154. if iNdEx >= l {
  1155. return io.ErrUnexpectedEOF
  1156. }
  1157. b := dAtA[iNdEx]
  1158. iNdEx++
  1159. m.Term |= (uint64(b) & 0x7F) << shift
  1160. if b < 0x80 {
  1161. break
  1162. }
  1163. }
  1164. default:
  1165. iNdEx = preIndex
  1166. skippy, err := skipRaft(dAtA[iNdEx:])
  1167. if err != nil {
  1168. return err
  1169. }
  1170. if skippy < 0 {
  1171. return ErrInvalidLengthRaft
  1172. }
  1173. if (iNdEx + skippy) > l {
  1174. return io.ErrUnexpectedEOF
  1175. }
  1176. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1177. iNdEx += skippy
  1178. }
  1179. }
  1180. if iNdEx > l {
  1181. return io.ErrUnexpectedEOF
  1182. }
  1183. return nil
  1184. }
  1185. func (m *Snapshot) Unmarshal(dAtA []byte) error {
  1186. l := len(dAtA)
  1187. iNdEx := 0
  1188. for iNdEx < l {
  1189. preIndex := iNdEx
  1190. var wire uint64
  1191. for shift := uint(0); ; shift += 7 {
  1192. if shift >= 64 {
  1193. return ErrIntOverflowRaft
  1194. }
  1195. if iNdEx >= l {
  1196. return io.ErrUnexpectedEOF
  1197. }
  1198. b := dAtA[iNdEx]
  1199. iNdEx++
  1200. wire |= (uint64(b) & 0x7F) << shift
  1201. if b < 0x80 {
  1202. break
  1203. }
  1204. }
  1205. fieldNum := int32(wire >> 3)
  1206. wireType := int(wire & 0x7)
  1207. if wireType == 4 {
  1208. return fmt.Errorf("proto: Snapshot: wiretype end group for non-group")
  1209. }
  1210. if fieldNum <= 0 {
  1211. return fmt.Errorf("proto: Snapshot: illegal tag %d (wire type %d)", fieldNum, wire)
  1212. }
  1213. switch fieldNum {
  1214. case 1:
  1215. if wireType != 2 {
  1216. return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
  1217. }
  1218. var byteLen int
  1219. for shift := uint(0); ; shift += 7 {
  1220. if shift >= 64 {
  1221. return ErrIntOverflowRaft
  1222. }
  1223. if iNdEx >= l {
  1224. return io.ErrUnexpectedEOF
  1225. }
  1226. b := dAtA[iNdEx]
  1227. iNdEx++
  1228. byteLen |= (int(b) & 0x7F) << shift
  1229. if b < 0x80 {
  1230. break
  1231. }
  1232. }
  1233. if byteLen < 0 {
  1234. return ErrInvalidLengthRaft
  1235. }
  1236. postIndex := iNdEx + byteLen
  1237. if postIndex > l {
  1238. return io.ErrUnexpectedEOF
  1239. }
  1240. m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
  1241. if m.Data == nil {
  1242. m.Data = []byte{}
  1243. }
  1244. iNdEx = postIndex
  1245. case 2:
  1246. if wireType != 2 {
  1247. return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType)
  1248. }
  1249. var msglen int
  1250. for shift := uint(0); ; shift += 7 {
  1251. if shift >= 64 {
  1252. return ErrIntOverflowRaft
  1253. }
  1254. if iNdEx >= l {
  1255. return io.ErrUnexpectedEOF
  1256. }
  1257. b := dAtA[iNdEx]
  1258. iNdEx++
  1259. msglen |= (int(b) & 0x7F) << shift
  1260. if b < 0x80 {
  1261. break
  1262. }
  1263. }
  1264. if msglen < 0 {
  1265. return ErrInvalidLengthRaft
  1266. }
  1267. postIndex := iNdEx + msglen
  1268. if postIndex > l {
  1269. return io.ErrUnexpectedEOF
  1270. }
  1271. if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1272. return err
  1273. }
  1274. iNdEx = postIndex
  1275. default:
  1276. iNdEx = preIndex
  1277. skippy, err := skipRaft(dAtA[iNdEx:])
  1278. if err != nil {
  1279. return err
  1280. }
  1281. if skippy < 0 {
  1282. return ErrInvalidLengthRaft
  1283. }
  1284. if (iNdEx + skippy) > l {
  1285. return io.ErrUnexpectedEOF
  1286. }
  1287. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1288. iNdEx += skippy
  1289. }
  1290. }
  1291. if iNdEx > l {
  1292. return io.ErrUnexpectedEOF
  1293. }
  1294. return nil
  1295. }
  1296. func (m *Message) Unmarshal(dAtA []byte) error {
  1297. l := len(dAtA)
  1298. iNdEx := 0
  1299. for iNdEx < l {
  1300. preIndex := iNdEx
  1301. var wire uint64
  1302. for shift := uint(0); ; shift += 7 {
  1303. if shift >= 64 {
  1304. return ErrIntOverflowRaft
  1305. }
  1306. if iNdEx >= l {
  1307. return io.ErrUnexpectedEOF
  1308. }
  1309. b := dAtA[iNdEx]
  1310. iNdEx++
  1311. wire |= (uint64(b) & 0x7F) << shift
  1312. if b < 0x80 {
  1313. break
  1314. }
  1315. }
  1316. fieldNum := int32(wire >> 3)
  1317. wireType := int(wire & 0x7)
  1318. if wireType == 4 {
  1319. return fmt.Errorf("proto: Message: wiretype end group for non-group")
  1320. }
  1321. if fieldNum <= 0 {
  1322. return fmt.Errorf("proto: Message: illegal tag %d (wire type %d)", fieldNum, wire)
  1323. }
  1324. switch fieldNum {
  1325. case 1:
  1326. if wireType != 0 {
  1327. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  1328. }
  1329. m.Type = 0
  1330. for shift := uint(0); ; shift += 7 {
  1331. if shift >= 64 {
  1332. return ErrIntOverflowRaft
  1333. }
  1334. if iNdEx >= l {
  1335. return io.ErrUnexpectedEOF
  1336. }
  1337. b := dAtA[iNdEx]
  1338. iNdEx++
  1339. m.Type |= (MessageType(b) & 0x7F) << shift
  1340. if b < 0x80 {
  1341. break
  1342. }
  1343. }
  1344. case 2:
  1345. if wireType != 0 {
  1346. return fmt.Errorf("proto: wrong wireType = %d for field To", wireType)
  1347. }
  1348. m.To = 0
  1349. for shift := uint(0); ; shift += 7 {
  1350. if shift >= 64 {
  1351. return ErrIntOverflowRaft
  1352. }
  1353. if iNdEx >= l {
  1354. return io.ErrUnexpectedEOF
  1355. }
  1356. b := dAtA[iNdEx]
  1357. iNdEx++
  1358. m.To |= (uint64(b) & 0x7F) << shift
  1359. if b < 0x80 {
  1360. break
  1361. }
  1362. }
  1363. case 3:
  1364. if wireType != 0 {
  1365. return fmt.Errorf("proto: wrong wireType = %d for field From", wireType)
  1366. }
  1367. m.From = 0
  1368. for shift := uint(0); ; shift += 7 {
  1369. if shift >= 64 {
  1370. return ErrIntOverflowRaft
  1371. }
  1372. if iNdEx >= l {
  1373. return io.ErrUnexpectedEOF
  1374. }
  1375. b := dAtA[iNdEx]
  1376. iNdEx++
  1377. m.From |= (uint64(b) & 0x7F) << shift
  1378. if b < 0x80 {
  1379. break
  1380. }
  1381. }
  1382. case 4:
  1383. if wireType != 0 {
  1384. return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
  1385. }
  1386. m.Term = 0
  1387. for shift := uint(0); ; shift += 7 {
  1388. if shift >= 64 {
  1389. return ErrIntOverflowRaft
  1390. }
  1391. if iNdEx >= l {
  1392. return io.ErrUnexpectedEOF
  1393. }
  1394. b := dAtA[iNdEx]
  1395. iNdEx++
  1396. m.Term |= (uint64(b) & 0x7F) << shift
  1397. if b < 0x80 {
  1398. break
  1399. }
  1400. }
  1401. case 5:
  1402. if wireType != 0 {
  1403. return fmt.Errorf("proto: wrong wireType = %d for field LogTerm", wireType)
  1404. }
  1405. m.LogTerm = 0
  1406. for shift := uint(0); ; shift += 7 {
  1407. if shift >= 64 {
  1408. return ErrIntOverflowRaft
  1409. }
  1410. if iNdEx >= l {
  1411. return io.ErrUnexpectedEOF
  1412. }
  1413. b := dAtA[iNdEx]
  1414. iNdEx++
  1415. m.LogTerm |= (uint64(b) & 0x7F) << shift
  1416. if b < 0x80 {
  1417. break
  1418. }
  1419. }
  1420. case 6:
  1421. if wireType != 0 {
  1422. return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType)
  1423. }
  1424. m.Index = 0
  1425. for shift := uint(0); ; shift += 7 {
  1426. if shift >= 64 {
  1427. return ErrIntOverflowRaft
  1428. }
  1429. if iNdEx >= l {
  1430. return io.ErrUnexpectedEOF
  1431. }
  1432. b := dAtA[iNdEx]
  1433. iNdEx++
  1434. m.Index |= (uint64(b) & 0x7F) << shift
  1435. if b < 0x80 {
  1436. break
  1437. }
  1438. }
  1439. case 7:
  1440. if wireType != 2 {
  1441. return fmt.Errorf("proto: wrong wireType = %d for field Entries", wireType)
  1442. }
  1443. var msglen int
  1444. for shift := uint(0); ; shift += 7 {
  1445. if shift >= 64 {
  1446. return ErrIntOverflowRaft
  1447. }
  1448. if iNdEx >= l {
  1449. return io.ErrUnexpectedEOF
  1450. }
  1451. b := dAtA[iNdEx]
  1452. iNdEx++
  1453. msglen |= (int(b) & 0x7F) << shift
  1454. if b < 0x80 {
  1455. break
  1456. }
  1457. }
  1458. if msglen < 0 {
  1459. return ErrInvalidLengthRaft
  1460. }
  1461. postIndex := iNdEx + msglen
  1462. if postIndex > l {
  1463. return io.ErrUnexpectedEOF
  1464. }
  1465. m.Entries = append(m.Entries, Entry{})
  1466. if err := m.Entries[len(m.Entries)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1467. return err
  1468. }
  1469. iNdEx = postIndex
  1470. case 8:
  1471. if wireType != 0 {
  1472. return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType)
  1473. }
  1474. m.Commit = 0
  1475. for shift := uint(0); ; shift += 7 {
  1476. if shift >= 64 {
  1477. return ErrIntOverflowRaft
  1478. }
  1479. if iNdEx >= l {
  1480. return io.ErrUnexpectedEOF
  1481. }
  1482. b := dAtA[iNdEx]
  1483. iNdEx++
  1484. m.Commit |= (uint64(b) & 0x7F) << shift
  1485. if b < 0x80 {
  1486. break
  1487. }
  1488. }
  1489. case 9:
  1490. if wireType != 2 {
  1491. return fmt.Errorf("proto: wrong wireType = %d for field Snapshot", wireType)
  1492. }
  1493. var msglen int
  1494. for shift := uint(0); ; shift += 7 {
  1495. if shift >= 64 {
  1496. return ErrIntOverflowRaft
  1497. }
  1498. if iNdEx >= l {
  1499. return io.ErrUnexpectedEOF
  1500. }
  1501. b := dAtA[iNdEx]
  1502. iNdEx++
  1503. msglen |= (int(b) & 0x7F) << shift
  1504. if b < 0x80 {
  1505. break
  1506. }
  1507. }
  1508. if msglen < 0 {
  1509. return ErrInvalidLengthRaft
  1510. }
  1511. postIndex := iNdEx + msglen
  1512. if postIndex > l {
  1513. return io.ErrUnexpectedEOF
  1514. }
  1515. if err := m.Snapshot.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  1516. return err
  1517. }
  1518. iNdEx = postIndex
  1519. case 10:
  1520. if wireType != 0 {
  1521. return fmt.Errorf("proto: wrong wireType = %d for field Reject", wireType)
  1522. }
  1523. var v int
  1524. for shift := uint(0); ; shift += 7 {
  1525. if shift >= 64 {
  1526. return ErrIntOverflowRaft
  1527. }
  1528. if iNdEx >= l {
  1529. return io.ErrUnexpectedEOF
  1530. }
  1531. b := dAtA[iNdEx]
  1532. iNdEx++
  1533. v |= (int(b) & 0x7F) << shift
  1534. if b < 0x80 {
  1535. break
  1536. }
  1537. }
  1538. m.Reject = bool(v != 0)
  1539. case 11:
  1540. if wireType != 0 {
  1541. return fmt.Errorf("proto: wrong wireType = %d for field RejectHint", wireType)
  1542. }
  1543. m.RejectHint = 0
  1544. for shift := uint(0); ; shift += 7 {
  1545. if shift >= 64 {
  1546. return ErrIntOverflowRaft
  1547. }
  1548. if iNdEx >= l {
  1549. return io.ErrUnexpectedEOF
  1550. }
  1551. b := dAtA[iNdEx]
  1552. iNdEx++
  1553. m.RejectHint |= (uint64(b) & 0x7F) << shift
  1554. if b < 0x80 {
  1555. break
  1556. }
  1557. }
  1558. case 12:
  1559. if wireType != 2 {
  1560. return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType)
  1561. }
  1562. var byteLen int
  1563. for shift := uint(0); ; shift += 7 {
  1564. if shift >= 64 {
  1565. return ErrIntOverflowRaft
  1566. }
  1567. if iNdEx >= l {
  1568. return io.ErrUnexpectedEOF
  1569. }
  1570. b := dAtA[iNdEx]
  1571. iNdEx++
  1572. byteLen |= (int(b) & 0x7F) << shift
  1573. if b < 0x80 {
  1574. break
  1575. }
  1576. }
  1577. if byteLen < 0 {
  1578. return ErrInvalidLengthRaft
  1579. }
  1580. postIndex := iNdEx + byteLen
  1581. if postIndex > l {
  1582. return io.ErrUnexpectedEOF
  1583. }
  1584. m.Context = append(m.Context[:0], dAtA[iNdEx:postIndex]...)
  1585. if m.Context == nil {
  1586. m.Context = []byte{}
  1587. }
  1588. iNdEx = postIndex
  1589. default:
  1590. iNdEx = preIndex
  1591. skippy, err := skipRaft(dAtA[iNdEx:])
  1592. if err != nil {
  1593. return err
  1594. }
  1595. if skippy < 0 {
  1596. return ErrInvalidLengthRaft
  1597. }
  1598. if (iNdEx + skippy) > l {
  1599. return io.ErrUnexpectedEOF
  1600. }
  1601. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1602. iNdEx += skippy
  1603. }
  1604. }
  1605. if iNdEx > l {
  1606. return io.ErrUnexpectedEOF
  1607. }
  1608. return nil
  1609. }
  1610. func (m *HardState) Unmarshal(dAtA []byte) error {
  1611. l := len(dAtA)
  1612. iNdEx := 0
  1613. for iNdEx < l {
  1614. preIndex := iNdEx
  1615. var wire uint64
  1616. for shift := uint(0); ; shift += 7 {
  1617. if shift >= 64 {
  1618. return ErrIntOverflowRaft
  1619. }
  1620. if iNdEx >= l {
  1621. return io.ErrUnexpectedEOF
  1622. }
  1623. b := dAtA[iNdEx]
  1624. iNdEx++
  1625. wire |= (uint64(b) & 0x7F) << shift
  1626. if b < 0x80 {
  1627. break
  1628. }
  1629. }
  1630. fieldNum := int32(wire >> 3)
  1631. wireType := int(wire & 0x7)
  1632. if wireType == 4 {
  1633. return fmt.Errorf("proto: HardState: wiretype end group for non-group")
  1634. }
  1635. if fieldNum <= 0 {
  1636. return fmt.Errorf("proto: HardState: illegal tag %d (wire type %d)", fieldNum, wire)
  1637. }
  1638. switch fieldNum {
  1639. case 1:
  1640. if wireType != 0 {
  1641. return fmt.Errorf("proto: wrong wireType = %d for field Term", wireType)
  1642. }
  1643. m.Term = 0
  1644. for shift := uint(0); ; shift += 7 {
  1645. if shift >= 64 {
  1646. return ErrIntOverflowRaft
  1647. }
  1648. if iNdEx >= l {
  1649. return io.ErrUnexpectedEOF
  1650. }
  1651. b := dAtA[iNdEx]
  1652. iNdEx++
  1653. m.Term |= (uint64(b) & 0x7F) << shift
  1654. if b < 0x80 {
  1655. break
  1656. }
  1657. }
  1658. case 2:
  1659. if wireType != 0 {
  1660. return fmt.Errorf("proto: wrong wireType = %d for field Vote", wireType)
  1661. }
  1662. m.Vote = 0
  1663. for shift := uint(0); ; shift += 7 {
  1664. if shift >= 64 {
  1665. return ErrIntOverflowRaft
  1666. }
  1667. if iNdEx >= l {
  1668. return io.ErrUnexpectedEOF
  1669. }
  1670. b := dAtA[iNdEx]
  1671. iNdEx++
  1672. m.Vote |= (uint64(b) & 0x7F) << shift
  1673. if b < 0x80 {
  1674. break
  1675. }
  1676. }
  1677. case 3:
  1678. if wireType != 0 {
  1679. return fmt.Errorf("proto: wrong wireType = %d for field Commit", wireType)
  1680. }
  1681. m.Commit = 0
  1682. for shift := uint(0); ; shift += 7 {
  1683. if shift >= 64 {
  1684. return ErrIntOverflowRaft
  1685. }
  1686. if iNdEx >= l {
  1687. return io.ErrUnexpectedEOF
  1688. }
  1689. b := dAtA[iNdEx]
  1690. iNdEx++
  1691. m.Commit |= (uint64(b) & 0x7F) << shift
  1692. if b < 0x80 {
  1693. break
  1694. }
  1695. }
  1696. default:
  1697. iNdEx = preIndex
  1698. skippy, err := skipRaft(dAtA[iNdEx:])
  1699. if err != nil {
  1700. return err
  1701. }
  1702. if skippy < 0 {
  1703. return ErrInvalidLengthRaft
  1704. }
  1705. if (iNdEx + skippy) > l {
  1706. return io.ErrUnexpectedEOF
  1707. }
  1708. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  1709. iNdEx += skippy
  1710. }
  1711. }
  1712. if iNdEx > l {
  1713. return io.ErrUnexpectedEOF
  1714. }
  1715. return nil
  1716. }
  1717. func (m *ConfState) Unmarshal(dAtA []byte) error {
  1718. l := len(dAtA)
  1719. iNdEx := 0
  1720. for iNdEx < l {
  1721. preIndex := iNdEx
  1722. var wire uint64
  1723. for shift := uint(0); ; shift += 7 {
  1724. if shift >= 64 {
  1725. return ErrIntOverflowRaft
  1726. }
  1727. if iNdEx >= l {
  1728. return io.ErrUnexpectedEOF
  1729. }
  1730. b := dAtA[iNdEx]
  1731. iNdEx++
  1732. wire |= (uint64(b) & 0x7F) << shift
  1733. if b < 0x80 {
  1734. break
  1735. }
  1736. }
  1737. fieldNum := int32(wire >> 3)
  1738. wireType := int(wire & 0x7)
  1739. if wireType == 4 {
  1740. return fmt.Errorf("proto: ConfState: wiretype end group for non-group")
  1741. }
  1742. if fieldNum <= 0 {
  1743. return fmt.Errorf("proto: ConfState: illegal tag %d (wire type %d)", fieldNum, wire)
  1744. }
  1745. switch fieldNum {
  1746. case 1:
  1747. if wireType == 0 {
  1748. var v uint64
  1749. for shift := uint(0); ; shift += 7 {
  1750. if shift >= 64 {
  1751. return ErrIntOverflowRaft
  1752. }
  1753. if iNdEx >= l {
  1754. return io.ErrUnexpectedEOF
  1755. }
  1756. b := dAtA[iNdEx]
  1757. iNdEx++
  1758. v |= (uint64(b) & 0x7F) << shift
  1759. if b < 0x80 {
  1760. break
  1761. }
  1762. }
  1763. m.Voters = append(m.Voters, v)
  1764. } else if wireType == 2 {
  1765. var packedLen int
  1766. for shift := uint(0); ; shift += 7 {
  1767. if shift >= 64 {
  1768. return ErrIntOverflowRaft
  1769. }
  1770. if iNdEx >= l {
  1771. return io.ErrUnexpectedEOF
  1772. }
  1773. b := dAtA[iNdEx]
  1774. iNdEx++
  1775. packedLen |= (int(b) & 0x7F) << shift
  1776. if b < 0x80 {
  1777. break
  1778. }
  1779. }
  1780. if packedLen < 0 {
  1781. return ErrInvalidLengthRaft
  1782. }
  1783. postIndex := iNdEx + packedLen
  1784. if postIndex > l {
  1785. return io.ErrUnexpectedEOF
  1786. }
  1787. for iNdEx < postIndex {
  1788. var v uint64
  1789. for shift := uint(0); ; shift += 7 {
  1790. if shift >= 64 {
  1791. return ErrIntOverflowRaft
  1792. }
  1793. if iNdEx >= l {
  1794. return io.ErrUnexpectedEOF
  1795. }
  1796. b := dAtA[iNdEx]
  1797. iNdEx++
  1798. v |= (uint64(b) & 0x7F) << shift
  1799. if b < 0x80 {
  1800. break
  1801. }
  1802. }
  1803. m.Voters = append(m.Voters, v)
  1804. }
  1805. } else {
  1806. return fmt.Errorf("proto: wrong wireType = %d for field Voters", wireType)
  1807. }
  1808. case 2:
  1809. if wireType == 0 {
  1810. var v uint64
  1811. for shift := uint(0); ; shift += 7 {
  1812. if shift >= 64 {
  1813. return ErrIntOverflowRaft
  1814. }
  1815. if iNdEx >= l {
  1816. return io.ErrUnexpectedEOF
  1817. }
  1818. b := dAtA[iNdEx]
  1819. iNdEx++
  1820. v |= (uint64(b) & 0x7F) << shift
  1821. if b < 0x80 {
  1822. break
  1823. }
  1824. }
  1825. m.Learners = append(m.Learners, v)
  1826. } else if wireType == 2 {
  1827. var packedLen int
  1828. for shift := uint(0); ; shift += 7 {
  1829. if shift >= 64 {
  1830. return ErrIntOverflowRaft
  1831. }
  1832. if iNdEx >= l {
  1833. return io.ErrUnexpectedEOF
  1834. }
  1835. b := dAtA[iNdEx]
  1836. iNdEx++
  1837. packedLen |= (int(b) & 0x7F) << shift
  1838. if b < 0x80 {
  1839. break
  1840. }
  1841. }
  1842. if packedLen < 0 {
  1843. return ErrInvalidLengthRaft
  1844. }
  1845. postIndex := iNdEx + packedLen
  1846. if postIndex > l {
  1847. return io.ErrUnexpectedEOF
  1848. }
  1849. for iNdEx < postIndex {
  1850. var v uint64
  1851. for shift := uint(0); ; shift += 7 {
  1852. if shift >= 64 {
  1853. return ErrIntOverflowRaft
  1854. }
  1855. if iNdEx >= l {
  1856. return io.ErrUnexpectedEOF
  1857. }
  1858. b := dAtA[iNdEx]
  1859. iNdEx++
  1860. v |= (uint64(b) & 0x7F) << shift
  1861. if b < 0x80 {
  1862. break
  1863. }
  1864. }
  1865. m.Learners = append(m.Learners, v)
  1866. }
  1867. } else {
  1868. return fmt.Errorf("proto: wrong wireType = %d for field Learners", wireType)
  1869. }
  1870. case 3:
  1871. if wireType == 0 {
  1872. var v uint64
  1873. for shift := uint(0); ; shift += 7 {
  1874. if shift >= 64 {
  1875. return ErrIntOverflowRaft
  1876. }
  1877. if iNdEx >= l {
  1878. return io.ErrUnexpectedEOF
  1879. }
  1880. b := dAtA[iNdEx]
  1881. iNdEx++
  1882. v |= (uint64(b) & 0x7F) << shift
  1883. if b < 0x80 {
  1884. break
  1885. }
  1886. }
  1887. m.VotersOutgoing = append(m.VotersOutgoing, v)
  1888. } else if wireType == 2 {
  1889. var packedLen int
  1890. for shift := uint(0); ; shift += 7 {
  1891. if shift >= 64 {
  1892. return ErrIntOverflowRaft
  1893. }
  1894. if iNdEx >= l {
  1895. return io.ErrUnexpectedEOF
  1896. }
  1897. b := dAtA[iNdEx]
  1898. iNdEx++
  1899. packedLen |= (int(b) & 0x7F) << shift
  1900. if b < 0x80 {
  1901. break
  1902. }
  1903. }
  1904. if packedLen < 0 {
  1905. return ErrInvalidLengthRaft
  1906. }
  1907. postIndex := iNdEx + packedLen
  1908. if postIndex > l {
  1909. return io.ErrUnexpectedEOF
  1910. }
  1911. for iNdEx < postIndex {
  1912. var v uint64
  1913. for shift := uint(0); ; shift += 7 {
  1914. if shift >= 64 {
  1915. return ErrIntOverflowRaft
  1916. }
  1917. if iNdEx >= l {
  1918. return io.ErrUnexpectedEOF
  1919. }
  1920. b := dAtA[iNdEx]
  1921. iNdEx++
  1922. v |= (uint64(b) & 0x7F) << shift
  1923. if b < 0x80 {
  1924. break
  1925. }
  1926. }
  1927. m.VotersOutgoing = append(m.VotersOutgoing, v)
  1928. }
  1929. } else {
  1930. return fmt.Errorf("proto: wrong wireType = %d for field VotersOutgoing", wireType)
  1931. }
  1932. case 4:
  1933. if wireType == 0 {
  1934. var v uint64
  1935. for shift := uint(0); ; shift += 7 {
  1936. if shift >= 64 {
  1937. return ErrIntOverflowRaft
  1938. }
  1939. if iNdEx >= l {
  1940. return io.ErrUnexpectedEOF
  1941. }
  1942. b := dAtA[iNdEx]
  1943. iNdEx++
  1944. v |= (uint64(b) & 0x7F) << shift
  1945. if b < 0x80 {
  1946. break
  1947. }
  1948. }
  1949. m.LearnersNext = append(m.LearnersNext, v)
  1950. } else if wireType == 2 {
  1951. var packedLen int
  1952. for shift := uint(0); ; shift += 7 {
  1953. if shift >= 64 {
  1954. return ErrIntOverflowRaft
  1955. }
  1956. if iNdEx >= l {
  1957. return io.ErrUnexpectedEOF
  1958. }
  1959. b := dAtA[iNdEx]
  1960. iNdEx++
  1961. packedLen |= (int(b) & 0x7F) << shift
  1962. if b < 0x80 {
  1963. break
  1964. }
  1965. }
  1966. if packedLen < 0 {
  1967. return ErrInvalidLengthRaft
  1968. }
  1969. postIndex := iNdEx + packedLen
  1970. if postIndex > l {
  1971. return io.ErrUnexpectedEOF
  1972. }
  1973. for iNdEx < postIndex {
  1974. var v uint64
  1975. for shift := uint(0); ; shift += 7 {
  1976. if shift >= 64 {
  1977. return ErrIntOverflowRaft
  1978. }
  1979. if iNdEx >= l {
  1980. return io.ErrUnexpectedEOF
  1981. }
  1982. b := dAtA[iNdEx]
  1983. iNdEx++
  1984. v |= (uint64(b) & 0x7F) << shift
  1985. if b < 0x80 {
  1986. break
  1987. }
  1988. }
  1989. m.LearnersNext = append(m.LearnersNext, v)
  1990. }
  1991. } else {
  1992. return fmt.Errorf("proto: wrong wireType = %d for field LearnersNext", wireType)
  1993. }
  1994. case 5:
  1995. if wireType != 0 {
  1996. return fmt.Errorf("proto: wrong wireType = %d for field AutoLeave", wireType)
  1997. }
  1998. var v int
  1999. for shift := uint(0); ; shift += 7 {
  2000. if shift >= 64 {
  2001. return ErrIntOverflowRaft
  2002. }
  2003. if iNdEx >= l {
  2004. return io.ErrUnexpectedEOF
  2005. }
  2006. b := dAtA[iNdEx]
  2007. iNdEx++
  2008. v |= (int(b) & 0x7F) << shift
  2009. if b < 0x80 {
  2010. break
  2011. }
  2012. }
  2013. m.AutoLeave = bool(v != 0)
  2014. default:
  2015. iNdEx = preIndex
  2016. skippy, err := skipRaft(dAtA[iNdEx:])
  2017. if err != nil {
  2018. return err
  2019. }
  2020. if skippy < 0 {
  2021. return ErrInvalidLengthRaft
  2022. }
  2023. if (iNdEx + skippy) > l {
  2024. return io.ErrUnexpectedEOF
  2025. }
  2026. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  2027. iNdEx += skippy
  2028. }
  2029. }
  2030. if iNdEx > l {
  2031. return io.ErrUnexpectedEOF
  2032. }
  2033. return nil
  2034. }
  2035. func (m *ConfChange) Unmarshal(dAtA []byte) error {
  2036. l := len(dAtA)
  2037. iNdEx := 0
  2038. for iNdEx < l {
  2039. preIndex := iNdEx
  2040. var wire uint64
  2041. for shift := uint(0); ; shift += 7 {
  2042. if shift >= 64 {
  2043. return ErrIntOverflowRaft
  2044. }
  2045. if iNdEx >= l {
  2046. return io.ErrUnexpectedEOF
  2047. }
  2048. b := dAtA[iNdEx]
  2049. iNdEx++
  2050. wire |= (uint64(b) & 0x7F) << shift
  2051. if b < 0x80 {
  2052. break
  2053. }
  2054. }
  2055. fieldNum := int32(wire >> 3)
  2056. wireType := int(wire & 0x7)
  2057. if wireType == 4 {
  2058. return fmt.Errorf("proto: ConfChange: wiretype end group for non-group")
  2059. }
  2060. if fieldNum <= 0 {
  2061. return fmt.Errorf("proto: ConfChange: illegal tag %d (wire type %d)", fieldNum, wire)
  2062. }
  2063. switch fieldNum {
  2064. case 1:
  2065. if wireType != 0 {
  2066. return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
  2067. }
  2068. m.ID = 0
  2069. for shift := uint(0); ; shift += 7 {
  2070. if shift >= 64 {
  2071. return ErrIntOverflowRaft
  2072. }
  2073. if iNdEx >= l {
  2074. return io.ErrUnexpectedEOF
  2075. }
  2076. b := dAtA[iNdEx]
  2077. iNdEx++
  2078. m.ID |= (uint64(b) & 0x7F) << shift
  2079. if b < 0x80 {
  2080. break
  2081. }
  2082. }
  2083. case 2:
  2084. if wireType != 0 {
  2085. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  2086. }
  2087. m.Type = 0
  2088. for shift := uint(0); ; shift += 7 {
  2089. if shift >= 64 {
  2090. return ErrIntOverflowRaft
  2091. }
  2092. if iNdEx >= l {
  2093. return io.ErrUnexpectedEOF
  2094. }
  2095. b := dAtA[iNdEx]
  2096. iNdEx++
  2097. m.Type |= (ConfChangeType(b) & 0x7F) << shift
  2098. if b < 0x80 {
  2099. break
  2100. }
  2101. }
  2102. case 3:
  2103. if wireType != 0 {
  2104. return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType)
  2105. }
  2106. m.NodeID = 0
  2107. for shift := uint(0); ; shift += 7 {
  2108. if shift >= 64 {
  2109. return ErrIntOverflowRaft
  2110. }
  2111. if iNdEx >= l {
  2112. return io.ErrUnexpectedEOF
  2113. }
  2114. b := dAtA[iNdEx]
  2115. iNdEx++
  2116. m.NodeID |= (uint64(b) & 0x7F) << shift
  2117. if b < 0x80 {
  2118. break
  2119. }
  2120. }
  2121. case 4:
  2122. if wireType != 2 {
  2123. return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType)
  2124. }
  2125. var byteLen int
  2126. for shift := uint(0); ; shift += 7 {
  2127. if shift >= 64 {
  2128. return ErrIntOverflowRaft
  2129. }
  2130. if iNdEx >= l {
  2131. return io.ErrUnexpectedEOF
  2132. }
  2133. b := dAtA[iNdEx]
  2134. iNdEx++
  2135. byteLen |= (int(b) & 0x7F) << shift
  2136. if b < 0x80 {
  2137. break
  2138. }
  2139. }
  2140. if byteLen < 0 {
  2141. return ErrInvalidLengthRaft
  2142. }
  2143. postIndex := iNdEx + byteLen
  2144. if postIndex > l {
  2145. return io.ErrUnexpectedEOF
  2146. }
  2147. m.Context = append(m.Context[:0], dAtA[iNdEx:postIndex]...)
  2148. if m.Context == nil {
  2149. m.Context = []byte{}
  2150. }
  2151. iNdEx = postIndex
  2152. default:
  2153. iNdEx = preIndex
  2154. skippy, err := skipRaft(dAtA[iNdEx:])
  2155. if err != nil {
  2156. return err
  2157. }
  2158. if skippy < 0 {
  2159. return ErrInvalidLengthRaft
  2160. }
  2161. if (iNdEx + skippy) > l {
  2162. return io.ErrUnexpectedEOF
  2163. }
  2164. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  2165. iNdEx += skippy
  2166. }
  2167. }
  2168. if iNdEx > l {
  2169. return io.ErrUnexpectedEOF
  2170. }
  2171. return nil
  2172. }
  2173. func (m *ConfChangeSingle) Unmarshal(dAtA []byte) error {
  2174. l := len(dAtA)
  2175. iNdEx := 0
  2176. for iNdEx < l {
  2177. preIndex := iNdEx
  2178. var wire uint64
  2179. for shift := uint(0); ; shift += 7 {
  2180. if shift >= 64 {
  2181. return ErrIntOverflowRaft
  2182. }
  2183. if iNdEx >= l {
  2184. return io.ErrUnexpectedEOF
  2185. }
  2186. b := dAtA[iNdEx]
  2187. iNdEx++
  2188. wire |= (uint64(b) & 0x7F) << shift
  2189. if b < 0x80 {
  2190. break
  2191. }
  2192. }
  2193. fieldNum := int32(wire >> 3)
  2194. wireType := int(wire & 0x7)
  2195. if wireType == 4 {
  2196. return fmt.Errorf("proto: ConfChangeSingle: wiretype end group for non-group")
  2197. }
  2198. if fieldNum <= 0 {
  2199. return fmt.Errorf("proto: ConfChangeSingle: illegal tag %d (wire type %d)", fieldNum, wire)
  2200. }
  2201. switch fieldNum {
  2202. case 1:
  2203. if wireType != 0 {
  2204. return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
  2205. }
  2206. m.Type = 0
  2207. for shift := uint(0); ; shift += 7 {
  2208. if shift >= 64 {
  2209. return ErrIntOverflowRaft
  2210. }
  2211. if iNdEx >= l {
  2212. return io.ErrUnexpectedEOF
  2213. }
  2214. b := dAtA[iNdEx]
  2215. iNdEx++
  2216. m.Type |= (ConfChangeType(b) & 0x7F) << shift
  2217. if b < 0x80 {
  2218. break
  2219. }
  2220. }
  2221. case 2:
  2222. if wireType != 0 {
  2223. return fmt.Errorf("proto: wrong wireType = %d for field NodeID", wireType)
  2224. }
  2225. m.NodeID = 0
  2226. for shift := uint(0); ; shift += 7 {
  2227. if shift >= 64 {
  2228. return ErrIntOverflowRaft
  2229. }
  2230. if iNdEx >= l {
  2231. return io.ErrUnexpectedEOF
  2232. }
  2233. b := dAtA[iNdEx]
  2234. iNdEx++
  2235. m.NodeID |= (uint64(b) & 0x7F) << shift
  2236. if b < 0x80 {
  2237. break
  2238. }
  2239. }
  2240. default:
  2241. iNdEx = preIndex
  2242. skippy, err := skipRaft(dAtA[iNdEx:])
  2243. if err != nil {
  2244. return err
  2245. }
  2246. if skippy < 0 {
  2247. return ErrInvalidLengthRaft
  2248. }
  2249. if (iNdEx + skippy) > l {
  2250. return io.ErrUnexpectedEOF
  2251. }
  2252. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  2253. iNdEx += skippy
  2254. }
  2255. }
  2256. if iNdEx > l {
  2257. return io.ErrUnexpectedEOF
  2258. }
  2259. return nil
  2260. }
  2261. func (m *ConfChangeV2) Unmarshal(dAtA []byte) error {
  2262. l := len(dAtA)
  2263. iNdEx := 0
  2264. for iNdEx < l {
  2265. preIndex := iNdEx
  2266. var wire uint64
  2267. for shift := uint(0); ; shift += 7 {
  2268. if shift >= 64 {
  2269. return ErrIntOverflowRaft
  2270. }
  2271. if iNdEx >= l {
  2272. return io.ErrUnexpectedEOF
  2273. }
  2274. b := dAtA[iNdEx]
  2275. iNdEx++
  2276. wire |= (uint64(b) & 0x7F) << shift
  2277. if b < 0x80 {
  2278. break
  2279. }
  2280. }
  2281. fieldNum := int32(wire >> 3)
  2282. wireType := int(wire & 0x7)
  2283. if wireType == 4 {
  2284. return fmt.Errorf("proto: ConfChangeV2: wiretype end group for non-group")
  2285. }
  2286. if fieldNum <= 0 {
  2287. return fmt.Errorf("proto: ConfChangeV2: illegal tag %d (wire type %d)", fieldNum, wire)
  2288. }
  2289. switch fieldNum {
  2290. case 1:
  2291. if wireType != 0 {
  2292. return fmt.Errorf("proto: wrong wireType = %d for field Transition", wireType)
  2293. }
  2294. m.Transition = 0
  2295. for shift := uint(0); ; shift += 7 {
  2296. if shift >= 64 {
  2297. return ErrIntOverflowRaft
  2298. }
  2299. if iNdEx >= l {
  2300. return io.ErrUnexpectedEOF
  2301. }
  2302. b := dAtA[iNdEx]
  2303. iNdEx++
  2304. m.Transition |= (ConfChangeTransition(b) & 0x7F) << shift
  2305. if b < 0x80 {
  2306. break
  2307. }
  2308. }
  2309. case 2:
  2310. if wireType != 2 {
  2311. return fmt.Errorf("proto: wrong wireType = %d for field Changes", wireType)
  2312. }
  2313. var msglen int
  2314. for shift := uint(0); ; shift += 7 {
  2315. if shift >= 64 {
  2316. return ErrIntOverflowRaft
  2317. }
  2318. if iNdEx >= l {
  2319. return io.ErrUnexpectedEOF
  2320. }
  2321. b := dAtA[iNdEx]
  2322. iNdEx++
  2323. msglen |= (int(b) & 0x7F) << shift
  2324. if b < 0x80 {
  2325. break
  2326. }
  2327. }
  2328. if msglen < 0 {
  2329. return ErrInvalidLengthRaft
  2330. }
  2331. postIndex := iNdEx + msglen
  2332. if postIndex > l {
  2333. return io.ErrUnexpectedEOF
  2334. }
  2335. m.Changes = append(m.Changes, ConfChangeSingle{})
  2336. if err := m.Changes[len(m.Changes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
  2337. return err
  2338. }
  2339. iNdEx = postIndex
  2340. case 3:
  2341. if wireType != 2 {
  2342. return fmt.Errorf("proto: wrong wireType = %d for field Context", wireType)
  2343. }
  2344. var byteLen int
  2345. for shift := uint(0); ; shift += 7 {
  2346. if shift >= 64 {
  2347. return ErrIntOverflowRaft
  2348. }
  2349. if iNdEx >= l {
  2350. return io.ErrUnexpectedEOF
  2351. }
  2352. b := dAtA[iNdEx]
  2353. iNdEx++
  2354. byteLen |= (int(b) & 0x7F) << shift
  2355. if b < 0x80 {
  2356. break
  2357. }
  2358. }
  2359. if byteLen < 0 {
  2360. return ErrInvalidLengthRaft
  2361. }
  2362. postIndex := iNdEx + byteLen
  2363. if postIndex > l {
  2364. return io.ErrUnexpectedEOF
  2365. }
  2366. m.Context = append(m.Context[:0], dAtA[iNdEx:postIndex]...)
  2367. if m.Context == nil {
  2368. m.Context = []byte{}
  2369. }
  2370. iNdEx = postIndex
  2371. default:
  2372. iNdEx = preIndex
  2373. skippy, err := skipRaft(dAtA[iNdEx:])
  2374. if err != nil {
  2375. return err
  2376. }
  2377. if skippy < 0 {
  2378. return ErrInvalidLengthRaft
  2379. }
  2380. if (iNdEx + skippy) > l {
  2381. return io.ErrUnexpectedEOF
  2382. }
  2383. m.XXX_unrecognized = append(m.XXX_unrecognized, dAtA[iNdEx:iNdEx+skippy]...)
  2384. iNdEx += skippy
  2385. }
  2386. }
  2387. if iNdEx > l {
  2388. return io.ErrUnexpectedEOF
  2389. }
  2390. return nil
  2391. }
  2392. func skipRaft(dAtA []byte) (n int, err error) {
  2393. l := len(dAtA)
  2394. iNdEx := 0
  2395. for iNdEx < l {
  2396. var wire uint64
  2397. for shift := uint(0); ; shift += 7 {
  2398. if shift >= 64 {
  2399. return 0, ErrIntOverflowRaft
  2400. }
  2401. if iNdEx >= l {
  2402. return 0, io.ErrUnexpectedEOF
  2403. }
  2404. b := dAtA[iNdEx]
  2405. iNdEx++
  2406. wire |= (uint64(b) & 0x7F) << shift
  2407. if b < 0x80 {
  2408. break
  2409. }
  2410. }
  2411. wireType := int(wire & 0x7)
  2412. switch wireType {
  2413. case 0:
  2414. for shift := uint(0); ; shift += 7 {
  2415. if shift >= 64 {
  2416. return 0, ErrIntOverflowRaft
  2417. }
  2418. if iNdEx >= l {
  2419. return 0, io.ErrUnexpectedEOF
  2420. }
  2421. iNdEx++
  2422. if dAtA[iNdEx-1] < 0x80 {
  2423. break
  2424. }
  2425. }
  2426. return iNdEx, nil
  2427. case 1:
  2428. iNdEx += 8
  2429. return iNdEx, nil
  2430. case 2:
  2431. var length int
  2432. for shift := uint(0); ; shift += 7 {
  2433. if shift >= 64 {
  2434. return 0, ErrIntOverflowRaft
  2435. }
  2436. if iNdEx >= l {
  2437. return 0, io.ErrUnexpectedEOF
  2438. }
  2439. b := dAtA[iNdEx]
  2440. iNdEx++
  2441. length |= (int(b) & 0x7F) << shift
  2442. if b < 0x80 {
  2443. break
  2444. }
  2445. }
  2446. iNdEx += length
  2447. if length < 0 {
  2448. return 0, ErrInvalidLengthRaft
  2449. }
  2450. return iNdEx, nil
  2451. case 3:
  2452. for {
  2453. var innerWire uint64
  2454. var start int = iNdEx
  2455. for shift := uint(0); ; shift += 7 {
  2456. if shift >= 64 {
  2457. return 0, ErrIntOverflowRaft
  2458. }
  2459. if iNdEx >= l {
  2460. return 0, io.ErrUnexpectedEOF
  2461. }
  2462. b := dAtA[iNdEx]
  2463. iNdEx++
  2464. innerWire |= (uint64(b) & 0x7F) << shift
  2465. if b < 0x80 {
  2466. break
  2467. }
  2468. }
  2469. innerWireType := int(innerWire & 0x7)
  2470. if innerWireType == 4 {
  2471. break
  2472. }
  2473. next, err := skipRaft(dAtA[start:])
  2474. if err != nil {
  2475. return 0, err
  2476. }
  2477. iNdEx = start + next
  2478. }
  2479. return iNdEx, nil
  2480. case 4:
  2481. return iNdEx, nil
  2482. case 5:
  2483. iNdEx += 4
  2484. return iNdEx, nil
  2485. default:
  2486. return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
  2487. }
  2488. }
  2489. panic("unreachable")
  2490. }
  2491. var (
  2492. ErrInvalidLengthRaft = fmt.Errorf("proto: negative length found during unmarshaling")
  2493. ErrIntOverflowRaft = fmt.Errorf("proto: integer overflow")
  2494. )
  2495. func init() { proto.RegisterFile("raft.proto", fileDescriptorRaft) }
  2496. var fileDescriptorRaft = []byte{
  2497. // 1009 bytes of a gzipped FileDescriptorProto
  2498. 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x55, 0xcd, 0x6e, 0xe3, 0x36,
  2499. 0x17, 0xb5, 0x64, 0xc5, 0x3f, 0xd7, 0x8e, 0xc3, 0xdc, 0xc9, 0x37, 0x20, 0x82, 0xc0, 0xe3, 0xcf,
  2500. 0xd3, 0x62, 0x8c, 0x14, 0x93, 0x16, 0x5e, 0x14, 0x45, 0x77, 0xf9, 0x19, 0x20, 0x29, 0xe2, 0x74,
  2501. 0xea, 0x64, 0xb2, 0x28, 0x50, 0x04, 0x8c, 0x45, 0x2b, 0x6a, 0x2d, 0x51, 0xa0, 0xe8, 0x34, 0xd9,
  2502. 0x14, 0x45, 0x9f, 0xa2, 0x9b, 0xd9, 0xf6, 0x01, 0xfa, 0x14, 0x59, 0x0e, 0xd0, 0xfd, 0xa0, 0x93,
  2503. 0xbe, 0x48, 0x41, 0x8a, 0xb2, 0x65, 0x27, 0x98, 0x45, 0x77, 0xe4, 0x39, 0x87, 0xf7, 0x9e, 0x7b,
  2504. 0x79, 0x45, 0x01, 0x48, 0x36, 0x56, 0x3b, 0x89, 0x14, 0x4a, 0x60, 0x45, 0xaf, 0x93, 0xcb, 0xcd,
  2505. 0x8d, 0x40, 0x04, 0xc2, 0x40, 0x9f, 0xeb, 0x55, 0xc6, 0x76, 0x7f, 0x81, 0x95, 0x57, 0xb1, 0x92,
  2506. 0xb7, 0xf8, 0x19, 0x78, 0x67, 0xb7, 0x09, 0xa7, 0x4e, 0xc7, 0xe9, 0xb5, 0xfa, 0xeb, 0x3b, 0xd9,
  2507. 0xa9, 0x1d, 0x43, 0x6a, 0x62, 0xcf, 0xbb, 0x7b, 0xff, 0xac, 0x34, 0x34, 0x22, 0xa4, 0xe0, 0x9d,
  2508. 0x71, 0x19, 0x51, 0xb7, 0xe3, 0xf4, 0xbc, 0x19, 0xc3, 0x65, 0x84, 0x9b, 0xb0, 0x72, 0x14, 0xfb,
  2509. 0xfc, 0x86, 0x96, 0x0b, 0x54, 0x06, 0x21, 0x82, 0x77, 0xc0, 0x14, 0xa3, 0x5e, 0xc7, 0xe9, 0x35,
  2510. 0x87, 0x66, 0xdd, 0xfd, 0xd5, 0x01, 0x72, 0x1a, 0xb3, 0x24, 0xbd, 0x12, 0x6a, 0xc0, 0x15, 0xf3,
  2511. 0x99, 0x62, 0xf8, 0x25, 0xc0, 0x48, 0xc4, 0xe3, 0x8b, 0x54, 0x31, 0x95, 0x39, 0x6a, 0xcc, 0x1d,
  2512. 0xed, 0x8b, 0x78, 0x7c, 0xaa, 0x09, 0x1b, 0xbc, 0x3e, 0xca, 0x01, 0x9d, 0x3c, 0x34, 0xc9, 0x8b,
  2513. 0xbe, 0x32, 0x48, 0x5b, 0x56, 0xda, 0x72, 0xd1, 0x97, 0x41, 0xba, 0xdf, 0x43, 0x2d, 0x77, 0xa0,
  2514. 0x2d, 0x6a, 0x07, 0x26, 0x67, 0x73, 0x68, 0xd6, 0xf8, 0x35, 0xd4, 0x22, 0xeb, 0xcc, 0x04, 0x6e,
  2515. 0xf4, 0x69, 0xee, 0x65, 0xd9, 0xb9, 0x8d, 0x3b, 0xd3, 0x77, 0xdf, 0x96, 0xa1, 0x3a, 0xe0, 0x69,
  2516. 0xca, 0x02, 0x8e, 0x2f, 0xc1, 0x53, 0xf3, 0x0e, 0x3f, 0xc9, 0x63, 0x58, 0xba, 0xd8, 0x63, 0x2d,
  2517. 0xc3, 0x0d, 0x70, 0x95, 0x58, 0xa8, 0xc4, 0x55, 0x42, 0x97, 0x31, 0x96, 0x62, 0xa9, 0x0c, 0x8d,
  2518. 0xcc, 0x0a, 0xf4, 0x96, 0x0b, 0xc4, 0x36, 0x54, 0x27, 0x22, 0x30, 0x17, 0xb6, 0x52, 0x20, 0x73,
  2519. 0x70, 0xde, 0xb6, 0xca, 0xc3, 0xb6, 0xbd, 0x84, 0x2a, 0x8f, 0x95, 0x0c, 0x79, 0x4a, 0xab, 0x9d,
  2520. 0x72, 0xaf, 0xd1, 0x5f, 0x5d, 0x98, 0x8c, 0x3c, 0x94, 0xd5, 0xe0, 0x16, 0x54, 0x46, 0x22, 0x8a,
  2521. 0x42, 0x45, 0x6b, 0x85, 0x58, 0x16, 0xc3, 0x3e, 0xd4, 0x52, 0xdb, 0x31, 0x5a, 0x37, 0x9d, 0x24,
  2522. 0xcb, 0x9d, 0xcc, 0x3b, 0x98, 0xeb, 0x74, 0x44, 0xc9, 0x7f, 0xe4, 0x23, 0x45, 0xa1, 0xe3, 0xf4,
  2523. 0x6a, 0x79, 0xc4, 0x0c, 0xc3, 0x4f, 0x00, 0xb2, 0xd5, 0x61, 0x18, 0x2b, 0xda, 0x28, 0xe4, 0x2c,
  2524. 0xe0, 0x48, 0xa1, 0x3a, 0x12, 0xb1, 0xe2, 0x37, 0x8a, 0x36, 0xcd, 0xc5, 0xe6, 0xdb, 0xee, 0x0f,
  2525. 0x50, 0x3f, 0x64, 0xd2, 0xcf, 0xc6, 0x27, 0xef, 0xa0, 0xf3, 0xa0, 0x83, 0x14, 0xbc, 0x6b, 0xa1,
  2526. 0xf8, 0xe2, 0xbc, 0x6b, 0xa4, 0x50, 0x70, 0xf9, 0x61, 0xc1, 0xdd, 0x3f, 0x1d, 0xa8, 0xcf, 0xe6,
  2527. 0x15, 0x9f, 0x42, 0x45, 0x9f, 0x91, 0x29, 0x75, 0x3a, 0xe5, 0x9e, 0x37, 0xb4, 0x3b, 0xdc, 0x84,
  2528. 0xda, 0x84, 0x33, 0x19, 0x6b, 0xc6, 0x35, 0xcc, 0x6c, 0x8f, 0x2f, 0x60, 0x2d, 0x53, 0x5d, 0x88,
  2529. 0xa9, 0x0a, 0x44, 0x18, 0x07, 0xb4, 0x6c, 0x24, 0xad, 0x0c, 0xfe, 0xd6, 0xa2, 0xf8, 0x1c, 0x56,
  2530. 0xf3, 0x43, 0x17, 0xb1, 0xae, 0xd4, 0x33, 0xb2, 0x66, 0x0e, 0x9e, 0xf0, 0x1b, 0x85, 0xcf, 0x01,
  2531. 0xd8, 0x54, 0x89, 0x8b, 0x09, 0x67, 0xd7, 0xdc, 0x0c, 0x43, 0xde, 0xd0, 0xba, 0xc6, 0x8f, 0x35,
  2532. 0xdc, 0x7d, 0xeb, 0x00, 0x68, 0xd3, 0xfb, 0x57, 0x2c, 0x0e, 0xf4, 0x47, 0xe5, 0x86, 0xbe, 0xed,
  2533. 0x09, 0x68, 0xed, 0xfd, 0xfb, 0x67, 0xee, 0xd1, 0xc1, 0xd0, 0x0d, 0x7d, 0xfc, 0xc2, 0x8e, 0xb4,
  2534. 0x6b, 0x46, 0xfa, 0x69, 0xf1, 0x13, 0xcd, 0x4e, 0x3f, 0x98, 0xea, 0x17, 0x50, 0x8d, 0x85, 0xcf,
  2535. 0x2f, 0x42, 0xdf, 0x36, 0xac, 0x65, 0x43, 0x56, 0x4e, 0x84, 0xcf, 0x8f, 0x0e, 0x86, 0x15, 0x4d,
  2536. 0x1f, 0xf9, 0xc5, 0x3b, 0xf3, 0x16, 0xef, 0x2c, 0x02, 0x32, 0x4f, 0x70, 0x1a, 0xc6, 0xc1, 0x84,
  2537. 0xcf, 0x8c, 0x38, 0xff, 0xc5, 0x88, 0xfb, 0x31, 0x23, 0xdd, 0x3f, 0x1c, 0x68, 0xce, 0xe3, 0x9c,
  2538. 0xf7, 0x71, 0x0f, 0x40, 0x49, 0x16, 0xa7, 0xa1, 0x0a, 0x45, 0x6c, 0x33, 0x6e, 0x3d, 0x92, 0x71,
  2539. 0xa6, 0xc9, 0x27, 0x72, 0x7e, 0x0a, 0xbf, 0x82, 0xea, 0xc8, 0xa8, 0xb2, 0x1b, 0x2f, 0x3c, 0x29,
  2540. 0xcb, 0xa5, 0xe5, 0x5f, 0x98, 0x95, 0x17, 0xfb, 0x52, 0x5e, 0xe8, 0xcb, 0xf6, 0x21, 0xd4, 0x67,
  2541. 0xaf, 0x35, 0xae, 0x41, 0xc3, 0x6c, 0x4e, 0x84, 0x8c, 0xd8, 0x84, 0x94, 0xf0, 0x09, 0xac, 0x19,
  2542. 0x60, 0x1e, 0x9f, 0x38, 0xf8, 0x3f, 0x58, 0x5f, 0x02, 0xcf, 0xfb, 0xc4, 0xdd, 0xfe, 0xcb, 0x85,
  2543. 0x46, 0xe1, 0x59, 0x42, 0x80, 0xca, 0x20, 0x0d, 0x0e, 0xa7, 0x09, 0x29, 0x61, 0x03, 0xaa, 0x83,
  2544. 0x34, 0xd8, 0xe3, 0x4c, 0x11, 0xc7, 0x6e, 0x5e, 0x4b, 0x91, 0x10, 0xd7, 0xaa, 0x76, 0x93, 0x84,
  2545. 0x94, 0xb1, 0x05, 0x90, 0xad, 0x87, 0x3c, 0x4d, 0x88, 0x67, 0x85, 0xe7, 0x42, 0x71, 0xb2, 0xa2,
  2546. 0xbd, 0xd9, 0x8d, 0x61, 0x2b, 0x96, 0xd5, 0x4f, 0x00, 0xa9, 0x22, 0x81, 0xa6, 0x4e, 0xc6, 0x99,
  2547. 0x54, 0x97, 0x3a, 0x4b, 0x0d, 0x37, 0x80, 0x14, 0x11, 0x73, 0xa8, 0x8e, 0x08, 0xad, 0x41, 0x1a,
  2548. 0xbc, 0x89, 0x25, 0x67, 0xa3, 0x2b, 0x76, 0x39, 0xe1, 0x04, 0x70, 0x1d, 0x56, 0x6d, 0x20, 0xfd,
  2549. 0xc5, 0x4d, 0x53, 0xd2, 0xb0, 0xb2, 0xfd, 0x2b, 0x3e, 0xfa, 0xe9, 0xbb, 0xa9, 0x90, 0xd3, 0x88,
  2550. 0x34, 0x75, 0xd9, 0x83, 0x34, 0x30, 0x17, 0x34, 0xe6, 0xf2, 0x98, 0x33, 0x9f, 0x4b, 0xb2, 0x6a,
  2551. 0x4f, 0x9f, 0x85, 0x11, 0x17, 0x53, 0x75, 0x22, 0x7e, 0x26, 0x2d, 0x6b, 0x66, 0xc8, 0x99, 0x6f,
  2552. 0x7e, 0x61, 0x64, 0xcd, 0x9a, 0x99, 0x21, 0xc6, 0x0c, 0xb1, 0xf5, 0xbe, 0x96, 0xdc, 0x94, 0xb8,
  2553. 0x6e, 0xb3, 0xda, 0xbd, 0xd1, 0xe0, 0xf6, 0x6f, 0x0e, 0x6c, 0x3c, 0x36, 0x1e, 0xb8, 0x05, 0xf4,
  2554. 0x31, 0x7c, 0x77, 0xaa, 0x04, 0x29, 0xe1, 0xa7, 0xf0, 0xff, 0xc7, 0xd8, 0x6f, 0x44, 0x18, 0xab,
  2555. 0xa3, 0x28, 0x99, 0x84, 0xa3, 0x50, 0x5f, 0xc5, 0xc7, 0x64, 0xaf, 0x6e, 0xac, 0xcc, 0xdd, 0xbe,
  2556. 0x85, 0xd6, 0xe2, 0x47, 0xa1, 0x9b, 0x31, 0x47, 0x76, 0x7d, 0x5f, 0x8f, 0x3f, 0x29, 0x21, 0x2d,
  2557. 0x9a, 0x1d, 0xf2, 0x48, 0x5c, 0x73, 0xc3, 0x38, 0x8b, 0xcc, 0x9b, 0xc4, 0x67, 0x2a, 0x63, 0xdc,
  2558. 0xc5, 0x42, 0x76, 0x7d, 0xff, 0x38, 0x7b, 0x7b, 0x0c, 0x5b, 0xde, 0xa3, 0x77, 0x1f, 0xda, 0xa5,
  2559. 0x77, 0x1f, 0xda, 0xa5, 0xbb, 0xfb, 0xb6, 0xf3, 0xee, 0xbe, 0xed, 0xfc, 0x7d, 0xdf, 0x76, 0x7e,
  2560. 0xff, 0xa7, 0x5d, 0xfa, 0x37, 0x00, 0x00, 0xff, 0xff, 0x87, 0x11, 0x6d, 0xd6, 0xaf, 0x08, 0x00,
  2561. 0x00,
  2562. }