tikv_client/generated/
raft_cmdpb.rs

1#[allow(clippy::derive_partial_eq_without_eq)]
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct GetRequest {
4    #[prost(string, tag = "1")]
5    pub cf: ::prost::alloc::string::String,
6    #[prost(bytes = "vec", tag = "2")]
7    pub key: ::prost::alloc::vec::Vec<u8>,
8}
9#[allow(clippy::derive_partial_eq_without_eq)]
10#[derive(Clone, PartialEq, ::prost::Message)]
11pub struct GetResponse {
12    #[prost(bytes = "vec", tag = "1")]
13    pub value: ::prost::alloc::vec::Vec<u8>,
14}
15#[allow(clippy::derive_partial_eq_without_eq)]
16#[derive(Clone, PartialEq, ::prost::Message)]
17pub struct PutRequest {
18    #[prost(string, tag = "1")]
19    pub cf: ::prost::alloc::string::String,
20    #[prost(bytes = "vec", tag = "2")]
21    pub key: ::prost::alloc::vec::Vec<u8>,
22    #[prost(bytes = "vec", tag = "3")]
23    pub value: ::prost::alloc::vec::Vec<u8>,
24}
25#[allow(clippy::derive_partial_eq_without_eq)]
26#[derive(Clone, PartialEq, ::prost::Message)]
27pub struct PutResponse {}
28#[allow(clippy::derive_partial_eq_without_eq)]
29#[derive(Clone, PartialEq, ::prost::Message)]
30pub struct DeleteRequest {
31    #[prost(string, tag = "1")]
32    pub cf: ::prost::alloc::string::String,
33    #[prost(bytes = "vec", tag = "2")]
34    pub key: ::prost::alloc::vec::Vec<u8>,
35}
36#[allow(clippy::derive_partial_eq_without_eq)]
37#[derive(Clone, PartialEq, ::prost::Message)]
38pub struct DeleteResponse {}
39#[allow(clippy::derive_partial_eq_without_eq)]
40#[derive(Clone, PartialEq, ::prost::Message)]
41pub struct DeleteRangeRequest {
42    #[prost(string, tag = "1")]
43    pub cf: ::prost::alloc::string::String,
44    #[prost(bytes = "vec", tag = "2")]
45    pub start_key: ::prost::alloc::vec::Vec<u8>,
46    #[prost(bytes = "vec", tag = "3")]
47    pub end_key: ::prost::alloc::vec::Vec<u8>,
48    #[prost(bool, tag = "4")]
49    pub notify_only: bool,
50}
51#[allow(clippy::derive_partial_eq_without_eq)]
52#[derive(Clone, PartialEq, ::prost::Message)]
53pub struct DeleteRangeResponse {}
54#[allow(clippy::derive_partial_eq_without_eq)]
55#[derive(Clone, PartialEq, ::prost::Message)]
56pub struct SnapRequest {}
57#[allow(clippy::derive_partial_eq_without_eq)]
58#[derive(Clone, PartialEq, ::prost::Message)]
59pub struct SnapResponse {
60    #[prost(message, optional, tag = "1")]
61    pub region: ::core::option::Option<super::metapb::Region>,
62}
63#[allow(clippy::derive_partial_eq_without_eq)]
64#[derive(Clone, PartialEq, ::prost::Message)]
65pub struct PrewriteRequest {
66    #[prost(bytes = "vec", tag = "1")]
67    pub key: ::prost::alloc::vec::Vec<u8>,
68    #[prost(bytes = "vec", tag = "2")]
69    pub value: ::prost::alloc::vec::Vec<u8>,
70    #[prost(bytes = "vec", tag = "3")]
71    pub lock: ::prost::alloc::vec::Vec<u8>,
72}
73#[allow(clippy::derive_partial_eq_without_eq)]
74#[derive(Clone, PartialEq, ::prost::Message)]
75pub struct PrewriteResponse {}
76#[allow(clippy::derive_partial_eq_without_eq)]
77#[derive(Clone, PartialEq, ::prost::Message)]
78pub struct IngestSstRequest {
79    #[prost(message, optional, tag = "1")]
80    pub sst: ::core::option::Option<super::import_sstpb::SstMeta>,
81}
82#[allow(clippy::derive_partial_eq_without_eq)]
83#[derive(Clone, PartialEq, ::prost::Message)]
84pub struct IngestSstResponse {}
85#[allow(clippy::derive_partial_eq_without_eq)]
86#[derive(Clone, PartialEq, ::prost::Message)]
87pub struct ReadIndexRequest {
88    /// In replica read, leader uses start_ts and key_ranges to check memory locks.
89    #[prost(uint64, tag = "1")]
90    pub start_ts: u64,
91    #[prost(message, repeated, tag = "2")]
92    pub key_ranges: ::prost::alloc::vec::Vec<super::kvrpcpb::KeyRange>,
93}
94#[allow(clippy::derive_partial_eq_without_eq)]
95#[derive(Clone, PartialEq, ::prost::Message)]
96pub struct ReadIndexResponse {
97    #[prost(uint64, tag = "1")]
98    pub read_index: u64,
99    /// The memory lock blocking this read at the leader
100    #[prost(message, optional, tag = "2")]
101    pub locked: ::core::option::Option<super::kvrpcpb::LockInfo>,
102}
103#[allow(clippy::derive_partial_eq_without_eq)]
104#[derive(Clone, PartialEq, ::prost::Message)]
105pub struct Request {
106    #[prost(enumeration = "CmdType", tag = "1")]
107    pub cmd_type: i32,
108    #[prost(message, optional, tag = "2")]
109    pub get: ::core::option::Option<GetRequest>,
110    #[prost(message, optional, tag = "4")]
111    pub put: ::core::option::Option<PutRequest>,
112    #[prost(message, optional, tag = "5")]
113    pub delete: ::core::option::Option<DeleteRequest>,
114    #[prost(message, optional, tag = "6")]
115    pub snap: ::core::option::Option<SnapRequest>,
116    #[prost(message, optional, tag = "7")]
117    pub prewrite: ::core::option::Option<PrewriteRequest>,
118    #[prost(message, optional, tag = "8")]
119    pub delete_range: ::core::option::Option<DeleteRangeRequest>,
120    #[prost(message, optional, tag = "9")]
121    pub ingest_sst: ::core::option::Option<IngestSstRequest>,
122    #[prost(message, optional, tag = "10")]
123    pub read_index: ::core::option::Option<ReadIndexRequest>,
124}
125#[allow(clippy::derive_partial_eq_without_eq)]
126#[derive(Clone, PartialEq, ::prost::Message)]
127pub struct Response {
128    #[prost(enumeration = "CmdType", tag = "1")]
129    pub cmd_type: i32,
130    #[prost(message, optional, tag = "2")]
131    pub get: ::core::option::Option<GetResponse>,
132    #[prost(message, optional, tag = "4")]
133    pub put: ::core::option::Option<PutResponse>,
134    #[prost(message, optional, tag = "5")]
135    pub delete: ::core::option::Option<DeleteResponse>,
136    #[prost(message, optional, tag = "6")]
137    pub snap: ::core::option::Option<SnapResponse>,
138    #[prost(message, optional, tag = "7")]
139    pub prewrite: ::core::option::Option<PrewriteResponse>,
140    #[prost(message, optional, tag = "8")]
141    pub delte_range: ::core::option::Option<DeleteRangeResponse>,
142    #[prost(message, optional, tag = "9")]
143    pub ingest_sst: ::core::option::Option<IngestSstResponse>,
144    #[prost(message, optional, tag = "10")]
145    pub read_index: ::core::option::Option<ReadIndexResponse>,
146}
147#[allow(clippy::derive_partial_eq_without_eq)]
148#[derive(Clone, PartialEq, ::prost::Message)]
149pub struct ChangePeerRequest {
150    /// This can be only called in internal RaftStore now.
151    #[prost(enumeration = "super::eraftpb::ConfChangeType", tag = "1")]
152    pub change_type: i32,
153    #[prost(message, optional, tag = "2")]
154    pub peer: ::core::option::Option<super::metapb::Peer>,
155}
156#[allow(clippy::derive_partial_eq_without_eq)]
157#[derive(Clone, PartialEq, ::prost::Message)]
158pub struct ChangePeerResponse {
159    #[prost(message, optional, tag = "1")]
160    pub region: ::core::option::Option<super::metapb::Region>,
161}
162#[allow(clippy::derive_partial_eq_without_eq)]
163#[derive(Clone, PartialEq, ::prost::Message)]
164pub struct ChangePeerV2Request {
165    #[prost(message, repeated, tag = "1")]
166    pub changes: ::prost::alloc::vec::Vec<ChangePeerRequest>,
167}
168#[allow(clippy::derive_partial_eq_without_eq)]
169#[derive(Clone, PartialEq, ::prost::Message)]
170pub struct ChangePeerV2Response {
171    #[prost(message, optional, tag = "1")]
172    pub region: ::core::option::Option<super::metapb::Region>,
173}
174#[allow(clippy::derive_partial_eq_without_eq)]
175#[derive(Clone, PartialEq, ::prost::Message)]
176pub struct SplitRequest {
177    /// This can be only called in internal RaftStore now.
178    /// The split_key must be in the been splitting region.
179    #[prost(bytes = "vec", tag = "1")]
180    pub split_key: ::prost::alloc::vec::Vec<u8>,
181    /// We split the region into two, first uses the origin
182    /// parent region id, and the second uses the new_region_id.
183    /// We must guarantee that the new_region_id is global unique.
184    #[prost(uint64, tag = "2")]
185    pub new_region_id: u64,
186    /// The peer ids for the new split region.
187    #[prost(uint64, repeated, tag = "3")]
188    pub new_peer_ids: ::prost::alloc::vec::Vec<u64>,
189    /// If true, right region derive the origin region_id,
190    /// left region use new_region_id.
191    /// Will be ignored in batch split, use `BatchSplitRequest::right_derive` instead.
192    #[deprecated]
193    #[prost(bool, tag = "4")]
194    pub right_derive: bool,
195}
196#[allow(clippy::derive_partial_eq_without_eq)]
197#[derive(Clone, PartialEq, ::prost::Message)]
198pub struct SplitResponse {
199    #[prost(message, optional, tag = "1")]
200    pub left: ::core::option::Option<super::metapb::Region>,
201    #[prost(message, optional, tag = "2")]
202    pub right: ::core::option::Option<super::metapb::Region>,
203}
204#[allow(clippy::derive_partial_eq_without_eq)]
205#[derive(Clone, PartialEq, ::prost::Message)]
206pub struct BatchSplitRequest {
207    #[prost(message, repeated, tag = "1")]
208    pub requests: ::prost::alloc::vec::Vec<SplitRequest>,
209    /// If true, the last region derive the origin region_id,
210    /// other regions use new ids.
211    #[prost(bool, tag = "2")]
212    pub right_derive: bool,
213}
214#[allow(clippy::derive_partial_eq_without_eq)]
215#[derive(Clone, PartialEq, ::prost::Message)]
216pub struct BatchSplitResponse {
217    #[prost(message, repeated, tag = "1")]
218    pub regions: ::prost::alloc::vec::Vec<super::metapb::Region>,
219}
220#[allow(clippy::derive_partial_eq_without_eq)]
221#[derive(Clone, PartialEq, ::prost::Message)]
222pub struct CompactLogRequest {
223    #[prost(uint64, tag = "1")]
224    pub compact_index: u64,
225    #[prost(uint64, tag = "2")]
226    pub compact_term: u64,
227}
228#[allow(clippy::derive_partial_eq_without_eq)]
229#[derive(Clone, PartialEq, ::prost::Message)]
230pub struct CompactLogResponse {}
231#[allow(clippy::derive_partial_eq_without_eq)]
232#[derive(Clone, PartialEq, ::prost::Message)]
233pub struct TransferLeaderRequest {
234    #[prost(message, optional, tag = "1")]
235    pub peer: ::core::option::Option<super::metapb::Peer>,
236    #[prost(message, repeated, tag = "2")]
237    pub peers: ::prost::alloc::vec::Vec<super::metapb::Peer>,
238}
239#[allow(clippy::derive_partial_eq_without_eq)]
240#[derive(Clone, PartialEq, ::prost::Message)]
241pub struct TransferLeaderResponse {}
242#[allow(clippy::derive_partial_eq_without_eq)]
243#[derive(Clone, PartialEq, ::prost::Message)]
244pub struct ComputeHashRequest {
245    #[prost(bytes = "vec", tag = "1")]
246    pub context: ::prost::alloc::vec::Vec<u8>,
247}
248#[allow(clippy::derive_partial_eq_without_eq)]
249#[derive(Clone, PartialEq, ::prost::Message)]
250pub struct VerifyHashRequest {
251    #[prost(uint64, tag = "1")]
252    pub index: u64,
253    #[prost(bytes = "vec", tag = "2")]
254    pub hash: ::prost::alloc::vec::Vec<u8>,
255    #[prost(bytes = "vec", tag = "3")]
256    pub context: ::prost::alloc::vec::Vec<u8>,
257}
258#[allow(clippy::derive_partial_eq_without_eq)]
259#[derive(Clone, PartialEq, ::prost::Message)]
260pub struct VerifyHashResponse {}
261#[allow(clippy::derive_partial_eq_without_eq)]
262#[derive(Clone, PartialEq, ::prost::Message)]
263pub struct PrepareMergeRequest {
264    #[prost(uint64, tag = "1")]
265    pub min_index: u64,
266    #[prost(message, optional, tag = "2")]
267    pub target: ::core::option::Option<super::metapb::Region>,
268}
269#[allow(clippy::derive_partial_eq_without_eq)]
270#[derive(Clone, PartialEq, ::prost::Message)]
271pub struct PrepareMergeResponse {}
272#[allow(clippy::derive_partial_eq_without_eq)]
273#[derive(Clone, PartialEq, ::prost::Message)]
274pub struct CommitMergeRequest {
275    #[prost(message, optional, tag = "1")]
276    pub source: ::core::option::Option<super::metapb::Region>,
277    #[prost(uint64, tag = "2")]
278    pub commit: u64,
279    #[prost(message, repeated, tag = "3")]
280    pub entries: ::prost::alloc::vec::Vec<super::eraftpb::Entry>,
281}
282#[allow(clippy::derive_partial_eq_without_eq)]
283#[derive(Clone, PartialEq, ::prost::Message)]
284pub struct CommitMergeResponse {}
285#[allow(clippy::derive_partial_eq_without_eq)]
286#[derive(Clone, PartialEq, ::prost::Message)]
287pub struct RollbackMergeRequest {
288    #[prost(uint64, tag = "1")]
289    pub commit: u64,
290}
291#[allow(clippy::derive_partial_eq_without_eq)]
292#[derive(Clone, PartialEq, ::prost::Message)]
293pub struct RollbackMergeResponse {}
294#[allow(clippy::derive_partial_eq_without_eq)]
295#[derive(Clone, PartialEq, ::prost::Message)]
296pub struct AdminRequest {
297    #[prost(enumeration = "AdminCmdType", tag = "1")]
298    pub cmd_type: i32,
299    #[prost(message, optional, tag = "2")]
300    pub change_peer: ::core::option::Option<ChangePeerRequest>,
301    #[deprecated]
302    #[prost(message, optional, tag = "3")]
303    pub split: ::core::option::Option<SplitRequest>,
304    #[prost(message, optional, tag = "4")]
305    pub compact_log: ::core::option::Option<CompactLogRequest>,
306    #[prost(message, optional, tag = "5")]
307    pub transfer_leader: ::core::option::Option<TransferLeaderRequest>,
308    #[prost(message, optional, tag = "6")]
309    pub verify_hash: ::core::option::Option<VerifyHashRequest>,
310    #[prost(message, optional, tag = "7")]
311    pub prepare_merge: ::core::option::Option<PrepareMergeRequest>,
312    #[prost(message, optional, tag = "8")]
313    pub commit_merge: ::core::option::Option<CommitMergeRequest>,
314    #[prost(message, optional, tag = "9")]
315    pub rollback_merge: ::core::option::Option<RollbackMergeRequest>,
316    #[prost(message, optional, tag = "10")]
317    pub splits: ::core::option::Option<BatchSplitRequest>,
318    #[prost(message, optional, tag = "11")]
319    pub change_peer_v2: ::core::option::Option<ChangePeerV2Request>,
320    #[prost(message, optional, tag = "12")]
321    pub compute_hash: ::core::option::Option<ComputeHashRequest>,
322}
323#[allow(clippy::derive_partial_eq_without_eq)]
324#[derive(Clone, PartialEq, ::prost::Message)]
325pub struct AdminResponse {
326    #[prost(enumeration = "AdminCmdType", tag = "1")]
327    pub cmd_type: i32,
328    #[prost(message, optional, tag = "2")]
329    pub change_peer: ::core::option::Option<ChangePeerResponse>,
330    #[deprecated]
331    #[prost(message, optional, tag = "3")]
332    pub split: ::core::option::Option<SplitResponse>,
333    #[prost(message, optional, tag = "4")]
334    pub compact_log: ::core::option::Option<CompactLogResponse>,
335    #[prost(message, optional, tag = "5")]
336    pub transfer_leader: ::core::option::Option<TransferLeaderResponse>,
337    #[prost(message, optional, tag = "6")]
338    pub verify_hash: ::core::option::Option<VerifyHashResponse>,
339    #[prost(message, optional, tag = "7")]
340    pub prepare_merge: ::core::option::Option<PrepareMergeResponse>,
341    #[prost(message, optional, tag = "8")]
342    pub commit_merge: ::core::option::Option<CommitMergeResponse>,
343    #[prost(message, optional, tag = "9")]
344    pub rollback_merge: ::core::option::Option<RollbackMergeResponse>,
345    #[prost(message, optional, tag = "10")]
346    pub splits: ::core::option::Option<BatchSplitResponse>,
347    #[prost(message, optional, tag = "11")]
348    pub change_peer_v2: ::core::option::Option<ChangePeerV2Response>,
349}
350/// For get the leader of the region.
351#[allow(clippy::derive_partial_eq_without_eq)]
352#[derive(Clone, PartialEq, ::prost::Message)]
353pub struct RegionLeaderRequest {}
354#[allow(clippy::derive_partial_eq_without_eq)]
355#[derive(Clone, PartialEq, ::prost::Message)]
356pub struct RegionLeaderResponse {
357    #[prost(message, optional, tag = "1")]
358    pub leader: ::core::option::Option<super::metapb::Peer>,
359}
360/// For getting more information of the region.
361/// We add some admin operations (ChangePeer, Split...) into the pb job list,
362/// then pd server will peek the first one, handle it and then pop it from the job lib.
363/// But sometimes, the pd server may crash before popping. When another pd server
364/// starts and finds the job is running but not finished, it will first check whether
365/// the raft server already has handled this job.
366/// E,g, for ChangePeer, if we add Peer10 into region1 and find region1 has already had
367/// Peer10, we can think this ChangePeer is finished, and can pop this job from job list
368/// directly.
369#[allow(clippy::derive_partial_eq_without_eq)]
370#[derive(Clone, PartialEq, ::prost::Message)]
371pub struct RegionDetailRequest {}
372#[allow(clippy::derive_partial_eq_without_eq)]
373#[derive(Clone, PartialEq, ::prost::Message)]
374pub struct RegionDetailResponse {
375    #[prost(message, optional, tag = "1")]
376    pub region: ::core::option::Option<super::metapb::Region>,
377    #[prost(message, optional, tag = "2")]
378    pub leader: ::core::option::Option<super::metapb::Peer>,
379}
380#[allow(clippy::derive_partial_eq_without_eq)]
381#[derive(Clone, PartialEq, ::prost::Message)]
382pub struct StatusRequest {
383    #[prost(enumeration = "StatusCmdType", tag = "1")]
384    pub cmd_type: i32,
385    #[prost(message, optional, tag = "2")]
386    pub region_leader: ::core::option::Option<RegionLeaderRequest>,
387    #[prost(message, optional, tag = "3")]
388    pub region_detail: ::core::option::Option<RegionDetailRequest>,
389}
390#[allow(clippy::derive_partial_eq_without_eq)]
391#[derive(Clone, PartialEq, ::prost::Message)]
392pub struct StatusResponse {
393    #[prost(enumeration = "StatusCmdType", tag = "1")]
394    pub cmd_type: i32,
395    #[prost(message, optional, tag = "2")]
396    pub region_leader: ::core::option::Option<RegionLeaderResponse>,
397    #[prost(message, optional, tag = "3")]
398    pub region_detail: ::core::option::Option<RegionDetailResponse>,
399}
400#[allow(clippy::derive_partial_eq_without_eq)]
401#[derive(Clone, PartialEq, ::prost::Message)]
402pub struct RaftRequestHeader {
403    #[prost(uint64, tag = "1")]
404    pub region_id: u64,
405    #[prost(message, optional, tag = "2")]
406    pub peer: ::core::option::Option<super::metapb::Peer>,
407    /// true for read linearization
408    #[prost(bool, tag = "3")]
409    pub read_quorum: bool,
410    /// 16 bytes, to distinguish request.
411    #[prost(bytes = "vec", tag = "4")]
412    pub uuid: ::prost::alloc::vec::Vec<u8>,
413    #[prost(message, optional, tag = "5")]
414    pub region_epoch: ::core::option::Option<super::metapb::RegionEpoch>,
415    #[prost(uint64, tag = "6")]
416    pub term: u64,
417    #[prost(bool, tag = "7")]
418    pub sync_log: bool,
419    #[prost(bool, tag = "8")]
420    pub replica_read: bool,
421    /// Read requests can be responsed directly after the Raft applys to `applied_index`.
422    #[prost(uint64, tag = "9")]
423    pub applied_index: u64,
424    /// Custom flags for this raft request.
425    #[prost(uint64, tag = "10")]
426    pub flags: u64,
427    #[prost(bytes = "vec", tag = "11")]
428    pub flag_data: ::prost::alloc::vec::Vec<u8>,
429}
430#[allow(clippy::derive_partial_eq_without_eq)]
431#[derive(Clone, PartialEq, ::prost::Message)]
432pub struct RaftResponseHeader {
433    #[prost(message, optional, tag = "1")]
434    pub error: ::core::option::Option<super::errorpb::Error>,
435    #[prost(bytes = "vec", tag = "2")]
436    pub uuid: ::prost::alloc::vec::Vec<u8>,
437    #[prost(uint64, tag = "3")]
438    pub current_term: u64,
439}
440#[allow(clippy::derive_partial_eq_without_eq)]
441#[derive(Clone, PartialEq, ::prost::Message)]
442pub struct RaftCmdRequest {
443    #[prost(message, optional, tag = "1")]
444    pub header: ::core::option::Option<RaftRequestHeader>,
445    /// We can't enclose normal requests and administrator request
446    /// at same time.
447    #[prost(message, repeated, tag = "2")]
448    pub requests: ::prost::alloc::vec::Vec<Request>,
449    #[prost(message, optional, tag = "3")]
450    pub admin_request: ::core::option::Option<AdminRequest>,
451    #[prost(message, optional, tag = "4")]
452    pub status_request: ::core::option::Option<StatusRequest>,
453}
454#[allow(clippy::derive_partial_eq_without_eq)]
455#[derive(Clone, PartialEq, ::prost::Message)]
456pub struct RaftCmdResponse {
457    #[prost(message, optional, tag = "1")]
458    pub header: ::core::option::Option<RaftResponseHeader>,
459    #[prost(message, repeated, tag = "2")]
460    pub responses: ::prost::alloc::vec::Vec<Response>,
461    #[prost(message, optional, tag = "3")]
462    pub admin_response: ::core::option::Option<AdminResponse>,
463    #[prost(message, optional, tag = "4")]
464    pub status_response: ::core::option::Option<StatusResponse>,
465}
466#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
467#[repr(i32)]
468pub enum CmdType {
469    Invalid = 0,
470    Get = 1,
471    Put = 3,
472    Delete = 4,
473    Snap = 5,
474    Prewrite = 6,
475    DeleteRange = 7,
476    IngestSst = 8,
477    ReadIndex = 9,
478}
479impl CmdType {
480    /// String value of the enum field names used in the ProtoBuf definition.
481    ///
482    /// The values are not transformed in any way and thus are considered stable
483    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
484    pub fn as_str_name(&self) -> &'static str {
485        match self {
486            CmdType::Invalid => "Invalid",
487            CmdType::Get => "Get",
488            CmdType::Put => "Put",
489            CmdType::Delete => "Delete",
490            CmdType::Snap => "Snap",
491            CmdType::Prewrite => "Prewrite",
492            CmdType::DeleteRange => "DeleteRange",
493            CmdType::IngestSst => "IngestSST",
494            CmdType::ReadIndex => "ReadIndex",
495        }
496    }
497    /// Creates an enum from field names used in the ProtoBuf definition.
498    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
499        match value {
500            "Invalid" => Some(Self::Invalid),
501            "Get" => Some(Self::Get),
502            "Put" => Some(Self::Put),
503            "Delete" => Some(Self::Delete),
504            "Snap" => Some(Self::Snap),
505            "Prewrite" => Some(Self::Prewrite),
506            "DeleteRange" => Some(Self::DeleteRange),
507            "IngestSST" => Some(Self::IngestSst),
508            "ReadIndex" => Some(Self::ReadIndex),
509            _ => None,
510        }
511    }
512}
513#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
514#[repr(i32)]
515pub enum AdminCmdType {
516    InvalidAdmin = 0,
517    ChangePeer = 1,
518    /// Use `BatchSplit` instead.
519    Split = 2,
520    CompactLog = 3,
521    TransferLeader = 4,
522    ComputeHash = 5,
523    VerifyHash = 6,
524    PrepareMerge = 7,
525    CommitMerge = 8,
526    RollbackMerge = 9,
527    BatchSplit = 10,
528    ChangePeerV2 = 11,
529}
530impl AdminCmdType {
531    /// String value of the enum field names used in the ProtoBuf definition.
532    ///
533    /// The values are not transformed in any way and thus are considered stable
534    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
535    pub fn as_str_name(&self) -> &'static str {
536        match self {
537            AdminCmdType::InvalidAdmin => "InvalidAdmin",
538            AdminCmdType::ChangePeer => "ChangePeer",
539            AdminCmdType::Split => "Split",
540            AdminCmdType::CompactLog => "CompactLog",
541            AdminCmdType::TransferLeader => "TransferLeader",
542            AdminCmdType::ComputeHash => "ComputeHash",
543            AdminCmdType::VerifyHash => "VerifyHash",
544            AdminCmdType::PrepareMerge => "PrepareMerge",
545            AdminCmdType::CommitMerge => "CommitMerge",
546            AdminCmdType::RollbackMerge => "RollbackMerge",
547            AdminCmdType::BatchSplit => "BatchSplit",
548            AdminCmdType::ChangePeerV2 => "ChangePeerV2",
549        }
550    }
551    /// Creates an enum from field names used in the ProtoBuf definition.
552    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
553        match value {
554            "InvalidAdmin" => Some(Self::InvalidAdmin),
555            "ChangePeer" => Some(Self::ChangePeer),
556            "Split" => Some(Self::Split),
557            "CompactLog" => Some(Self::CompactLog),
558            "TransferLeader" => Some(Self::TransferLeader),
559            "ComputeHash" => Some(Self::ComputeHash),
560            "VerifyHash" => Some(Self::VerifyHash),
561            "PrepareMerge" => Some(Self::PrepareMerge),
562            "CommitMerge" => Some(Self::CommitMerge),
563            "RollbackMerge" => Some(Self::RollbackMerge),
564            "BatchSplit" => Some(Self::BatchSplit),
565            "ChangePeerV2" => Some(Self::ChangePeerV2),
566            _ => None,
567        }
568    }
569}
570#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
571#[repr(i32)]
572pub enum StatusCmdType {
573    InvalidStatus = 0,
574    RegionLeader = 1,
575    RegionDetail = 2,
576}
577impl StatusCmdType {
578    /// String value of the enum field names used in the ProtoBuf definition.
579    ///
580    /// The values are not transformed in any way and thus are considered stable
581    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
582    pub fn as_str_name(&self) -> &'static str {
583        match self {
584            StatusCmdType::InvalidStatus => "InvalidStatus",
585            StatusCmdType::RegionLeader => "RegionLeader",
586            StatusCmdType::RegionDetail => "RegionDetail",
587        }
588    }
589    /// Creates an enum from field names used in the ProtoBuf definition.
590    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
591        match value {
592            "InvalidStatus" => Some(Self::InvalidStatus),
593            "RegionLeader" => Some(Self::RegionLeader),
594            "RegionDetail" => Some(Self::RegionDetail),
595            _ => None,
596        }
597    }
598}