Skip to main content

tikv_client/generated/
pdpb.rs

1// This file is @generated by prost-build.
2#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct WatchGlobalConfigRequest {
5    #[prost(string, tag = "1")]
6    pub config_path: ::prost::alloc::string::String,
7    #[prost(int64, tag = "2")]
8    pub revision: i64,
9}
10#[allow(clippy::derive_partial_eq_without_eq)]
11#[derive(Clone, PartialEq, ::prost::Message)]
12pub struct WatchGlobalConfigResponse {
13    #[prost(message, repeated, tag = "1")]
14    pub changes: ::prost::alloc::vec::Vec<GlobalConfigItem>,
15    #[prost(int64, tag = "2")]
16    pub revision: i64,
17    #[prost(message, optional, tag = "3")]
18    pub header: ::core::option::Option<ResponseHeader>,
19}
20#[allow(clippy::derive_partial_eq_without_eq)]
21#[derive(Clone, PartialEq, ::prost::Message)]
22pub struct StoreGlobalConfigRequest {
23    #[prost(message, repeated, tag = "1")]
24    pub changes: ::prost::alloc::vec::Vec<GlobalConfigItem>,
25    #[prost(string, tag = "2")]
26    pub config_path: ::prost::alloc::string::String,
27}
28#[allow(clippy::derive_partial_eq_without_eq)]
29#[derive(Clone, PartialEq, ::prost::Message)]
30pub struct StoreGlobalConfigResponse {
31    #[prost(message, optional, tag = "1")]
32    pub error: ::core::option::Option<Error>,
33}
34#[allow(clippy::derive_partial_eq_without_eq)]
35#[derive(Clone, PartialEq, ::prost::Message)]
36pub struct LoadGlobalConfigRequest {
37    #[prost(string, repeated, tag = "1")]
38    pub names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
39    #[prost(string, tag = "2")]
40    pub config_path: ::prost::alloc::string::String,
41}
42#[allow(clippy::derive_partial_eq_without_eq)]
43#[derive(Clone, PartialEq, ::prost::Message)]
44pub struct LoadGlobalConfigResponse {
45    #[prost(message, repeated, tag = "1")]
46    pub items: ::prost::alloc::vec::Vec<GlobalConfigItem>,
47    #[prost(int64, tag = "2")]
48    pub revision: i64,
49}
50#[allow(clippy::derive_partial_eq_without_eq)]
51#[derive(Clone, PartialEq, ::prost::Message)]
52pub struct GlobalConfigItem {
53    #[prost(string, tag = "1")]
54    pub name: ::prost::alloc::string::String,
55    /// this field 'value' is replaced by the field 'payload'.
56    #[prost(string, tag = "2")]
57    pub value: ::prost::alloc::string::String,
58    #[prost(message, optional, tag = "3")]
59    pub error: ::core::option::Option<Error>,
60    #[prost(enumeration = "EventType", tag = "4")]
61    pub kind: i32,
62    /// Since item value needs to support marshal of different struct types,
63    /// it should be set to bytes instead of string.
64    #[prost(bytes = "vec", tag = "5")]
65    pub payload: ::prost::alloc::vec::Vec<u8>,
66}
67#[allow(clippy::derive_partial_eq_without_eq)]
68#[derive(Clone, PartialEq, ::prost::Message)]
69pub struct RequestHeader {
70    /// cluster_id is the ID of the cluster which be sent to.
71    #[prost(uint64, tag = "1")]
72    pub cluster_id: u64,
73    /// sender_id is the ID of the sender server, also member ID or etcd ID.
74    #[prost(uint64, tag = "2")]
75    pub sender_id: u64,
76}
77#[allow(clippy::derive_partial_eq_without_eq)]
78#[derive(Clone, PartialEq, ::prost::Message)]
79pub struct ResponseHeader {
80    /// cluster_id is the ID of the cluster which sent the response.
81    #[prost(uint64, tag = "1")]
82    pub cluster_id: u64,
83    #[prost(message, optional, tag = "2")]
84    pub error: ::core::option::Option<Error>,
85}
86#[allow(clippy::derive_partial_eq_without_eq)]
87#[derive(Clone, PartialEq, ::prost::Message)]
88pub struct Error {
89    #[prost(enumeration = "ErrorType", tag = "1")]
90    pub r#type: i32,
91    #[prost(string, tag = "2")]
92    pub message: ::prost::alloc::string::String,
93}
94#[allow(clippy::derive_partial_eq_without_eq)]
95#[derive(Clone, PartialEq, ::prost::Message)]
96pub struct TsoRequest {
97    #[prost(message, optional, tag = "1")]
98    pub header: ::core::option::Option<RequestHeader>,
99    #[prost(uint32, tag = "2")]
100    pub count: u32,
101    #[prost(string, tag = "3")]
102    pub dc_location: ::prost::alloc::string::String,
103}
104#[allow(clippy::derive_partial_eq_without_eq)]
105#[derive(Clone, PartialEq, ::prost::Message)]
106pub struct Timestamp {
107    #[prost(int64, tag = "1")]
108    pub physical: i64,
109    #[prost(int64, tag = "2")]
110    pub logical: i64,
111    /// Number of suffix bits used for global distinction,
112    /// PD client will use this to compute a TSO's logical part.
113    #[prost(uint32, tag = "3")]
114    pub suffix_bits: u32,
115}
116#[allow(clippy::derive_partial_eq_without_eq)]
117#[derive(Clone, PartialEq, ::prost::Message)]
118pub struct TsoResponse {
119    #[prost(message, optional, tag = "1")]
120    pub header: ::core::option::Option<ResponseHeader>,
121    #[prost(uint32, tag = "2")]
122    pub count: u32,
123    #[prost(message, optional, tag = "3")]
124    pub timestamp: ::core::option::Option<Timestamp>,
125}
126#[allow(clippy::derive_partial_eq_without_eq)]
127#[derive(Clone, PartialEq, ::prost::Message)]
128pub struct BootstrapRequest {
129    #[prost(message, optional, tag = "1")]
130    pub header: ::core::option::Option<RequestHeader>,
131    #[prost(message, optional, tag = "2")]
132    pub store: ::core::option::Option<super::metapb::Store>,
133    #[prost(message, optional, tag = "3")]
134    pub region: ::core::option::Option<super::metapb::Region>,
135}
136#[allow(clippy::derive_partial_eq_without_eq)]
137#[derive(Clone, PartialEq, ::prost::Message)]
138pub struct BootstrapResponse {
139    #[prost(message, optional, tag = "1")]
140    pub header: ::core::option::Option<ResponseHeader>,
141    #[prost(message, optional, tag = "2")]
142    pub replication_status: ::core::option::Option<
143        super::replication_modepb::ReplicationStatus,
144    >,
145}
146#[allow(clippy::derive_partial_eq_without_eq)]
147#[derive(Clone, PartialEq, ::prost::Message)]
148pub struct IsBootstrappedRequest {
149    #[prost(message, optional, tag = "1")]
150    pub header: ::core::option::Option<RequestHeader>,
151}
152#[allow(clippy::derive_partial_eq_without_eq)]
153#[derive(Clone, PartialEq, ::prost::Message)]
154pub struct IsBootstrappedResponse {
155    #[prost(message, optional, tag = "1")]
156    pub header: ::core::option::Option<ResponseHeader>,
157    #[prost(bool, tag = "2")]
158    pub bootstrapped: bool,
159}
160#[allow(clippy::derive_partial_eq_without_eq)]
161#[derive(Clone, PartialEq, ::prost::Message)]
162pub struct AllocIdRequest {
163    #[prost(message, optional, tag = "1")]
164    pub header: ::core::option::Option<RequestHeader>,
165}
166#[allow(clippy::derive_partial_eq_without_eq)]
167#[derive(Clone, PartialEq, ::prost::Message)]
168pub struct AllocIdResponse {
169    #[prost(message, optional, tag = "1")]
170    pub header: ::core::option::Option<ResponseHeader>,
171    #[prost(uint64, tag = "2")]
172    pub id: u64,
173}
174#[allow(clippy::derive_partial_eq_without_eq)]
175#[derive(Clone, PartialEq, ::prost::Message)]
176pub struct IsSnapshotRecoveringRequest {
177    #[prost(message, optional, tag = "1")]
178    pub header: ::core::option::Option<RequestHeader>,
179}
180#[allow(clippy::derive_partial_eq_without_eq)]
181#[derive(Clone, PartialEq, ::prost::Message)]
182pub struct IsSnapshotRecoveringResponse {
183    #[prost(message, optional, tag = "1")]
184    pub header: ::core::option::Option<ResponseHeader>,
185    #[prost(bool, tag = "2")]
186    pub marked: bool,
187}
188#[allow(clippy::derive_partial_eq_without_eq)]
189#[derive(Clone, PartialEq, ::prost::Message)]
190pub struct GetStoreRequest {
191    #[prost(message, optional, tag = "1")]
192    pub header: ::core::option::Option<RequestHeader>,
193    #[prost(uint64, tag = "2")]
194    pub store_id: u64,
195}
196#[allow(clippy::derive_partial_eq_without_eq)]
197#[derive(Clone, PartialEq, ::prost::Message)]
198pub struct GetStoreResponse {
199    #[prost(message, optional, tag = "1")]
200    pub header: ::core::option::Option<ResponseHeader>,
201    #[prost(message, optional, tag = "2")]
202    pub store: ::core::option::Option<super::metapb::Store>,
203    #[prost(message, optional, tag = "3")]
204    pub stats: ::core::option::Option<StoreStats>,
205}
206#[allow(clippy::derive_partial_eq_without_eq)]
207#[derive(Clone, PartialEq, ::prost::Message)]
208pub struct PutStoreRequest {
209    #[prost(message, optional, tag = "1")]
210    pub header: ::core::option::Option<RequestHeader>,
211    #[prost(message, optional, tag = "2")]
212    pub store: ::core::option::Option<super::metapb::Store>,
213}
214#[allow(clippy::derive_partial_eq_without_eq)]
215#[derive(Clone, PartialEq, ::prost::Message)]
216pub struct PutStoreResponse {
217    #[prost(message, optional, tag = "1")]
218    pub header: ::core::option::Option<ResponseHeader>,
219    #[prost(message, optional, tag = "2")]
220    pub replication_status: ::core::option::Option<
221        super::replication_modepb::ReplicationStatus,
222    >,
223}
224#[allow(clippy::derive_partial_eq_without_eq)]
225#[derive(Clone, PartialEq, ::prost::Message)]
226pub struct GetAllStoresRequest {
227    #[prost(message, optional, tag = "1")]
228    pub header: ::core::option::Option<RequestHeader>,
229    /// Do NOT return tombstone stores if set to true.
230    #[prost(bool, tag = "2")]
231    pub exclude_tombstone_stores: bool,
232}
233#[allow(clippy::derive_partial_eq_without_eq)]
234#[derive(Clone, PartialEq, ::prost::Message)]
235pub struct GetAllStoresResponse {
236    #[prost(message, optional, tag = "1")]
237    pub header: ::core::option::Option<ResponseHeader>,
238    #[prost(message, repeated, tag = "2")]
239    pub stores: ::prost::alloc::vec::Vec<super::metapb::Store>,
240}
241#[allow(clippy::derive_partial_eq_without_eq)]
242#[derive(Clone, PartialEq, ::prost::Message)]
243pub struct GetRegionRequest {
244    #[prost(message, optional, tag = "1")]
245    pub header: ::core::option::Option<RequestHeader>,
246    #[prost(bytes = "vec", tag = "2")]
247    pub region_key: ::prost::alloc::vec::Vec<u8>,
248    #[prost(bool, tag = "3")]
249    pub need_buckets: bool,
250}
251#[allow(clippy::derive_partial_eq_without_eq)]
252#[derive(Clone, PartialEq, ::prost::Message)]
253pub struct GetRegionResponse {
254    #[prost(message, optional, tag = "1")]
255    pub header: ::core::option::Option<ResponseHeader>,
256    #[prost(message, optional, tag = "2")]
257    pub region: ::core::option::Option<super::metapb::Region>,
258    #[prost(message, optional, tag = "3")]
259    pub leader: ::core::option::Option<super::metapb::Peer>,
260    /// Leader considers that these peers are down.
261    #[prost(message, repeated, tag = "5")]
262    pub down_peers: ::prost::alloc::vec::Vec<PeerStats>,
263    /// Pending peers are the peers that the leader can't consider as
264    /// working followers.
265    #[prost(message, repeated, tag = "6")]
266    pub pending_peers: ::prost::alloc::vec::Vec<super::metapb::Peer>,
267    /// buckets isn't nil if GetRegion.\* requests set need_buckets.
268    #[prost(message, optional, tag = "7")]
269    pub buckets: ::core::option::Option<super::metapb::Buckets>,
270}
271#[allow(clippy::derive_partial_eq_without_eq)]
272#[derive(Clone, PartialEq, ::prost::Message)]
273pub struct GetRegionByIdRequest {
274    #[prost(message, optional, tag = "1")]
275    pub header: ::core::option::Option<RequestHeader>,
276    #[prost(uint64, tag = "2")]
277    pub region_id: u64,
278    #[prost(bool, tag = "3")]
279    pub need_buckets: bool,
280}
281#[allow(clippy::derive_partial_eq_without_eq)]
282#[derive(Clone, PartialEq, ::prost::Message)]
283pub struct ScanRegionsRequest {
284    #[prost(message, optional, tag = "1")]
285    pub header: ::core::option::Option<RequestHeader>,
286    #[prost(bytes = "vec", tag = "2")]
287    pub start_key: ::prost::alloc::vec::Vec<u8>,
288    /// no limit when limit \<= 0.
289    #[prost(int32, tag = "3")]
290    pub limit: i32,
291    /// end_key is +inf when it is empty.
292    #[prost(bytes = "vec", tag = "4")]
293    pub end_key: ::prost::alloc::vec::Vec<u8>,
294}
295#[allow(clippy::derive_partial_eq_without_eq)]
296#[derive(Clone, PartialEq, ::prost::Message)]
297pub struct Region {
298    #[prost(message, optional, tag = "1")]
299    pub region: ::core::option::Option<super::metapb::Region>,
300    #[prost(message, optional, tag = "2")]
301    pub leader: ::core::option::Option<super::metapb::Peer>,
302    /// Leader considers that these peers are down.
303    #[prost(message, repeated, tag = "3")]
304    pub down_peers: ::prost::alloc::vec::Vec<PeerStats>,
305    /// Pending peers are the peers that the leader can't consider as
306    /// working followers.
307    #[prost(message, repeated, tag = "4")]
308    pub pending_peers: ::prost::alloc::vec::Vec<super::metapb::Peer>,
309}
310#[allow(clippy::derive_partial_eq_without_eq)]
311#[derive(Clone, PartialEq, ::prost::Message)]
312pub struct ScanRegionsResponse {
313    #[prost(message, optional, tag = "1")]
314    pub header: ::core::option::Option<ResponseHeader>,
315    /// Keep for backword compatibability.
316    #[prost(message, repeated, tag = "2")]
317    pub region_metas: ::prost::alloc::vec::Vec<super::metapb::Region>,
318    #[prost(message, repeated, tag = "3")]
319    pub leaders: ::prost::alloc::vec::Vec<super::metapb::Peer>,
320    /// Extended region info with down/pending peers.
321    #[prost(message, repeated, tag = "4")]
322    pub regions: ::prost::alloc::vec::Vec<Region>,
323}
324#[allow(clippy::derive_partial_eq_without_eq)]
325#[derive(Clone, PartialEq, ::prost::Message)]
326pub struct GetClusterConfigRequest {
327    #[prost(message, optional, tag = "1")]
328    pub header: ::core::option::Option<RequestHeader>,
329}
330#[allow(clippy::derive_partial_eq_without_eq)]
331#[derive(Clone, PartialEq, ::prost::Message)]
332pub struct GetClusterConfigResponse {
333    #[prost(message, optional, tag = "1")]
334    pub header: ::core::option::Option<ResponseHeader>,
335    #[prost(message, optional, tag = "2")]
336    pub cluster: ::core::option::Option<super::metapb::Cluster>,
337}
338#[allow(clippy::derive_partial_eq_without_eq)]
339#[derive(Clone, PartialEq, ::prost::Message)]
340pub struct PutClusterConfigRequest {
341    #[prost(message, optional, tag = "1")]
342    pub header: ::core::option::Option<RequestHeader>,
343    #[prost(message, optional, tag = "2")]
344    pub cluster: ::core::option::Option<super::metapb::Cluster>,
345}
346#[allow(clippy::derive_partial_eq_without_eq)]
347#[derive(Clone, PartialEq, ::prost::Message)]
348pub struct PutClusterConfigResponse {
349    #[prost(message, optional, tag = "1")]
350    pub header: ::core::option::Option<ResponseHeader>,
351}
352#[allow(clippy::derive_partial_eq_without_eq)]
353#[derive(Clone, PartialEq, ::prost::Message)]
354pub struct Member {
355    /// name is the name of the PD member.
356    #[prost(string, tag = "1")]
357    pub name: ::prost::alloc::string::String,
358    /// member_id is the unique id of the PD member.
359    #[prost(uint64, tag = "2")]
360    pub member_id: u64,
361    #[prost(string, repeated, tag = "3")]
362    pub peer_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
363    #[prost(string, repeated, tag = "4")]
364    pub client_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
365    #[prost(int32, tag = "5")]
366    pub leader_priority: i32,
367    #[prost(string, tag = "6")]
368    pub deploy_path: ::prost::alloc::string::String,
369    #[prost(string, tag = "7")]
370    pub binary_version: ::prost::alloc::string::String,
371    #[prost(string, tag = "8")]
372    pub git_hash: ::prost::alloc::string::String,
373    #[prost(string, tag = "9")]
374    pub dc_location: ::prost::alloc::string::String,
375}
376#[allow(clippy::derive_partial_eq_without_eq)]
377#[derive(Clone, PartialEq, ::prost::Message)]
378pub struct GetMembersRequest {
379    #[prost(message, optional, tag = "1")]
380    pub header: ::core::option::Option<RequestHeader>,
381}
382#[allow(clippy::derive_partial_eq_without_eq)]
383#[derive(Clone, PartialEq, ::prost::Message)]
384pub struct GetMembersResponse {
385    #[prost(message, optional, tag = "1")]
386    pub header: ::core::option::Option<ResponseHeader>,
387    #[prost(message, repeated, tag = "2")]
388    pub members: ::prost::alloc::vec::Vec<Member>,
389    #[prost(message, optional, tag = "3")]
390    pub leader: ::core::option::Option<Member>,
391    #[prost(message, optional, tag = "4")]
392    pub etcd_leader: ::core::option::Option<Member>,
393    #[prost(map = "string, message", tag = "5")]
394    pub tso_allocator_leaders: ::std::collections::HashMap<
395        ::prost::alloc::string::String,
396        Member,
397    >,
398}
399#[allow(clippy::derive_partial_eq_without_eq)]
400#[derive(Clone, PartialEq, ::prost::Message)]
401pub struct GetClusterInfoRequest {
402    #[prost(message, optional, tag = "1")]
403    pub header: ::core::option::Option<ResponseHeader>,
404}
405#[allow(clippy::derive_partial_eq_without_eq)]
406#[derive(Clone, PartialEq, ::prost::Message)]
407pub struct GetClusterInfoResponse {
408    #[prost(message, optional, tag = "1")]
409    pub header: ::core::option::Option<ResponseHeader>,
410    #[prost(enumeration = "ServiceMode", repeated, tag = "2")]
411    pub service_modes: ::prost::alloc::vec::Vec<i32>,
412    /// If service mode is API_SVC_MODE, this field will be set to the
413    /// registered tso service addresses.
414    #[prost(string, repeated, tag = "3")]
415    pub tso_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
416}
417#[allow(clippy::derive_partial_eq_without_eq)]
418#[derive(Clone, PartialEq, ::prost::Message)]
419pub struct PeerStats {
420    #[prost(message, optional, tag = "1")]
421    pub peer: ::core::option::Option<super::metapb::Peer>,
422    #[prost(uint64, tag = "2")]
423    pub down_seconds: u64,
424}
425#[allow(clippy::derive_partial_eq_without_eq)]
426#[derive(Clone, PartialEq, ::prost::Message)]
427pub struct RegionHeartbeatRequest {
428    #[prost(message, optional, tag = "1")]
429    pub header: ::core::option::Option<RequestHeader>,
430    #[prost(message, optional, tag = "2")]
431    pub region: ::core::option::Option<super::metapb::Region>,
432    /// Leader Peer sending the heartbeat.
433    #[prost(message, optional, tag = "3")]
434    pub leader: ::core::option::Option<super::metapb::Peer>,
435    /// Leader considers that these peers are down.
436    #[prost(message, repeated, tag = "4")]
437    pub down_peers: ::prost::alloc::vec::Vec<PeerStats>,
438    /// Pending peers are the peers that the leader can't consider as
439    /// working followers.
440    #[prost(message, repeated, tag = "5")]
441    pub pending_peers: ::prost::alloc::vec::Vec<super::metapb::Peer>,
442    /// Bytes read/written during this period.
443    #[prost(uint64, tag = "6")]
444    pub bytes_written: u64,
445    #[prost(uint64, tag = "7")]
446    pub bytes_read: u64,
447    /// Keys read/written during this period.
448    #[prost(uint64, tag = "8")]
449    pub keys_written: u64,
450    #[prost(uint64, tag = "9")]
451    pub keys_read: u64,
452    /// Approximate region size.
453    #[prost(uint64, tag = "10")]
454    pub approximate_size: u64,
455    /// Actually reported time interval
456    #[prost(message, optional, tag = "12")]
457    pub interval: ::core::option::Option<TimeInterval>,
458    /// Approximate number of keys.
459    #[prost(uint64, tag = "13")]
460    pub approximate_keys: u64,
461    /// Term is the term of raft group.
462    #[prost(uint64, tag = "14")]
463    pub term: u64,
464    #[prost(message, optional, tag = "15")]
465    pub replication_status: ::core::option::Option<
466        super::replication_modepb::RegionReplicationStatus,
467    >,
468    /// QueryStats reported write query stats, and there are read query stats in store heartbeat
469    #[prost(message, optional, tag = "16")]
470    pub query_stats: ::core::option::Option<QueryStats>,
471    /// cpu_usage is the CPU time usage of the leader region since the last heartbeat,
472    /// which is calculated by cpu_time_delta/heartbeat_reported_interval.
473    #[prost(uint64, tag = "17")]
474    pub cpu_usage: u64,
475    /// (Serverless) Approximate size of key-value pairs for billing.
476    /// It's counted on size of user key & value (excluding metadata fields), before compression, and latest versions only.
477    #[prost(uint64, tag = "18")]
478    pub approximate_kv_size: u64,
479}
480#[allow(clippy::derive_partial_eq_without_eq)]
481#[derive(Clone, PartialEq, ::prost::Message)]
482pub struct ChangePeer {
483    #[prost(message, optional, tag = "1")]
484    pub peer: ::core::option::Option<super::metapb::Peer>,
485    #[prost(enumeration = "super::eraftpb::ConfChangeType", tag = "2")]
486    pub change_type: i32,
487}
488#[allow(clippy::derive_partial_eq_without_eq)]
489#[derive(Clone, PartialEq, ::prost::Message)]
490pub struct ChangePeerV2 {
491    /// If changes is empty, it means that to exit joint state.
492    #[prost(message, repeated, tag = "1")]
493    pub changes: ::prost::alloc::vec::Vec<ChangePeer>,
494}
495#[allow(clippy::derive_partial_eq_without_eq)]
496#[derive(Clone, PartialEq, ::prost::Message)]
497pub struct TransferLeader {
498    #[prost(message, optional, tag = "1")]
499    pub peer: ::core::option::Option<super::metapb::Peer>,
500    #[prost(message, repeated, tag = "2")]
501    pub peers: ::prost::alloc::vec::Vec<super::metapb::Peer>,
502}
503#[allow(clippy::derive_partial_eq_without_eq)]
504#[derive(Clone, PartialEq, ::prost::Message)]
505pub struct Merge {
506    #[prost(message, optional, tag = "1")]
507    pub target: ::core::option::Option<super::metapb::Region>,
508}
509#[allow(clippy::derive_partial_eq_without_eq)]
510#[derive(Clone, PartialEq, ::prost::Message)]
511pub struct SplitRegion {
512    #[prost(enumeration = "CheckPolicy", tag = "1")]
513    pub policy: i32,
514    #[prost(bytes = "vec", repeated, tag = "2")]
515    pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
516}
517#[allow(clippy::derive_partial_eq_without_eq)]
518#[derive(Clone, PartialEq, ::prost::Message)]
519pub struct SwitchWitness {
520    #[prost(uint64, tag = "1")]
521    pub peer_id: u64,
522    #[prost(bool, tag = "2")]
523    pub is_witness: bool,
524}
525#[allow(clippy::derive_partial_eq_without_eq)]
526#[derive(Clone, PartialEq, ::prost::Message)]
527pub struct BatchSwitchWitness {
528    #[prost(message, repeated, tag = "1")]
529    pub switch_witnesses: ::prost::alloc::vec::Vec<SwitchWitness>,
530}
531#[allow(clippy::derive_partial_eq_without_eq)]
532#[derive(Clone, PartialEq, ::prost::Message)]
533pub struct RegionHeartbeatResponse {
534    #[prost(message, optional, tag = "1")]
535    pub header: ::core::option::Option<ResponseHeader>,
536    /// Notice, Pd only allows handling reported epoch >= current pd's.
537    /// Leader peer reports region status with RegionHeartbeatRequest
538    /// to pd regularly, pd will determine whether this region
539    /// should do ChangePeer or not.
540    /// E,g, max peer number is 3, region A, first only peer 1 in A.
541    ///
542    /// 1. Pd region state -> Peers (1), ConfVer (1).
543    /// 1. Leader peer 1 reports region state to pd, pd finds the
544    ///    peer number is \< 3, so first changes its current region
545    ///    state -> Peers (1, 2), ConfVer (1), and returns ChangePeer Adding 2.
546    /// 1. Leader does ChangePeer, then reports Peers (1, 2), ConfVer (2),
547    ///    pd updates its state -> Peers (1, 2), ConfVer (2).
548    /// 1. Leader may report old Peers (1), ConfVer (1) to pd before ConfChange
549    ///    finished, pd stills responses ChangePeer Adding 2, of course, we must
550    ///    guarantee the second ChangePeer can't be applied in TiKV.
551    #[prost(message, optional, tag = "2")]
552    pub change_peer: ::core::option::Option<ChangePeer>,
553    /// Pd can return transfer_leader to let TiKV does leader transfer itself.
554    #[prost(message, optional, tag = "3")]
555    pub transfer_leader: ::core::option::Option<TransferLeader>,
556    /// ID of the region
557    #[prost(uint64, tag = "4")]
558    pub region_id: u64,
559    #[prost(message, optional, tag = "5")]
560    pub region_epoch: ::core::option::Option<super::metapb::RegionEpoch>,
561    /// Leader of the region at the moment of the corresponding request was made.
562    #[prost(message, optional, tag = "6")]
563    pub target_peer: ::core::option::Option<super::metapb::Peer>,
564    #[prost(message, optional, tag = "7")]
565    pub merge: ::core::option::Option<Merge>,
566    /// PD sends split_region to let TiKV split a region into two regions.
567    #[prost(message, optional, tag = "8")]
568    pub split_region: ::core::option::Option<SplitRegion>,
569    /// Multiple change peer operations atomically.
570    /// Note: PD can use both ChangePeer and ChangePeerV2 at the same time
571    /// (not in the same RegionHeartbeatResponse).
572    /// Now, PD use ChangePeerV2 in following scenarios:
573    /// 1. replacing peers
574    /// 2. demoting voter directly
575    #[prost(message, optional, tag = "9")]
576    pub change_peer_v2: ::core::option::Option<ChangePeerV2>,
577    #[prost(message, optional, tag = "10")]
578    pub switch_witnesses: ::core::option::Option<BatchSwitchWitness>,
579}
580#[allow(clippy::derive_partial_eq_without_eq)]
581#[derive(Clone, PartialEq, ::prost::Message)]
582pub struct AskSplitRequest {
583    #[prost(message, optional, tag = "1")]
584    pub header: ::core::option::Option<RequestHeader>,
585    #[prost(message, optional, tag = "2")]
586    pub region: ::core::option::Option<super::metapb::Region>,
587}
588#[allow(clippy::derive_partial_eq_without_eq)]
589#[derive(Clone, PartialEq, ::prost::Message)]
590pub struct AskSplitResponse {
591    #[prost(message, optional, tag = "1")]
592    pub header: ::core::option::Option<ResponseHeader>,
593    /// We split the region into two, first uses the origin
594    /// parent region id, and the second uses the new_region_id.
595    /// We must guarantee that the new_region_id is global unique.
596    #[prost(uint64, tag = "2")]
597    pub new_region_id: u64,
598    /// The peer ids for the new split region.
599    #[prost(uint64, repeated, tag = "3")]
600    pub new_peer_ids: ::prost::alloc::vec::Vec<u64>,
601}
602#[allow(clippy::derive_partial_eq_without_eq)]
603#[derive(Clone, PartialEq, ::prost::Message)]
604pub struct ReportSplitRequest {
605    #[prost(message, optional, tag = "1")]
606    pub header: ::core::option::Option<RequestHeader>,
607    #[prost(message, optional, tag = "2")]
608    pub left: ::core::option::Option<super::metapb::Region>,
609    #[prost(message, optional, tag = "3")]
610    pub right: ::core::option::Option<super::metapb::Region>,
611}
612#[allow(clippy::derive_partial_eq_without_eq)]
613#[derive(Clone, PartialEq, ::prost::Message)]
614pub struct ReportSplitResponse {
615    #[prost(message, optional, tag = "1")]
616    pub header: ::core::option::Option<ResponseHeader>,
617}
618#[allow(clippy::derive_partial_eq_without_eq)]
619#[derive(Clone, PartialEq, ::prost::Message)]
620pub struct AskBatchSplitRequest {
621    #[prost(message, optional, tag = "1")]
622    pub header: ::core::option::Option<RequestHeader>,
623    #[prost(message, optional, tag = "2")]
624    pub region: ::core::option::Option<super::metapb::Region>,
625    #[prost(uint32, tag = "3")]
626    pub split_count: u32,
627}
628#[allow(clippy::derive_partial_eq_without_eq)]
629#[derive(Clone, PartialEq, ::prost::Message)]
630pub struct SplitId {
631    #[prost(uint64, tag = "1")]
632    pub new_region_id: u64,
633    #[prost(uint64, repeated, tag = "2")]
634    pub new_peer_ids: ::prost::alloc::vec::Vec<u64>,
635}
636#[allow(clippy::derive_partial_eq_without_eq)]
637#[derive(Clone, PartialEq, ::prost::Message)]
638pub struct AskBatchSplitResponse {
639    #[prost(message, optional, tag = "1")]
640    pub header: ::core::option::Option<ResponseHeader>,
641    #[prost(message, repeated, tag = "2")]
642    pub ids: ::prost::alloc::vec::Vec<SplitId>,
643}
644#[allow(clippy::derive_partial_eq_without_eq)]
645#[derive(Clone, PartialEq, ::prost::Message)]
646pub struct ReportBatchSplitRequest {
647    #[prost(message, optional, tag = "1")]
648    pub header: ::core::option::Option<RequestHeader>,
649    #[prost(message, repeated, tag = "2")]
650    pub regions: ::prost::alloc::vec::Vec<super::metapb::Region>,
651}
652#[allow(clippy::derive_partial_eq_without_eq)]
653#[derive(Clone, PartialEq, ::prost::Message)]
654pub struct ReportBatchSplitResponse {
655    #[prost(message, optional, tag = "1")]
656    pub header: ::core::option::Option<ResponseHeader>,
657}
658#[allow(clippy::derive_partial_eq_without_eq)]
659#[derive(Clone, PartialEq, ::prost::Message)]
660pub struct TimeInterval {
661    /// The unix timestamp in seconds of the start of this period.
662    #[prost(uint64, tag = "1")]
663    pub start_timestamp: u64,
664    /// The unix timestamp in seconds of the end of this period.
665    #[prost(uint64, tag = "2")]
666    pub end_timestamp: u64,
667}
668#[allow(clippy::derive_partial_eq_without_eq)]
669#[derive(Clone, PartialEq, ::prost::Message)]
670pub struct RecordPair {
671    #[prost(string, tag = "1")]
672    pub key: ::prost::alloc::string::String,
673    #[prost(uint64, tag = "2")]
674    pub value: u64,
675}
676#[allow(clippy::derive_partial_eq_without_eq)]
677#[derive(Clone, PartialEq, ::prost::Message)]
678pub struct PeerStat {
679    #[prost(uint64, tag = "1")]
680    pub region_id: u64,
681    #[prost(uint64, tag = "2")]
682    pub read_keys: u64,
683    #[prost(uint64, tag = "3")]
684    pub read_bytes: u64,
685    #[prost(message, optional, tag = "4")]
686    pub query_stats: ::core::option::Option<QueryStats>,
687    #[prost(uint64, tag = "5")]
688    pub written_keys: u64,
689    #[prost(uint64, tag = "6")]
690    pub written_bytes: u64,
691}
692#[allow(clippy::derive_partial_eq_without_eq)]
693#[derive(Clone, PartialEq, ::prost::Message)]
694pub struct StoreStats {
695    #[prost(uint64, tag = "1")]
696    pub store_id: u64,
697    /// Capacity for the store.
698    #[prost(uint64, tag = "2")]
699    pub capacity: u64,
700    /// Available size for the store.
701    #[prost(uint64, tag = "3")]
702    pub available: u64,
703    /// Total region count in this store.
704    #[prost(uint32, tag = "4")]
705    pub region_count: u32,
706    /// Current sending snapshot count.
707    #[prost(uint32, tag = "5")]
708    pub sending_snap_count: u32,
709    /// Current receiving snapshot count.
710    #[prost(uint32, tag = "6")]
711    pub receiving_snap_count: u32,
712    /// When the store is started (unix timestamp in seconds).
713    #[prost(uint32, tag = "7")]
714    pub start_time: u32,
715    /// How many region is applying snapshot.
716    #[prost(uint32, tag = "8")]
717    pub applying_snap_count: u32,
718    /// If the store is busy
719    #[prost(bool, tag = "9")]
720    pub is_busy: bool,
721    /// Actually used space by db
722    #[prost(uint64, tag = "10")]
723    pub used_size: u64,
724    /// Bytes written for the store during this period.
725    #[prost(uint64, tag = "11")]
726    pub bytes_written: u64,
727    /// Keys written for the store during this period.
728    #[prost(uint64, tag = "12")]
729    pub keys_written: u64,
730    /// Bytes read for the store during this period.
731    #[prost(uint64, tag = "13")]
732    pub bytes_read: u64,
733    /// Keys read for the store during this period.
734    #[prost(uint64, tag = "14")]
735    pub keys_read: u64,
736    /// Actually reported time interval
737    #[prost(message, optional, tag = "15")]
738    pub interval: ::core::option::Option<TimeInterval>,
739    /// Threads' CPU usages in the store
740    #[prost(message, repeated, tag = "16")]
741    pub cpu_usages: ::prost::alloc::vec::Vec<RecordPair>,
742    /// Threads' read disk I/O rates in the store
743    #[prost(message, repeated, tag = "17")]
744    pub read_io_rates: ::prost::alloc::vec::Vec<RecordPair>,
745    /// Threads' write disk I/O rates in the store
746    #[prost(message, repeated, tag = "18")]
747    pub write_io_rates: ::prost::alloc::vec::Vec<RecordPair>,
748    /// Operations' latencies in the store
749    #[prost(message, repeated, tag = "19")]
750    pub op_latencies: ::prost::alloc::vec::Vec<RecordPair>,
751    /// Hot peer stat in the store
752    #[prost(message, repeated, tag = "20")]
753    pub peer_stats: ::prost::alloc::vec::Vec<PeerStat>,
754    /// Store query stats
755    #[prost(message, optional, tag = "21")]
756    pub query_stats: ::core::option::Option<QueryStats>,
757    /// Score that represents the speed of the store, ranges in \[1, 100\], lower is better.
758    #[prost(uint64, tag = "22")]
759    pub slow_score: u64,
760    /// Damaged regions on the store that need to be removed by PD.
761    #[prost(uint64, repeated, tag = "23")]
762    pub damaged_regions_id: ::prost::alloc::vec::Vec<u64>,
763    /// If the apply worker is busy, namely high apply wait duration
764    #[prost(bool, tag = "24")]
765    pub is_apply_busy: bool,
766    /// Snapshot stats in the store
767    #[prost(message, repeated, tag = "25")]
768    pub snapshot_stats: ::prost::alloc::vec::Vec<SnapshotStat>,
769    #[prost(message, optional, tag = "26")]
770    pub slow_trend: ::core::option::Option<SlowTrend>,
771    /// If the grpc server is paused.
772    #[prost(bool, tag = "27")]
773    pub is_grpc_paused: bool,
774    /// Total memory of the store in bytes.
775    #[prost(uint64, tag = "28")]
776    pub total_memory: u64,
777    /// Used memory of the store in bytes.
778    #[prost(uint64, tag = "29")]
779    pub used_memory: u64,
780}
781#[allow(clippy::derive_partial_eq_without_eq)]
782#[derive(Clone, PartialEq, ::prost::Message)]
783pub struct SlowTrend {
784    #[prost(double, tag = "1")]
785    pub cause_value: f64,
786    #[prost(double, tag = "2")]
787    pub cause_rate: f64,
788    #[prost(double, tag = "3")]
789    pub result_value: f64,
790    #[prost(double, tag = "4")]
791    pub result_rate: f64,
792}
793#[allow(clippy::derive_partial_eq_without_eq)]
794#[derive(Clone, PartialEq, ::prost::Message)]
795pub struct SnapshotStat {
796    #[prost(uint64, tag = "1")]
797    pub region_id: u64,
798    /// Generate snapshot duration
799    #[prost(uint64, tag = "2")]
800    pub generate_duration_sec: u64,
801    /// Send snapshot duration
802    #[prost(uint64, tag = "3")]
803    pub send_duration_sec: u64,
804    /// \|-- waiting --|-- generate --|-- send --|
805    /// \|-----------total duration---------------|
806    /// Total duration include waiting and executing duration
807    #[prost(uint64, tag = "4")]
808    pub total_duration_sec: u64,
809    /// Size is the transport data size
810    #[prost(uint64, tag = "5")]
811    pub transport_size: u64,
812}
813#[allow(clippy::derive_partial_eq_without_eq)]
814#[derive(Clone, PartialEq, ::prost::Message)]
815pub struct PeerReport {
816    #[prost(message, optional, tag = "1")]
817    pub raft_state: ::core::option::Option<super::raft_serverpb::RaftLocalState>,
818    #[prost(message, optional, tag = "2")]
819    pub region_state: ::core::option::Option<super::raft_serverpb::RegionLocalState>,
820    #[prost(bool, tag = "3")]
821    pub is_force_leader: bool,
822    /// The peer has proposed but uncommitted commit merge.
823    #[prost(bool, tag = "4")]
824    pub has_commit_merge: bool,
825}
826#[allow(clippy::derive_partial_eq_without_eq)]
827#[derive(Clone, PartialEq, ::prost::Message)]
828pub struct StoreReport {
829    #[prost(message, repeated, tag = "1")]
830    pub peer_reports: ::prost::alloc::vec::Vec<PeerReport>,
831    #[prost(uint64, tag = "2")]
832    pub step: u64,
833}
834#[allow(clippy::derive_partial_eq_without_eq)]
835#[derive(Clone, PartialEq, ::prost::Message)]
836pub struct StoreHeartbeatRequest {
837    #[prost(message, optional, tag = "1")]
838    pub header: ::core::option::Option<RequestHeader>,
839    #[prost(message, optional, tag = "2")]
840    pub stats: ::core::option::Option<StoreStats>,
841    /// Detailed store report that is only filled up on PD's demand for online unsafe recovery.
842    #[prost(message, optional, tag = "3")]
843    pub store_report: ::core::option::Option<StoreReport>,
844    #[prost(message, optional, tag = "4")]
845    pub dr_autosync_status: ::core::option::Option<
846        super::replication_modepb::StoreDrAutoSyncStatus,
847    >,
848}
849#[allow(clippy::derive_partial_eq_without_eq)]
850#[derive(Clone, PartialEq, ::prost::Message)]
851pub struct DemoteFailedVoters {
852    #[prost(uint64, tag = "1")]
853    pub region_id: u64,
854    #[prost(message, repeated, tag = "2")]
855    pub failed_voters: ::prost::alloc::vec::Vec<super::metapb::Peer>,
856}
857#[allow(clippy::derive_partial_eq_without_eq)]
858#[derive(Clone, PartialEq, ::prost::Message)]
859pub struct ForceLeader {
860    /// The store ids of the failed stores, TiKV uses it to decide if a peer is alive.
861    #[prost(uint64, repeated, tag = "1")]
862    pub failed_stores: ::prost::alloc::vec::Vec<u64>,
863    /// The region ids of the peer which is to be force leader.
864    #[prost(uint64, repeated, tag = "2")]
865    pub enter_force_leaders: ::prost::alloc::vec::Vec<u64>,
866}
867#[allow(clippy::derive_partial_eq_without_eq)]
868#[derive(Clone, PartialEq, ::prost::Message)]
869pub struct RecoveryPlan {
870    /// Create empty regions to fill the key range hole.
871    #[prost(message, repeated, tag = "1")]
872    pub creates: ::prost::alloc::vec::Vec<super::metapb::Region>,
873    /// Update the meta of the regions, including peer lists, epoch and key range.
874    #[deprecated]
875    #[prost(message, repeated, tag = "2")]
876    pub updates: ::prost::alloc::vec::Vec<super::metapb::Region>,
877    /// Tombstone the peers on the store locally.
878    #[prost(uint64, repeated, tag = "3")]
879    pub tombstones: ::prost::alloc::vec::Vec<u64>,
880    /// Issue conf change that demote voters on failed stores to learners on the regions.
881    #[prost(message, repeated, tag = "4")]
882    pub demotes: ::prost::alloc::vec::Vec<DemoteFailedVoters>,
883    /// Make the peers to be force leaders.
884    #[prost(message, optional, tag = "5")]
885    pub force_leader: ::core::option::Option<ForceLeader>,
886    /// Step is an increasing number to note the round of recovery,
887    /// It should be filled in the corresponding store report.
888    #[prost(uint64, tag = "6")]
889    pub step: u64,
890}
891#[allow(clippy::derive_partial_eq_without_eq)]
892#[derive(Clone, PartialEq, ::prost::Message)]
893pub struct AwakenRegions {
894    /// Awake all regions if abnormal_stores is empty.
895    #[prost(uint64, repeated, tag = "1")]
896    pub abnormal_stores: ::prost::alloc::vec::Vec<u64>,
897}
898#[allow(clippy::derive_partial_eq_without_eq)]
899#[derive(Clone, PartialEq, ::prost::Message)]
900pub struct ControlGrpc {
901    #[prost(enumeration = "ControlGrpcEvent", tag = "1")]
902    pub ctrl_event: i32,
903}
904#[allow(clippy::derive_partial_eq_without_eq)]
905#[derive(Clone, PartialEq, ::prost::Message)]
906pub struct StoreHeartbeatResponse {
907    #[prost(message, optional, tag = "1")]
908    pub header: ::core::option::Option<ResponseHeader>,
909    #[prost(message, optional, tag = "2")]
910    pub replication_status: ::core::option::Option<
911        super::replication_modepb::ReplicationStatus,
912    >,
913    #[prost(string, tag = "3")]
914    pub cluster_version: ::prost::alloc::string::String,
915    /// Used by online unsafe recovery to request store report.
916    /// Now it's substituted by reusing recovery_plan field. PD will send a empty
917    /// recovery plan instead to request store report.
918    #[deprecated]
919    #[prost(bool, tag = "4")]
920    pub require_detailed_report: bool,
921    /// Operations of recovery. After the plan is executed, TiKV should attach the
922    /// store report in store heartbeat.
923    #[prost(message, optional, tag = "5")]
924    pub recovery_plan: ::core::option::Option<RecoveryPlan>,
925    /// Pd can return awaken_regions to let TiKV awaken hibernated regions itself.
926    #[prost(message, optional, tag = "6")]
927    pub awaken_regions: ::core::option::Option<AwakenRegions>,
928    /// Pd can return operations to let TiKV forcely PAUSE | RESUME grpc server.
929    #[prost(message, optional, tag = "7")]
930    pub control_grpc: ::core::option::Option<ControlGrpc>,
931}
932#[allow(clippy::derive_partial_eq_without_eq)]
933#[derive(Clone, PartialEq, ::prost::Message)]
934pub struct ScatterRegionRequest {
935    #[prost(message, optional, tag = "1")]
936    pub header: ::core::option::Option<RequestHeader>,
937    #[deprecated]
938    #[prost(uint64, tag = "2")]
939    pub region_id: u64,
940    /// PD will use these region information if it can't find the region.
941    /// For example, the region is just split and hasn't report to PD yet.
942    #[prost(message, optional, tag = "3")]
943    pub region: ::core::option::Option<super::metapb::Region>,
944    #[prost(message, optional, tag = "4")]
945    pub leader: ::core::option::Option<super::metapb::Peer>,
946    /// If group is defined, the regions with the same group would be scattered as a whole group.
947    /// If not defined, the regions would be scattered in a cluster level.
948    #[prost(string, tag = "5")]
949    pub group: ::prost::alloc::string::String,
950    /// If regions_id is defined, the region_id would be ignored.
951    #[prost(uint64, repeated, tag = "6")]
952    pub regions_id: ::prost::alloc::vec::Vec<u64>,
953    #[prost(uint64, tag = "7")]
954    pub retry_limit: u64,
955    #[prost(bool, tag = "8")]
956    pub skip_store_limit: bool,
957}
958#[allow(clippy::derive_partial_eq_without_eq)]
959#[derive(Clone, PartialEq, ::prost::Message)]
960pub struct ScatterRegionResponse {
961    #[prost(message, optional, tag = "1")]
962    pub header: ::core::option::Option<ResponseHeader>,
963    #[prost(uint64, tag = "2")]
964    pub finished_percentage: u64,
965}
966#[allow(clippy::derive_partial_eq_without_eq)]
967#[derive(Clone, PartialEq, ::prost::Message)]
968pub struct GetGcSafePointRequest {
969    #[prost(message, optional, tag = "1")]
970    pub header: ::core::option::Option<RequestHeader>,
971}
972#[allow(clippy::derive_partial_eq_without_eq)]
973#[derive(Clone, PartialEq, ::prost::Message)]
974pub struct GetGcSafePointResponse {
975    #[prost(message, optional, tag = "1")]
976    pub header: ::core::option::Option<ResponseHeader>,
977    #[prost(uint64, tag = "2")]
978    pub safe_point: u64,
979}
980#[allow(clippy::derive_partial_eq_without_eq)]
981#[derive(Clone, PartialEq, ::prost::Message)]
982pub struct UpdateGcSafePointRequest {
983    #[prost(message, optional, tag = "1")]
984    pub header: ::core::option::Option<RequestHeader>,
985    #[prost(uint64, tag = "2")]
986    pub safe_point: u64,
987}
988#[allow(clippy::derive_partial_eq_without_eq)]
989#[derive(Clone, PartialEq, ::prost::Message)]
990pub struct UpdateGcSafePointResponse {
991    #[prost(message, optional, tag = "1")]
992    pub header: ::core::option::Option<ResponseHeader>,
993    #[prost(uint64, tag = "2")]
994    pub new_safe_point: u64,
995}
996#[allow(clippy::derive_partial_eq_without_eq)]
997#[derive(Clone, PartialEq, ::prost::Message)]
998pub struct UpdateServiceGcSafePointRequest {
999    #[prost(message, optional, tag = "1")]
1000    pub header: ::core::option::Option<RequestHeader>,
1001    #[prost(bytes = "vec", tag = "2")]
1002    pub service_id: ::prost::alloc::vec::Vec<u8>,
1003    #[prost(int64, tag = "3")]
1004    pub ttl: i64,
1005    #[prost(uint64, tag = "4")]
1006    pub safe_point: u64,
1007}
1008#[allow(clippy::derive_partial_eq_without_eq)]
1009#[derive(Clone, PartialEq, ::prost::Message)]
1010pub struct UpdateServiceGcSafePointResponse {
1011    #[prost(message, optional, tag = "1")]
1012    pub header: ::core::option::Option<ResponseHeader>,
1013    #[prost(bytes = "vec", tag = "2")]
1014    pub service_id: ::prost::alloc::vec::Vec<u8>,
1015    #[prost(int64, tag = "3")]
1016    pub ttl: i64,
1017    #[prost(uint64, tag = "4")]
1018    pub min_safe_point: u64,
1019}
1020#[allow(clippy::derive_partial_eq_without_eq)]
1021#[derive(Clone, PartialEq, ::prost::Message)]
1022pub struct GetGcSafePointV2Request {
1023    #[prost(message, optional, tag = "1")]
1024    pub header: ::core::option::Option<RequestHeader>,
1025    #[prost(uint32, tag = "2")]
1026    pub keyspace_id: u32,
1027}
1028#[allow(clippy::derive_partial_eq_without_eq)]
1029#[derive(Clone, PartialEq, ::prost::Message)]
1030pub struct GetGcSafePointV2Response {
1031    #[prost(message, optional, tag = "1")]
1032    pub header: ::core::option::Option<ResponseHeader>,
1033    #[prost(uint64, tag = "2")]
1034    pub safe_point: u64,
1035}
1036#[allow(clippy::derive_partial_eq_without_eq)]
1037#[derive(Clone, PartialEq, ::prost::Message)]
1038pub struct WatchGcSafePointV2Request {
1039    #[prost(message, optional, tag = "1")]
1040    pub header: ::core::option::Option<RequestHeader>,
1041    #[prost(int64, tag = "2")]
1042    pub revision: i64,
1043}
1044/// SafePointEvent is for the rpc WatchGCSafePointV2.
1045#[allow(clippy::derive_partial_eq_without_eq)]
1046#[derive(Clone, PartialEq, ::prost::Message)]
1047pub struct SafePointEvent {
1048    #[prost(uint32, tag = "1")]
1049    pub keyspace_id: u32,
1050    #[prost(uint64, tag = "2")]
1051    pub safe_point: u64,
1052    #[prost(enumeration = "EventType", tag = "3")]
1053    pub r#type: i32,
1054}
1055#[allow(clippy::derive_partial_eq_without_eq)]
1056#[derive(Clone, PartialEq, ::prost::Message)]
1057pub struct WatchGcSafePointV2Response {
1058    #[prost(message, optional, tag = "1")]
1059    pub header: ::core::option::Option<ResponseHeader>,
1060    #[prost(message, repeated, tag = "2")]
1061    pub events: ::prost::alloc::vec::Vec<SafePointEvent>,
1062    #[prost(int64, tag = "3")]
1063    pub revision: i64,
1064}
1065#[allow(clippy::derive_partial_eq_without_eq)]
1066#[derive(Clone, PartialEq, ::prost::Message)]
1067pub struct UpdateGcSafePointV2Request {
1068    #[prost(message, optional, tag = "1")]
1069    pub header: ::core::option::Option<RequestHeader>,
1070    #[prost(uint32, tag = "2")]
1071    pub keyspace_id: u32,
1072    #[prost(uint64, tag = "3")]
1073    pub safe_point: u64,
1074}
1075#[allow(clippy::derive_partial_eq_without_eq)]
1076#[derive(Clone, PartialEq, ::prost::Message)]
1077pub struct UpdateGcSafePointV2Response {
1078    #[prost(message, optional, tag = "1")]
1079    pub header: ::core::option::Option<ResponseHeader>,
1080    #[prost(uint64, tag = "2")]
1081    pub new_safe_point: u64,
1082}
1083#[allow(clippy::derive_partial_eq_without_eq)]
1084#[derive(Clone, PartialEq, ::prost::Message)]
1085pub struct UpdateServiceSafePointV2Request {
1086    #[prost(message, optional, tag = "1")]
1087    pub header: ::core::option::Option<RequestHeader>,
1088    #[prost(uint32, tag = "2")]
1089    pub keyspace_id: u32,
1090    #[prost(bytes = "vec", tag = "3")]
1091    pub service_id: ::prost::alloc::vec::Vec<u8>,
1092    #[prost(uint64, tag = "4")]
1093    pub safe_point: u64,
1094    /// Safe point will be set to expire on (PD Server time + TTL),
1095    /// pass in a ttl \< 0 to remove target safe point;
1096    /// pass in MAX_INT64 to set a safe point that never expire.
1097    /// This should be set by component that may crash unexpectedly so that it doesn't block
1098    /// cluster garbage collection.
1099    #[prost(int64, tag = "5")]
1100    pub ttl: i64,
1101}
1102#[allow(clippy::derive_partial_eq_without_eq)]
1103#[derive(Clone, PartialEq, ::prost::Message)]
1104pub struct UpdateServiceSafePointV2Response {
1105    #[prost(message, optional, tag = "1")]
1106    pub header: ::core::option::Option<ResponseHeader>,
1107    #[prost(bytes = "vec", tag = "2")]
1108    pub service_id: ::prost::alloc::vec::Vec<u8>,
1109    #[prost(int64, tag = "3")]
1110    pub ttl: i64,
1111    #[prost(uint64, tag = "4")]
1112    pub min_safe_point: u64,
1113}
1114#[allow(clippy::derive_partial_eq_without_eq)]
1115#[derive(Clone, PartialEq, ::prost::Message)]
1116pub struct GetAllGcSafePointV2Request {
1117    #[prost(message, optional, tag = "1")]
1118    pub header: ::core::option::Option<RequestHeader>,
1119}
1120#[allow(clippy::derive_partial_eq_without_eq)]
1121#[derive(Clone, PartialEq, ::prost::Message)]
1122pub struct GcSafePointV2 {
1123    #[prost(uint32, tag = "1")]
1124    pub keyspace_id: u32,
1125    #[prost(uint64, tag = "2")]
1126    pub gc_safe_point: u64,
1127}
1128#[allow(clippy::derive_partial_eq_without_eq)]
1129#[derive(Clone, PartialEq, ::prost::Message)]
1130pub struct GetAllGcSafePointV2Response {
1131    #[prost(message, optional, tag = "1")]
1132    pub header: ::core::option::Option<ResponseHeader>,
1133    #[prost(message, repeated, tag = "2")]
1134    pub gc_safe_points: ::prost::alloc::vec::Vec<GcSafePointV2>,
1135    #[prost(int64, tag = "3")]
1136    pub revision: i64,
1137}
1138#[allow(clippy::derive_partial_eq_without_eq)]
1139#[derive(Clone, PartialEq, ::prost::Message)]
1140pub struct RegionStat {
1141    /// Bytes read/written during this period.
1142    #[prost(uint64, tag = "1")]
1143    pub bytes_written: u64,
1144    #[prost(uint64, tag = "2")]
1145    pub bytes_read: u64,
1146    /// Keys read/written during this period.
1147    #[prost(uint64, tag = "3")]
1148    pub keys_written: u64,
1149    #[prost(uint64, tag = "4")]
1150    pub keys_read: u64,
1151}
1152#[allow(clippy::derive_partial_eq_without_eq)]
1153#[derive(Clone, PartialEq, ::prost::Message)]
1154pub struct SyncRegionRequest {
1155    #[prost(message, optional, tag = "1")]
1156    pub header: ::core::option::Option<RequestHeader>,
1157    #[prost(message, optional, tag = "2")]
1158    pub member: ::core::option::Option<Member>,
1159    /// the follower PD will use the start index to locate historical changes
1160    /// that require synchronization.
1161    #[prost(uint64, tag = "3")]
1162    pub start_index: u64,
1163}
1164#[allow(clippy::derive_partial_eq_without_eq)]
1165#[derive(Clone, PartialEq, ::prost::Message)]
1166pub struct PeersStats {
1167    #[prost(message, repeated, tag = "1")]
1168    pub peers: ::prost::alloc::vec::Vec<PeerStats>,
1169}
1170#[allow(clippy::derive_partial_eq_without_eq)]
1171#[derive(Clone, PartialEq, ::prost::Message)]
1172pub struct Peers {
1173    #[prost(message, repeated, tag = "1")]
1174    pub peers: ::prost::alloc::vec::Vec<super::metapb::Peer>,
1175}
1176#[allow(clippy::derive_partial_eq_without_eq)]
1177#[derive(Clone, PartialEq, ::prost::Message)]
1178pub struct SyncRegionResponse {
1179    #[prost(message, optional, tag = "1")]
1180    pub header: ::core::option::Option<ResponseHeader>,
1181    /// the leader PD will send the repsonds include
1182    /// changed regions records and the index of the first record.
1183    #[prost(message, repeated, tag = "2")]
1184    pub regions: ::prost::alloc::vec::Vec<super::metapb::Region>,
1185    #[prost(uint64, tag = "3")]
1186    pub start_index: u64,
1187    #[prost(message, repeated, tag = "4")]
1188    pub region_stats: ::prost::alloc::vec::Vec<RegionStat>,
1189    #[prost(message, repeated, tag = "5")]
1190    pub region_leaders: ::prost::alloc::vec::Vec<super::metapb::Peer>,
1191    /// the buckets informations without stats.
1192    #[prost(message, repeated, tag = "6")]
1193    pub buckets: ::prost::alloc::vec::Vec<super::metapb::Buckets>,
1194    #[prost(message, repeated, tag = "16")]
1195    pub down_peers: ::prost::alloc::vec::Vec<PeersStats>,
1196    #[prost(message, repeated, tag = "17")]
1197    pub pending_peers: ::prost::alloc::vec::Vec<Peers>,
1198}
1199#[allow(clippy::derive_partial_eq_without_eq)]
1200#[derive(Clone, PartialEq, ::prost::Message)]
1201pub struct GetOperatorRequest {
1202    #[prost(message, optional, tag = "1")]
1203    pub header: ::core::option::Option<RequestHeader>,
1204    #[prost(uint64, tag = "2")]
1205    pub region_id: u64,
1206}
1207#[allow(clippy::derive_partial_eq_without_eq)]
1208#[derive(Clone, PartialEq, ::prost::Message)]
1209pub struct GetOperatorResponse {
1210    #[prost(message, optional, tag = "1")]
1211    pub header: ::core::option::Option<ResponseHeader>,
1212    #[prost(uint64, tag = "2")]
1213    pub region_id: u64,
1214    #[prost(bytes = "vec", tag = "3")]
1215    pub desc: ::prost::alloc::vec::Vec<u8>,
1216    #[prost(enumeration = "OperatorStatus", tag = "4")]
1217    pub status: i32,
1218    #[prost(bytes = "vec", tag = "5")]
1219    pub kind: ::prost::alloc::vec::Vec<u8>,
1220}
1221#[allow(clippy::derive_partial_eq_without_eq)]
1222#[derive(Clone, PartialEq, ::prost::Message)]
1223pub struct SyncMaxTsRequest {
1224    #[prost(message, optional, tag = "1")]
1225    pub header: ::core::option::Option<RequestHeader>,
1226    #[prost(message, optional, tag = "2")]
1227    pub max_ts: ::core::option::Option<Timestamp>,
1228    /// If skip_check is true, the sync will try to write the max_ts without checking whether it's bigger.
1229    #[prost(bool, tag = "3")]
1230    pub skip_check: bool,
1231}
1232#[allow(clippy::derive_partial_eq_without_eq)]
1233#[derive(Clone, PartialEq, ::prost::Message)]
1234pub struct SyncMaxTsResponse {
1235    #[prost(message, optional, tag = "1")]
1236    pub header: ::core::option::Option<ResponseHeader>,
1237    #[prost(message, optional, tag = "2")]
1238    pub max_local_ts: ::core::option::Option<Timestamp>,
1239    #[prost(string, repeated, tag = "3")]
1240    pub synced_dcs: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1241}
1242#[allow(clippy::derive_partial_eq_without_eq)]
1243#[derive(Clone, PartialEq, ::prost::Message)]
1244pub struct SplitRegionsRequest {
1245    #[prost(message, optional, tag = "1")]
1246    pub header: ::core::option::Option<RequestHeader>,
1247    #[prost(bytes = "vec", repeated, tag = "2")]
1248    pub split_keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
1249    #[prost(uint64, tag = "3")]
1250    pub retry_limit: u64,
1251}
1252#[allow(clippy::derive_partial_eq_without_eq)]
1253#[derive(Clone, PartialEq, ::prost::Message)]
1254pub struct SplitRegionsResponse {
1255    #[prost(message, optional, tag = "1")]
1256    pub header: ::core::option::Option<ResponseHeader>,
1257    #[prost(uint64, tag = "2")]
1258    pub finished_percentage: u64,
1259    #[prost(uint64, repeated, tag = "3")]
1260    pub regions_id: ::prost::alloc::vec::Vec<u64>,
1261}
1262#[allow(clippy::derive_partial_eq_without_eq)]
1263#[derive(Clone, PartialEq, ::prost::Message)]
1264pub struct SplitAndScatterRegionsRequest {
1265    #[prost(message, optional, tag = "1")]
1266    pub header: ::core::option::Option<RequestHeader>,
1267    #[prost(bytes = "vec", repeated, tag = "2")]
1268    pub split_keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
1269    #[prost(string, tag = "3")]
1270    pub group: ::prost::alloc::string::String,
1271    #[prost(uint64, tag = "4")]
1272    pub retry_limit: u64,
1273}
1274#[allow(clippy::derive_partial_eq_without_eq)]
1275#[derive(Clone, PartialEq, ::prost::Message)]
1276pub struct SplitAndScatterRegionsResponse {
1277    #[prost(message, optional, tag = "1")]
1278    pub header: ::core::option::Option<ResponseHeader>,
1279    #[prost(uint64, tag = "2")]
1280    pub split_finished_percentage: u64,
1281    #[prost(uint64, tag = "3")]
1282    pub scatter_finished_percentage: u64,
1283    #[prost(uint64, repeated, tag = "4")]
1284    pub regions_id: ::prost::alloc::vec::Vec<u64>,
1285}
1286#[allow(clippy::derive_partial_eq_without_eq)]
1287#[derive(Clone, PartialEq, ::prost::Message)]
1288pub struct GetDcLocationInfoRequest {
1289    #[prost(message, optional, tag = "1")]
1290    pub header: ::core::option::Option<RequestHeader>,
1291    #[prost(string, tag = "2")]
1292    pub dc_location: ::prost::alloc::string::String,
1293}
1294#[allow(clippy::derive_partial_eq_without_eq)]
1295#[derive(Clone, PartialEq, ::prost::Message)]
1296pub struct GetDcLocationInfoResponse {
1297    #[prost(message, optional, tag = "1")]
1298    pub header: ::core::option::Option<ResponseHeader>,
1299    /// suffix sign
1300    #[prost(int32, tag = "2")]
1301    pub suffix: i32,
1302    /// max_ts will be included into this response if PD leader think the receiver needs,
1303    /// which it's set when the number of the max suffix bits changes.
1304    #[prost(message, optional, tag = "3")]
1305    pub max_ts: ::core::option::Option<Timestamp>,
1306}
1307#[allow(clippy::derive_partial_eq_without_eq)]
1308#[derive(Clone, PartialEq, ::prost::Message)]
1309pub struct QueryStats {
1310    #[prost(uint64, tag = "1")]
1311    pub gc: u64,
1312    #[prost(uint64, tag = "2")]
1313    pub get: u64,
1314    #[prost(uint64, tag = "3")]
1315    pub scan: u64,
1316    #[prost(uint64, tag = "4")]
1317    pub coprocessor: u64,
1318    #[prost(uint64, tag = "5")]
1319    pub delete: u64,
1320    #[prost(uint64, tag = "6")]
1321    pub delete_range: u64,
1322    #[prost(uint64, tag = "7")]
1323    pub put: u64,
1324    #[prost(uint64, tag = "8")]
1325    pub prewrite: u64,
1326    #[prost(uint64, tag = "9")]
1327    pub acquire_pessimistic_lock: u64,
1328    #[prost(uint64, tag = "10")]
1329    pub commit: u64,
1330    #[prost(uint64, tag = "11")]
1331    pub rollback: u64,
1332}
1333#[allow(clippy::derive_partial_eq_without_eq)]
1334#[derive(Clone, PartialEq, ::prost::Message)]
1335pub struct ReportBucketsRequest {
1336    #[prost(message, optional, tag = "1")]
1337    pub header: ::core::option::Option<RequestHeader>,
1338    #[prost(message, optional, tag = "2")]
1339    pub region_epoch: ::core::option::Option<super::metapb::RegionEpoch>,
1340    #[prost(message, optional, tag = "3")]
1341    pub buckets: ::core::option::Option<super::metapb::Buckets>,
1342}
1343#[allow(clippy::derive_partial_eq_without_eq)]
1344#[derive(Clone, PartialEq, ::prost::Message)]
1345pub struct ReportBucketsResponse {
1346    #[prost(message, optional, tag = "1")]
1347    pub header: ::core::option::Option<ResponseHeader>,
1348}
1349#[allow(clippy::derive_partial_eq_without_eq)]
1350#[derive(Clone, PartialEq, ::prost::Message)]
1351pub struct ReportMinResolvedTsRequest {
1352    #[prost(message, optional, tag = "1")]
1353    pub header: ::core::option::Option<RequestHeader>,
1354    #[prost(uint64, tag = "2")]
1355    pub store_id: u64,
1356    #[prost(uint64, tag = "3")]
1357    pub min_resolved_ts: u64,
1358}
1359#[allow(clippy::derive_partial_eq_without_eq)]
1360#[derive(Clone, PartialEq, ::prost::Message)]
1361pub struct ReportMinResolvedTsResponse {
1362    #[prost(message, optional, tag = "1")]
1363    pub header: ::core::option::Option<ResponseHeader>,
1364}
1365#[allow(clippy::derive_partial_eq_without_eq)]
1366#[derive(Clone, PartialEq, ::prost::Message)]
1367pub struct SetExternalTimestampRequest {
1368    #[prost(message, optional, tag = "1")]
1369    pub header: ::core::option::Option<RequestHeader>,
1370    #[prost(uint64, tag = "2")]
1371    pub timestamp: u64,
1372}
1373#[allow(clippy::derive_partial_eq_without_eq)]
1374#[derive(Clone, PartialEq, ::prost::Message)]
1375pub struct SetExternalTimestampResponse {
1376    #[prost(message, optional, tag = "1")]
1377    pub header: ::core::option::Option<ResponseHeader>,
1378}
1379#[allow(clippy::derive_partial_eq_without_eq)]
1380#[derive(Clone, PartialEq, ::prost::Message)]
1381pub struct GetExternalTimestampRequest {
1382    #[prost(message, optional, tag = "1")]
1383    pub header: ::core::option::Option<RequestHeader>,
1384}
1385#[allow(clippy::derive_partial_eq_without_eq)]
1386#[derive(Clone, PartialEq, ::prost::Message)]
1387pub struct GetExternalTimestampResponse {
1388    #[prost(message, optional, tag = "1")]
1389    pub header: ::core::option::Option<ResponseHeader>,
1390    #[prost(uint64, tag = "2")]
1391    pub timestamp: u64,
1392}
1393#[allow(clippy::derive_partial_eq_without_eq)]
1394#[derive(Clone, PartialEq, ::prost::Message)]
1395pub struct GetMinTsRequest {
1396    #[prost(message, optional, tag = "1")]
1397    pub header: ::core::option::Option<RequestHeader>,
1398}
1399#[allow(clippy::derive_partial_eq_without_eq)]
1400#[derive(Clone, PartialEq, ::prost::Message)]
1401pub struct GetMinTsResponse {
1402    #[prost(message, optional, tag = "1")]
1403    pub header: ::core::option::Option<ResponseHeader>,
1404    #[prost(message, optional, tag = "2")]
1405    pub timestamp: ::core::option::Option<Timestamp>,
1406}
1407#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1408#[repr(i32)]
1409pub enum EventType {
1410    Put = 0,
1411    Delete = 1,
1412}
1413impl EventType {
1414    /// String value of the enum field names used in the ProtoBuf definition.
1415    ///
1416    /// The values are not transformed in any way and thus are considered stable
1417    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1418    pub fn as_str_name(&self) -> &'static str {
1419        match self {
1420            EventType::Put => "PUT",
1421            EventType::Delete => "DELETE",
1422        }
1423    }
1424    /// Creates an enum from field names used in the ProtoBuf definition.
1425    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1426        match value {
1427            "PUT" => Some(Self::Put),
1428            "DELETE" => Some(Self::Delete),
1429            _ => None,
1430        }
1431    }
1432}
1433#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1434#[repr(i32)]
1435pub enum ErrorType {
1436    Ok = 0,
1437    Unknown = 1,
1438    NotBootstrapped = 2,
1439    StoreTombstone = 3,
1440    AlreadyBootstrapped = 4,
1441    IncompatibleVersion = 5,
1442    RegionNotFound = 6,
1443    GlobalConfigNotFound = 7,
1444    DuplicatedEntry = 8,
1445    EntryNotFound = 9,
1446    InvalidValue = 10,
1447    /// required watch revision is smaller than current compact/min revision.
1448    DataCompacted = 11,
1449}
1450impl ErrorType {
1451    /// String value of the enum field names used in the ProtoBuf definition.
1452    ///
1453    /// The values are not transformed in any way and thus are considered stable
1454    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1455    pub fn as_str_name(&self) -> &'static str {
1456        match self {
1457            ErrorType::Ok => "OK",
1458            ErrorType::Unknown => "UNKNOWN",
1459            ErrorType::NotBootstrapped => "NOT_BOOTSTRAPPED",
1460            ErrorType::StoreTombstone => "STORE_TOMBSTONE",
1461            ErrorType::AlreadyBootstrapped => "ALREADY_BOOTSTRAPPED",
1462            ErrorType::IncompatibleVersion => "INCOMPATIBLE_VERSION",
1463            ErrorType::RegionNotFound => "REGION_NOT_FOUND",
1464            ErrorType::GlobalConfigNotFound => "GLOBAL_CONFIG_NOT_FOUND",
1465            ErrorType::DuplicatedEntry => "DUPLICATED_ENTRY",
1466            ErrorType::EntryNotFound => "ENTRY_NOT_FOUND",
1467            ErrorType::InvalidValue => "INVALID_VALUE",
1468            ErrorType::DataCompacted => "DATA_COMPACTED",
1469        }
1470    }
1471    /// Creates an enum from field names used in the ProtoBuf definition.
1472    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1473        match value {
1474            "OK" => Some(Self::Ok),
1475            "UNKNOWN" => Some(Self::Unknown),
1476            "NOT_BOOTSTRAPPED" => Some(Self::NotBootstrapped),
1477            "STORE_TOMBSTONE" => Some(Self::StoreTombstone),
1478            "ALREADY_BOOTSTRAPPED" => Some(Self::AlreadyBootstrapped),
1479            "INCOMPATIBLE_VERSION" => Some(Self::IncompatibleVersion),
1480            "REGION_NOT_FOUND" => Some(Self::RegionNotFound),
1481            "GLOBAL_CONFIG_NOT_FOUND" => Some(Self::GlobalConfigNotFound),
1482            "DUPLICATED_ENTRY" => Some(Self::DuplicatedEntry),
1483            "ENTRY_NOT_FOUND" => Some(Self::EntryNotFound),
1484            "INVALID_VALUE" => Some(Self::InvalidValue),
1485            "DATA_COMPACTED" => Some(Self::DataCompacted),
1486            _ => None,
1487        }
1488    }
1489}
1490#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1491#[repr(i32)]
1492pub enum ServiceMode {
1493    UnknownSvcMode = 0,
1494    PdSvcMode = 1,
1495    ApiSvcMode = 2,
1496}
1497impl ServiceMode {
1498    /// String value of the enum field names used in the ProtoBuf definition.
1499    ///
1500    /// The values are not transformed in any way and thus are considered stable
1501    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1502    pub fn as_str_name(&self) -> &'static str {
1503        match self {
1504            ServiceMode::UnknownSvcMode => "UNKNOWN_SVC_MODE",
1505            ServiceMode::PdSvcMode => "PD_SVC_MODE",
1506            ServiceMode::ApiSvcMode => "API_SVC_MODE",
1507        }
1508    }
1509    /// Creates an enum from field names used in the ProtoBuf definition.
1510    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1511        match value {
1512            "UNKNOWN_SVC_MODE" => Some(Self::UnknownSvcMode),
1513            "PD_SVC_MODE" => Some(Self::PdSvcMode),
1514            "API_SVC_MODE" => Some(Self::ApiSvcMode),
1515            _ => None,
1516        }
1517    }
1518}
1519#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1520#[repr(i32)]
1521pub enum CheckPolicy {
1522    Scan = 0,
1523    Approximate = 1,
1524    Usekey = 2,
1525}
1526impl CheckPolicy {
1527    /// String value of the enum field names used in the ProtoBuf definition.
1528    ///
1529    /// The values are not transformed in any way and thus are considered stable
1530    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1531    pub fn as_str_name(&self) -> &'static str {
1532        match self {
1533            CheckPolicy::Scan => "SCAN",
1534            CheckPolicy::Approximate => "APPROXIMATE",
1535            CheckPolicy::Usekey => "USEKEY",
1536        }
1537    }
1538    /// Creates an enum from field names used in the ProtoBuf definition.
1539    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1540        match value {
1541            "SCAN" => Some(Self::Scan),
1542            "APPROXIMATE" => Some(Self::Approximate),
1543            "USEKEY" => Some(Self::Usekey),
1544            _ => None,
1545        }
1546    }
1547}
1548#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1549#[repr(i32)]
1550pub enum ControlGrpcEvent {
1551    /// Pause TiKV grpc server.
1552    Pause = 0,
1553    /// Resume TiKV grpc server.
1554    Resume = 1,
1555}
1556impl ControlGrpcEvent {
1557    /// String value of the enum field names used in the ProtoBuf definition.
1558    ///
1559    /// The values are not transformed in any way and thus are considered stable
1560    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1561    pub fn as_str_name(&self) -> &'static str {
1562        match self {
1563            ControlGrpcEvent::Pause => "PAUSE",
1564            ControlGrpcEvent::Resume => "RESUME",
1565        }
1566    }
1567    /// Creates an enum from field names used in the ProtoBuf definition.
1568    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1569        match value {
1570            "PAUSE" => Some(Self::Pause),
1571            "RESUME" => Some(Self::Resume),
1572            _ => None,
1573        }
1574    }
1575}
1576#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1577#[repr(i32)]
1578pub enum OperatorStatus {
1579    Success = 0,
1580    Timeout = 1,
1581    Cancel = 2,
1582    Replace = 3,
1583    Running = 4,
1584}
1585impl OperatorStatus {
1586    /// String value of the enum field names used in the ProtoBuf definition.
1587    ///
1588    /// The values are not transformed in any way and thus are considered stable
1589    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1590    pub fn as_str_name(&self) -> &'static str {
1591        match self {
1592            OperatorStatus::Success => "SUCCESS",
1593            OperatorStatus::Timeout => "TIMEOUT",
1594            OperatorStatus::Cancel => "CANCEL",
1595            OperatorStatus::Replace => "REPLACE",
1596            OperatorStatus::Running => "RUNNING",
1597        }
1598    }
1599    /// Creates an enum from field names used in the ProtoBuf definition.
1600    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1601        match value {
1602            "SUCCESS" => Some(Self::Success),
1603            "TIMEOUT" => Some(Self::Timeout),
1604            "CANCEL" => Some(Self::Cancel),
1605            "REPLACE" => Some(Self::Replace),
1606            "RUNNING" => Some(Self::Running),
1607            _ => None,
1608        }
1609    }
1610}
1611#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
1612#[repr(i32)]
1613pub enum QueryKind {
1614    Others = 0,
1615    Gc = 1,
1616    Get = 2,
1617    Scan = 3,
1618    Coprocessor = 4,
1619    Delete = 5,
1620    DeleteRange = 6,
1621    Put = 7,
1622    Prewrite = 8,
1623    AcquirePessimisticLock = 9,
1624    Commit = 10,
1625    Rollback = 11,
1626}
1627impl QueryKind {
1628    /// String value of the enum field names used in the ProtoBuf definition.
1629    ///
1630    /// The values are not transformed in any way and thus are considered stable
1631    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
1632    pub fn as_str_name(&self) -> &'static str {
1633        match self {
1634            QueryKind::Others => "Others",
1635            QueryKind::Gc => "GC",
1636            QueryKind::Get => "Get",
1637            QueryKind::Scan => "Scan",
1638            QueryKind::Coprocessor => "Coprocessor",
1639            QueryKind::Delete => "Delete",
1640            QueryKind::DeleteRange => "DeleteRange",
1641            QueryKind::Put => "Put",
1642            QueryKind::Prewrite => "Prewrite",
1643            QueryKind::AcquirePessimisticLock => "AcquirePessimisticLock",
1644            QueryKind::Commit => "Commit",
1645            QueryKind::Rollback => "Rollback",
1646        }
1647    }
1648    /// Creates an enum from field names used in the ProtoBuf definition.
1649    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
1650        match value {
1651            "Others" => Some(Self::Others),
1652            "GC" => Some(Self::Gc),
1653            "Get" => Some(Self::Get),
1654            "Scan" => Some(Self::Scan),
1655            "Coprocessor" => Some(Self::Coprocessor),
1656            "Delete" => Some(Self::Delete),
1657            "DeleteRange" => Some(Self::DeleteRange),
1658            "Put" => Some(Self::Put),
1659            "Prewrite" => Some(Self::Prewrite),
1660            "AcquirePessimisticLock" => Some(Self::AcquirePessimisticLock),
1661            "Commit" => Some(Self::Commit),
1662            "Rollback" => Some(Self::Rollback),
1663            _ => None,
1664        }
1665    }
1666}
1667/// Generated client implementations.
1668pub mod pd_client {
1669    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
1670    use tonic::codegen::*;
1671    use tonic::codegen::http::Uri;
1672    #[derive(Debug, Clone)]
1673    pub struct PdClient<T> {
1674        inner: tonic::client::Grpc<T>,
1675    }
1676    impl PdClient<tonic::transport::Channel> {
1677        /// Attempt to create a new client by connecting to a given endpoint.
1678        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1679        where
1680            D: TryInto<tonic::transport::Endpoint>,
1681            D::Error: Into<StdError>,
1682        {
1683            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1684            Ok(Self::new(conn))
1685        }
1686    }
1687    impl<T> PdClient<T>
1688    where
1689        T: tonic::client::GrpcService<tonic::body::BoxBody>,
1690        T::Error: Into<StdError>,
1691        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
1692        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
1693    {
1694        pub fn new(inner: T) -> Self {
1695            let inner = tonic::client::Grpc::new(inner);
1696            Self { inner }
1697        }
1698        pub fn with_origin(inner: T, origin: Uri) -> Self {
1699            let inner = tonic::client::Grpc::with_origin(inner, origin);
1700            Self { inner }
1701        }
1702        pub fn with_interceptor<F>(
1703            inner: T,
1704            interceptor: F,
1705        ) -> PdClient<InterceptedService<T, F>>
1706        where
1707            F: tonic::service::Interceptor,
1708            T::ResponseBody: Default,
1709            T: tonic::codegen::Service<
1710                http::Request<tonic::body::BoxBody>,
1711                Response = http::Response<
1712                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1713                >,
1714            >,
1715            <T as tonic::codegen::Service<
1716                http::Request<tonic::body::BoxBody>,
1717            >>::Error: Into<StdError> + Send + Sync,
1718        {
1719            PdClient::new(InterceptedService::new(inner, interceptor))
1720        }
1721        /// Compress requests with the given encoding.
1722        ///
1723        /// This requires the server to support it otherwise it might respond with an
1724        /// error.
1725        #[must_use]
1726        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1727            self.inner = self.inner.send_compressed(encoding);
1728            self
1729        }
1730        /// Enable decompressing responses.
1731        #[must_use]
1732        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1733            self.inner = self.inner.accept_compressed(encoding);
1734            self
1735        }
1736        /// Limits the maximum size of a decoded message.
1737        ///
1738        /// Default: `4MB`
1739        #[must_use]
1740        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1741            self.inner = self.inner.max_decoding_message_size(limit);
1742            self
1743        }
1744        /// Limits the maximum size of an encoded message.
1745        ///
1746        /// Default: `usize::MAX`
1747        #[must_use]
1748        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1749            self.inner = self.inner.max_encoding_message_size(limit);
1750            self
1751        }
1752        /// GetClusterInfo get the information of this cluster. It does not require
1753        /// the cluster_id in request matchs the id of this cluster.
1754        pub async fn get_cluster_info(
1755            &mut self,
1756            request: impl tonic::IntoRequest<super::GetClusterInfoRequest>,
1757        ) -> std::result::Result<
1758            tonic::Response<super::GetClusterInfoResponse>,
1759            tonic::Status,
1760        > {
1761            self.inner
1762                .ready()
1763                .await
1764                .map_err(|e| {
1765                    tonic::Status::new(
1766                        tonic::Code::Unknown,
1767                        format!("Service was not ready: {}", e.into()),
1768                    )
1769                })?;
1770            let codec = tonic::codec::ProstCodec::default();
1771            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetClusterInfo");
1772            let mut req = request.into_request();
1773            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetClusterInfo"));
1774            self.inner.unary(req, path, codec).await
1775        }
1776        /// GetMembers get the member list of this cluster. It does not require
1777        /// the cluster_id in request matchs the id of this cluster.
1778        pub async fn get_members(
1779            &mut self,
1780            request: impl tonic::IntoRequest<super::GetMembersRequest>,
1781        ) -> std::result::Result<
1782            tonic::Response<super::GetMembersResponse>,
1783            tonic::Status,
1784        > {
1785            self.inner
1786                .ready()
1787                .await
1788                .map_err(|e| {
1789                    tonic::Status::new(
1790                        tonic::Code::Unknown,
1791                        format!("Service was not ready: {}", e.into()),
1792                    )
1793                })?;
1794            let codec = tonic::codec::ProstCodec::default();
1795            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetMembers");
1796            let mut req = request.into_request();
1797            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetMembers"));
1798            self.inner.unary(req, path, codec).await
1799        }
1800        pub async fn tso(
1801            &mut self,
1802            request: impl tonic::IntoStreamingRequest<Message = super::TsoRequest>,
1803        ) -> std::result::Result<
1804            tonic::Response<tonic::codec::Streaming<super::TsoResponse>>,
1805            tonic::Status,
1806        > {
1807            self.inner
1808                .ready()
1809                .await
1810                .map_err(|e| {
1811                    tonic::Status::new(
1812                        tonic::Code::Unknown,
1813                        format!("Service was not ready: {}", e.into()),
1814                    )
1815                })?;
1816            let codec = tonic::codec::ProstCodec::default();
1817            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/Tso");
1818            let mut req = request.into_streaming_request();
1819            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "Tso"));
1820            self.inner.streaming(req, path, codec).await
1821        }
1822        pub async fn bootstrap(
1823            &mut self,
1824            request: impl tonic::IntoRequest<super::BootstrapRequest>,
1825        ) -> std::result::Result<
1826            tonic::Response<super::BootstrapResponse>,
1827            tonic::Status,
1828        > {
1829            self.inner
1830                .ready()
1831                .await
1832                .map_err(|e| {
1833                    tonic::Status::new(
1834                        tonic::Code::Unknown,
1835                        format!("Service was not ready: {}", e.into()),
1836                    )
1837                })?;
1838            let codec = tonic::codec::ProstCodec::default();
1839            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/Bootstrap");
1840            let mut req = request.into_request();
1841            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "Bootstrap"));
1842            self.inner.unary(req, path, codec).await
1843        }
1844        pub async fn is_bootstrapped(
1845            &mut self,
1846            request: impl tonic::IntoRequest<super::IsBootstrappedRequest>,
1847        ) -> std::result::Result<
1848            tonic::Response<super::IsBootstrappedResponse>,
1849            tonic::Status,
1850        > {
1851            self.inner
1852                .ready()
1853                .await
1854                .map_err(|e| {
1855                    tonic::Status::new(
1856                        tonic::Code::Unknown,
1857                        format!("Service was not ready: {}", e.into()),
1858                    )
1859                })?;
1860            let codec = tonic::codec::ProstCodec::default();
1861            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/IsBootstrapped");
1862            let mut req = request.into_request();
1863            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "IsBootstrapped"));
1864            self.inner.unary(req, path, codec).await
1865        }
1866        pub async fn alloc_id(
1867            &mut self,
1868            request: impl tonic::IntoRequest<super::AllocIdRequest>,
1869        ) -> std::result::Result<
1870            tonic::Response<super::AllocIdResponse>,
1871            tonic::Status,
1872        > {
1873            self.inner
1874                .ready()
1875                .await
1876                .map_err(|e| {
1877                    tonic::Status::new(
1878                        tonic::Code::Unknown,
1879                        format!("Service was not ready: {}", e.into()),
1880                    )
1881                })?;
1882            let codec = tonic::codec::ProstCodec::default();
1883            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/AllocID");
1884            let mut req = request.into_request();
1885            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "AllocID"));
1886            self.inner.unary(req, path, codec).await
1887        }
1888        pub async fn is_snapshot_recovering(
1889            &mut self,
1890            request: impl tonic::IntoRequest<super::IsSnapshotRecoveringRequest>,
1891        ) -> std::result::Result<
1892            tonic::Response<super::IsSnapshotRecoveringResponse>,
1893            tonic::Status,
1894        > {
1895            self.inner
1896                .ready()
1897                .await
1898                .map_err(|e| {
1899                    tonic::Status::new(
1900                        tonic::Code::Unknown,
1901                        format!("Service was not ready: {}", e.into()),
1902                    )
1903                })?;
1904            let codec = tonic::codec::ProstCodec::default();
1905            let path = http::uri::PathAndQuery::from_static(
1906                "/pdpb.PD/IsSnapshotRecovering",
1907            );
1908            let mut req = request.into_request();
1909            req.extensions_mut()
1910                .insert(GrpcMethod::new("pdpb.PD", "IsSnapshotRecovering"));
1911            self.inner.unary(req, path, codec).await
1912        }
1913        pub async fn get_store(
1914            &mut self,
1915            request: impl tonic::IntoRequest<super::GetStoreRequest>,
1916        ) -> std::result::Result<
1917            tonic::Response<super::GetStoreResponse>,
1918            tonic::Status,
1919        > {
1920            self.inner
1921                .ready()
1922                .await
1923                .map_err(|e| {
1924                    tonic::Status::new(
1925                        tonic::Code::Unknown,
1926                        format!("Service was not ready: {}", e.into()),
1927                    )
1928                })?;
1929            let codec = tonic::codec::ProstCodec::default();
1930            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetStore");
1931            let mut req = request.into_request();
1932            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetStore"));
1933            self.inner.unary(req, path, codec).await
1934        }
1935        pub async fn put_store(
1936            &mut self,
1937            request: impl tonic::IntoRequest<super::PutStoreRequest>,
1938        ) -> std::result::Result<
1939            tonic::Response<super::PutStoreResponse>,
1940            tonic::Status,
1941        > {
1942            self.inner
1943                .ready()
1944                .await
1945                .map_err(|e| {
1946                    tonic::Status::new(
1947                        tonic::Code::Unknown,
1948                        format!("Service was not ready: {}", e.into()),
1949                    )
1950                })?;
1951            let codec = tonic::codec::ProstCodec::default();
1952            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/PutStore");
1953            let mut req = request.into_request();
1954            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "PutStore"));
1955            self.inner.unary(req, path, codec).await
1956        }
1957        pub async fn get_all_stores(
1958            &mut self,
1959            request: impl tonic::IntoRequest<super::GetAllStoresRequest>,
1960        ) -> std::result::Result<
1961            tonic::Response<super::GetAllStoresResponse>,
1962            tonic::Status,
1963        > {
1964            self.inner
1965                .ready()
1966                .await
1967                .map_err(|e| {
1968                    tonic::Status::new(
1969                        tonic::Code::Unknown,
1970                        format!("Service was not ready: {}", e.into()),
1971                    )
1972                })?;
1973            let codec = tonic::codec::ProstCodec::default();
1974            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetAllStores");
1975            let mut req = request.into_request();
1976            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetAllStores"));
1977            self.inner.unary(req, path, codec).await
1978        }
1979        pub async fn store_heartbeat(
1980            &mut self,
1981            request: impl tonic::IntoRequest<super::StoreHeartbeatRequest>,
1982        ) -> std::result::Result<
1983            tonic::Response<super::StoreHeartbeatResponse>,
1984            tonic::Status,
1985        > {
1986            self.inner
1987                .ready()
1988                .await
1989                .map_err(|e| {
1990                    tonic::Status::new(
1991                        tonic::Code::Unknown,
1992                        format!("Service was not ready: {}", e.into()),
1993                    )
1994                })?;
1995            let codec = tonic::codec::ProstCodec::default();
1996            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/StoreHeartbeat");
1997            let mut req = request.into_request();
1998            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "StoreHeartbeat"));
1999            self.inner.unary(req, path, codec).await
2000        }
2001        pub async fn region_heartbeat(
2002            &mut self,
2003            request: impl tonic::IntoStreamingRequest<
2004                Message = super::RegionHeartbeatRequest,
2005            >,
2006        ) -> std::result::Result<
2007            tonic::Response<tonic::codec::Streaming<super::RegionHeartbeatResponse>>,
2008            tonic::Status,
2009        > {
2010            self.inner
2011                .ready()
2012                .await
2013                .map_err(|e| {
2014                    tonic::Status::new(
2015                        tonic::Code::Unknown,
2016                        format!("Service was not ready: {}", e.into()),
2017                    )
2018                })?;
2019            let codec = tonic::codec::ProstCodec::default();
2020            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/RegionHeartbeat");
2021            let mut req = request.into_streaming_request();
2022            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "RegionHeartbeat"));
2023            self.inner.streaming(req, path, codec).await
2024        }
2025        pub async fn get_region(
2026            &mut self,
2027            request: impl tonic::IntoRequest<super::GetRegionRequest>,
2028        ) -> std::result::Result<
2029            tonic::Response<super::GetRegionResponse>,
2030            tonic::Status,
2031        > {
2032            self.inner
2033                .ready()
2034                .await
2035                .map_err(|e| {
2036                    tonic::Status::new(
2037                        tonic::Code::Unknown,
2038                        format!("Service was not ready: {}", e.into()),
2039                    )
2040                })?;
2041            let codec = tonic::codec::ProstCodec::default();
2042            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetRegion");
2043            let mut req = request.into_request();
2044            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetRegion"));
2045            self.inner.unary(req, path, codec).await
2046        }
2047        pub async fn get_prev_region(
2048            &mut self,
2049            request: impl tonic::IntoRequest<super::GetRegionRequest>,
2050        ) -> std::result::Result<
2051            tonic::Response<super::GetRegionResponse>,
2052            tonic::Status,
2053        > {
2054            self.inner
2055                .ready()
2056                .await
2057                .map_err(|e| {
2058                    tonic::Status::new(
2059                        tonic::Code::Unknown,
2060                        format!("Service was not ready: {}", e.into()),
2061                    )
2062                })?;
2063            let codec = tonic::codec::ProstCodec::default();
2064            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetPrevRegion");
2065            let mut req = request.into_request();
2066            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetPrevRegion"));
2067            self.inner.unary(req, path, codec).await
2068        }
2069        pub async fn get_region_by_id(
2070            &mut self,
2071            request: impl tonic::IntoRequest<super::GetRegionByIdRequest>,
2072        ) -> std::result::Result<
2073            tonic::Response<super::GetRegionResponse>,
2074            tonic::Status,
2075        > {
2076            self.inner
2077                .ready()
2078                .await
2079                .map_err(|e| {
2080                    tonic::Status::new(
2081                        tonic::Code::Unknown,
2082                        format!("Service was not ready: {}", e.into()),
2083                    )
2084                })?;
2085            let codec = tonic::codec::ProstCodec::default();
2086            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetRegionByID");
2087            let mut req = request.into_request();
2088            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetRegionByID"));
2089            self.inner.unary(req, path, codec).await
2090        }
2091        pub async fn scan_regions(
2092            &mut self,
2093            request: impl tonic::IntoRequest<super::ScanRegionsRequest>,
2094        ) -> std::result::Result<
2095            tonic::Response<super::ScanRegionsResponse>,
2096            tonic::Status,
2097        > {
2098            self.inner
2099                .ready()
2100                .await
2101                .map_err(|e| {
2102                    tonic::Status::new(
2103                        tonic::Code::Unknown,
2104                        format!("Service was not ready: {}", e.into()),
2105                    )
2106                })?;
2107            let codec = tonic::codec::ProstCodec::default();
2108            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/ScanRegions");
2109            let mut req = request.into_request();
2110            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "ScanRegions"));
2111            self.inner.unary(req, path, codec).await
2112        }
2113        pub async fn ask_split(
2114            &mut self,
2115            request: impl tonic::IntoRequest<super::AskSplitRequest>,
2116        ) -> std::result::Result<
2117            tonic::Response<super::AskSplitResponse>,
2118            tonic::Status,
2119        > {
2120            self.inner
2121                .ready()
2122                .await
2123                .map_err(|e| {
2124                    tonic::Status::new(
2125                        tonic::Code::Unknown,
2126                        format!("Service was not ready: {}", e.into()),
2127                    )
2128                })?;
2129            let codec = tonic::codec::ProstCodec::default();
2130            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/AskSplit");
2131            let mut req = request.into_request();
2132            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "AskSplit"));
2133            self.inner.unary(req, path, codec).await
2134        }
2135        pub async fn report_split(
2136            &mut self,
2137            request: impl tonic::IntoRequest<super::ReportSplitRequest>,
2138        ) -> std::result::Result<
2139            tonic::Response<super::ReportSplitResponse>,
2140            tonic::Status,
2141        > {
2142            self.inner
2143                .ready()
2144                .await
2145                .map_err(|e| {
2146                    tonic::Status::new(
2147                        tonic::Code::Unknown,
2148                        format!("Service was not ready: {}", e.into()),
2149                    )
2150                })?;
2151            let codec = tonic::codec::ProstCodec::default();
2152            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/ReportSplit");
2153            let mut req = request.into_request();
2154            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "ReportSplit"));
2155            self.inner.unary(req, path, codec).await
2156        }
2157        pub async fn ask_batch_split(
2158            &mut self,
2159            request: impl tonic::IntoRequest<super::AskBatchSplitRequest>,
2160        ) -> std::result::Result<
2161            tonic::Response<super::AskBatchSplitResponse>,
2162            tonic::Status,
2163        > {
2164            self.inner
2165                .ready()
2166                .await
2167                .map_err(|e| {
2168                    tonic::Status::new(
2169                        tonic::Code::Unknown,
2170                        format!("Service was not ready: {}", e.into()),
2171                    )
2172                })?;
2173            let codec = tonic::codec::ProstCodec::default();
2174            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/AskBatchSplit");
2175            let mut req = request.into_request();
2176            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "AskBatchSplit"));
2177            self.inner.unary(req, path, codec).await
2178        }
2179        pub async fn report_batch_split(
2180            &mut self,
2181            request: impl tonic::IntoRequest<super::ReportBatchSplitRequest>,
2182        ) -> std::result::Result<
2183            tonic::Response<super::ReportBatchSplitResponse>,
2184            tonic::Status,
2185        > {
2186            self.inner
2187                .ready()
2188                .await
2189                .map_err(|e| {
2190                    tonic::Status::new(
2191                        tonic::Code::Unknown,
2192                        format!("Service was not ready: {}", e.into()),
2193                    )
2194                })?;
2195            let codec = tonic::codec::ProstCodec::default();
2196            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/ReportBatchSplit");
2197            let mut req = request.into_request();
2198            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "ReportBatchSplit"));
2199            self.inner.unary(req, path, codec).await
2200        }
2201        pub async fn get_cluster_config(
2202            &mut self,
2203            request: impl tonic::IntoRequest<super::GetClusterConfigRequest>,
2204        ) -> std::result::Result<
2205            tonic::Response<super::GetClusterConfigResponse>,
2206            tonic::Status,
2207        > {
2208            self.inner
2209                .ready()
2210                .await
2211                .map_err(|e| {
2212                    tonic::Status::new(
2213                        tonic::Code::Unknown,
2214                        format!("Service was not ready: {}", e.into()),
2215                    )
2216                })?;
2217            let codec = tonic::codec::ProstCodec::default();
2218            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetClusterConfig");
2219            let mut req = request.into_request();
2220            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetClusterConfig"));
2221            self.inner.unary(req, path, codec).await
2222        }
2223        pub async fn put_cluster_config(
2224            &mut self,
2225            request: impl tonic::IntoRequest<super::PutClusterConfigRequest>,
2226        ) -> std::result::Result<
2227            tonic::Response<super::PutClusterConfigResponse>,
2228            tonic::Status,
2229        > {
2230            self.inner
2231                .ready()
2232                .await
2233                .map_err(|e| {
2234                    tonic::Status::new(
2235                        tonic::Code::Unknown,
2236                        format!("Service was not ready: {}", e.into()),
2237                    )
2238                })?;
2239            let codec = tonic::codec::ProstCodec::default();
2240            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/PutClusterConfig");
2241            let mut req = request.into_request();
2242            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "PutClusterConfig"));
2243            self.inner.unary(req, path, codec).await
2244        }
2245        pub async fn scatter_region(
2246            &mut self,
2247            request: impl tonic::IntoRequest<super::ScatterRegionRequest>,
2248        ) -> std::result::Result<
2249            tonic::Response<super::ScatterRegionResponse>,
2250            tonic::Status,
2251        > {
2252            self.inner
2253                .ready()
2254                .await
2255                .map_err(|e| {
2256                    tonic::Status::new(
2257                        tonic::Code::Unknown,
2258                        format!("Service was not ready: {}", e.into()),
2259                    )
2260                })?;
2261            let codec = tonic::codec::ProstCodec::default();
2262            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/ScatterRegion");
2263            let mut req = request.into_request();
2264            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "ScatterRegion"));
2265            self.inner.unary(req, path, codec).await
2266        }
2267        pub async fn get_gc_safe_point(
2268            &mut self,
2269            request: impl tonic::IntoRequest<super::GetGcSafePointRequest>,
2270        ) -> std::result::Result<
2271            tonic::Response<super::GetGcSafePointResponse>,
2272            tonic::Status,
2273        > {
2274            self.inner
2275                .ready()
2276                .await
2277                .map_err(|e| {
2278                    tonic::Status::new(
2279                        tonic::Code::Unknown,
2280                        format!("Service was not ready: {}", e.into()),
2281                    )
2282                })?;
2283            let codec = tonic::codec::ProstCodec::default();
2284            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetGCSafePoint");
2285            let mut req = request.into_request();
2286            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetGCSafePoint"));
2287            self.inner.unary(req, path, codec).await
2288        }
2289        pub async fn update_gc_safe_point(
2290            &mut self,
2291            request: impl tonic::IntoRequest<super::UpdateGcSafePointRequest>,
2292        ) -> std::result::Result<
2293            tonic::Response<super::UpdateGcSafePointResponse>,
2294            tonic::Status,
2295        > {
2296            self.inner
2297                .ready()
2298                .await
2299                .map_err(|e| {
2300                    tonic::Status::new(
2301                        tonic::Code::Unknown,
2302                        format!("Service was not ready: {}", e.into()),
2303                    )
2304                })?;
2305            let codec = tonic::codec::ProstCodec::default();
2306            let path = http::uri::PathAndQuery::from_static(
2307                "/pdpb.PD/UpdateGCSafePoint",
2308            );
2309            let mut req = request.into_request();
2310            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "UpdateGCSafePoint"));
2311            self.inner.unary(req, path, codec).await
2312        }
2313        pub async fn update_service_gc_safe_point(
2314            &mut self,
2315            request: impl tonic::IntoRequest<super::UpdateServiceGcSafePointRequest>,
2316        ) -> std::result::Result<
2317            tonic::Response<super::UpdateServiceGcSafePointResponse>,
2318            tonic::Status,
2319        > {
2320            self.inner
2321                .ready()
2322                .await
2323                .map_err(|e| {
2324                    tonic::Status::new(
2325                        tonic::Code::Unknown,
2326                        format!("Service was not ready: {}", e.into()),
2327                    )
2328                })?;
2329            let codec = tonic::codec::ProstCodec::default();
2330            let path = http::uri::PathAndQuery::from_static(
2331                "/pdpb.PD/UpdateServiceGCSafePoint",
2332            );
2333            let mut req = request.into_request();
2334            req.extensions_mut()
2335                .insert(GrpcMethod::new("pdpb.PD", "UpdateServiceGCSafePoint"));
2336            self.inner.unary(req, path, codec).await
2337        }
2338        pub async fn get_gc_safe_point_v2(
2339            &mut self,
2340            request: impl tonic::IntoRequest<super::GetGcSafePointV2Request>,
2341        ) -> std::result::Result<
2342            tonic::Response<super::GetGcSafePointV2Response>,
2343            tonic::Status,
2344        > {
2345            self.inner
2346                .ready()
2347                .await
2348                .map_err(|e| {
2349                    tonic::Status::new(
2350                        tonic::Code::Unknown,
2351                        format!("Service was not ready: {}", e.into()),
2352                    )
2353                })?;
2354            let codec = tonic::codec::ProstCodec::default();
2355            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetGCSafePointV2");
2356            let mut req = request.into_request();
2357            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetGCSafePointV2"));
2358            self.inner.unary(req, path, codec).await
2359        }
2360        pub async fn watch_gc_safe_point_v2(
2361            &mut self,
2362            request: impl tonic::IntoRequest<super::WatchGcSafePointV2Request>,
2363        ) -> std::result::Result<
2364            tonic::Response<tonic::codec::Streaming<super::WatchGcSafePointV2Response>>,
2365            tonic::Status,
2366        > {
2367            self.inner
2368                .ready()
2369                .await
2370                .map_err(|e| {
2371                    tonic::Status::new(
2372                        tonic::Code::Unknown,
2373                        format!("Service was not ready: {}", e.into()),
2374                    )
2375                })?;
2376            let codec = tonic::codec::ProstCodec::default();
2377            let path = http::uri::PathAndQuery::from_static(
2378                "/pdpb.PD/WatchGCSafePointV2",
2379            );
2380            let mut req = request.into_request();
2381            req.extensions_mut()
2382                .insert(GrpcMethod::new("pdpb.PD", "WatchGCSafePointV2"));
2383            self.inner.server_streaming(req, path, codec).await
2384        }
2385        pub async fn update_gc_safe_point_v2(
2386            &mut self,
2387            request: impl tonic::IntoRequest<super::UpdateGcSafePointV2Request>,
2388        ) -> std::result::Result<
2389            tonic::Response<super::UpdateGcSafePointV2Response>,
2390            tonic::Status,
2391        > {
2392            self.inner
2393                .ready()
2394                .await
2395                .map_err(|e| {
2396                    tonic::Status::new(
2397                        tonic::Code::Unknown,
2398                        format!("Service was not ready: {}", e.into()),
2399                    )
2400                })?;
2401            let codec = tonic::codec::ProstCodec::default();
2402            let path = http::uri::PathAndQuery::from_static(
2403                "/pdpb.PD/UpdateGCSafePointV2",
2404            );
2405            let mut req = request.into_request();
2406            req.extensions_mut()
2407                .insert(GrpcMethod::new("pdpb.PD", "UpdateGCSafePointV2"));
2408            self.inner.unary(req, path, codec).await
2409        }
2410        pub async fn update_service_safe_point_v2(
2411            &mut self,
2412            request: impl tonic::IntoRequest<super::UpdateServiceSafePointV2Request>,
2413        ) -> std::result::Result<
2414            tonic::Response<super::UpdateServiceSafePointV2Response>,
2415            tonic::Status,
2416        > {
2417            self.inner
2418                .ready()
2419                .await
2420                .map_err(|e| {
2421                    tonic::Status::new(
2422                        tonic::Code::Unknown,
2423                        format!("Service was not ready: {}", e.into()),
2424                    )
2425                })?;
2426            let codec = tonic::codec::ProstCodec::default();
2427            let path = http::uri::PathAndQuery::from_static(
2428                "/pdpb.PD/UpdateServiceSafePointV2",
2429            );
2430            let mut req = request.into_request();
2431            req.extensions_mut()
2432                .insert(GrpcMethod::new("pdpb.PD", "UpdateServiceSafePointV2"));
2433            self.inner.unary(req, path, codec).await
2434        }
2435        pub async fn get_all_gc_safe_point_v2(
2436            &mut self,
2437            request: impl tonic::IntoRequest<super::GetAllGcSafePointV2Request>,
2438        ) -> std::result::Result<
2439            tonic::Response<super::GetAllGcSafePointV2Response>,
2440            tonic::Status,
2441        > {
2442            self.inner
2443                .ready()
2444                .await
2445                .map_err(|e| {
2446                    tonic::Status::new(
2447                        tonic::Code::Unknown,
2448                        format!("Service was not ready: {}", e.into()),
2449                    )
2450                })?;
2451            let codec = tonic::codec::ProstCodec::default();
2452            let path = http::uri::PathAndQuery::from_static(
2453                "/pdpb.PD/GetAllGCSafePointV2",
2454            );
2455            let mut req = request.into_request();
2456            req.extensions_mut()
2457                .insert(GrpcMethod::new("pdpb.PD", "GetAllGCSafePointV2"));
2458            self.inner.unary(req, path, codec).await
2459        }
2460        pub async fn sync_regions(
2461            &mut self,
2462            request: impl tonic::IntoStreamingRequest<Message = super::SyncRegionRequest>,
2463        ) -> std::result::Result<
2464            tonic::Response<tonic::codec::Streaming<super::SyncRegionResponse>>,
2465            tonic::Status,
2466        > {
2467            self.inner
2468                .ready()
2469                .await
2470                .map_err(|e| {
2471                    tonic::Status::new(
2472                        tonic::Code::Unknown,
2473                        format!("Service was not ready: {}", e.into()),
2474                    )
2475                })?;
2476            let codec = tonic::codec::ProstCodec::default();
2477            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/SyncRegions");
2478            let mut req = request.into_streaming_request();
2479            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "SyncRegions"));
2480            self.inner.streaming(req, path, codec).await
2481        }
2482        pub async fn get_operator(
2483            &mut self,
2484            request: impl tonic::IntoRequest<super::GetOperatorRequest>,
2485        ) -> std::result::Result<
2486            tonic::Response<super::GetOperatorResponse>,
2487            tonic::Status,
2488        > {
2489            self.inner
2490                .ready()
2491                .await
2492                .map_err(|e| {
2493                    tonic::Status::new(
2494                        tonic::Code::Unknown,
2495                        format!("Service was not ready: {}", e.into()),
2496                    )
2497                })?;
2498            let codec = tonic::codec::ProstCodec::default();
2499            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetOperator");
2500            let mut req = request.into_request();
2501            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetOperator"));
2502            self.inner.unary(req, path, codec).await
2503        }
2504        pub async fn sync_max_ts(
2505            &mut self,
2506            request: impl tonic::IntoRequest<super::SyncMaxTsRequest>,
2507        ) -> std::result::Result<
2508            tonic::Response<super::SyncMaxTsResponse>,
2509            tonic::Status,
2510        > {
2511            self.inner
2512                .ready()
2513                .await
2514                .map_err(|e| {
2515                    tonic::Status::new(
2516                        tonic::Code::Unknown,
2517                        format!("Service was not ready: {}", e.into()),
2518                    )
2519                })?;
2520            let codec = tonic::codec::ProstCodec::default();
2521            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/SyncMaxTS");
2522            let mut req = request.into_request();
2523            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "SyncMaxTS"));
2524            self.inner.unary(req, path, codec).await
2525        }
2526        pub async fn split_regions(
2527            &mut self,
2528            request: impl tonic::IntoRequest<super::SplitRegionsRequest>,
2529        ) -> std::result::Result<
2530            tonic::Response<super::SplitRegionsResponse>,
2531            tonic::Status,
2532        > {
2533            self.inner
2534                .ready()
2535                .await
2536                .map_err(|e| {
2537                    tonic::Status::new(
2538                        tonic::Code::Unknown,
2539                        format!("Service was not ready: {}", e.into()),
2540                    )
2541                })?;
2542            let codec = tonic::codec::ProstCodec::default();
2543            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/SplitRegions");
2544            let mut req = request.into_request();
2545            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "SplitRegions"));
2546            self.inner.unary(req, path, codec).await
2547        }
2548        pub async fn split_and_scatter_regions(
2549            &mut self,
2550            request: impl tonic::IntoRequest<super::SplitAndScatterRegionsRequest>,
2551        ) -> std::result::Result<
2552            tonic::Response<super::SplitAndScatterRegionsResponse>,
2553            tonic::Status,
2554        > {
2555            self.inner
2556                .ready()
2557                .await
2558                .map_err(|e| {
2559                    tonic::Status::new(
2560                        tonic::Code::Unknown,
2561                        format!("Service was not ready: {}", e.into()),
2562                    )
2563                })?;
2564            let codec = tonic::codec::ProstCodec::default();
2565            let path = http::uri::PathAndQuery::from_static(
2566                "/pdpb.PD/SplitAndScatterRegions",
2567            );
2568            let mut req = request.into_request();
2569            req.extensions_mut()
2570                .insert(GrpcMethod::new("pdpb.PD", "SplitAndScatterRegions"));
2571            self.inner.unary(req, path, codec).await
2572        }
2573        pub async fn get_dc_location_info(
2574            &mut self,
2575            request: impl tonic::IntoRequest<super::GetDcLocationInfoRequest>,
2576        ) -> std::result::Result<
2577            tonic::Response<super::GetDcLocationInfoResponse>,
2578            tonic::Status,
2579        > {
2580            self.inner
2581                .ready()
2582                .await
2583                .map_err(|e| {
2584                    tonic::Status::new(
2585                        tonic::Code::Unknown,
2586                        format!("Service was not ready: {}", e.into()),
2587                    )
2588                })?;
2589            let codec = tonic::codec::ProstCodec::default();
2590            let path = http::uri::PathAndQuery::from_static(
2591                "/pdpb.PD/GetDCLocationInfo",
2592            );
2593            let mut req = request.into_request();
2594            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetDCLocationInfo"));
2595            self.inner.unary(req, path, codec).await
2596        }
2597        pub async fn store_global_config(
2598            &mut self,
2599            request: impl tonic::IntoRequest<super::StoreGlobalConfigRequest>,
2600        ) -> std::result::Result<
2601            tonic::Response<super::StoreGlobalConfigResponse>,
2602            tonic::Status,
2603        > {
2604            self.inner
2605                .ready()
2606                .await
2607                .map_err(|e| {
2608                    tonic::Status::new(
2609                        tonic::Code::Unknown,
2610                        format!("Service was not ready: {}", e.into()),
2611                    )
2612                })?;
2613            let codec = tonic::codec::ProstCodec::default();
2614            let path = http::uri::PathAndQuery::from_static(
2615                "/pdpb.PD/StoreGlobalConfig",
2616            );
2617            let mut req = request.into_request();
2618            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "StoreGlobalConfig"));
2619            self.inner.unary(req, path, codec).await
2620        }
2621        pub async fn load_global_config(
2622            &mut self,
2623            request: impl tonic::IntoRequest<super::LoadGlobalConfigRequest>,
2624        ) -> std::result::Result<
2625            tonic::Response<super::LoadGlobalConfigResponse>,
2626            tonic::Status,
2627        > {
2628            self.inner
2629                .ready()
2630                .await
2631                .map_err(|e| {
2632                    tonic::Status::new(
2633                        tonic::Code::Unknown,
2634                        format!("Service was not ready: {}", e.into()),
2635                    )
2636                })?;
2637            let codec = tonic::codec::ProstCodec::default();
2638            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/LoadGlobalConfig");
2639            let mut req = request.into_request();
2640            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "LoadGlobalConfig"));
2641            self.inner.unary(req, path, codec).await
2642        }
2643        pub async fn watch_global_config(
2644            &mut self,
2645            request: impl tonic::IntoRequest<super::WatchGlobalConfigRequest>,
2646        ) -> std::result::Result<
2647            tonic::Response<tonic::codec::Streaming<super::WatchGlobalConfigResponse>>,
2648            tonic::Status,
2649        > {
2650            self.inner
2651                .ready()
2652                .await
2653                .map_err(|e| {
2654                    tonic::Status::new(
2655                        tonic::Code::Unknown,
2656                        format!("Service was not ready: {}", e.into()),
2657                    )
2658                })?;
2659            let codec = tonic::codec::ProstCodec::default();
2660            let path = http::uri::PathAndQuery::from_static(
2661                "/pdpb.PD/WatchGlobalConfig",
2662            );
2663            let mut req = request.into_request();
2664            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "WatchGlobalConfig"));
2665            self.inner.server_streaming(req, path, codec).await
2666        }
2667        pub async fn report_buckets(
2668            &mut self,
2669            request: impl tonic::IntoStreamingRequest<
2670                Message = super::ReportBucketsRequest,
2671            >,
2672        ) -> std::result::Result<
2673            tonic::Response<super::ReportBucketsResponse>,
2674            tonic::Status,
2675        > {
2676            self.inner
2677                .ready()
2678                .await
2679                .map_err(|e| {
2680                    tonic::Status::new(
2681                        tonic::Code::Unknown,
2682                        format!("Service was not ready: {}", e.into()),
2683                    )
2684                })?;
2685            let codec = tonic::codec::ProstCodec::default();
2686            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/ReportBuckets");
2687            let mut req = request.into_streaming_request();
2688            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "ReportBuckets"));
2689            self.inner.client_streaming(req, path, codec).await
2690        }
2691        pub async fn report_min_resolved_ts(
2692            &mut self,
2693            request: impl tonic::IntoRequest<super::ReportMinResolvedTsRequest>,
2694        ) -> std::result::Result<
2695            tonic::Response<super::ReportMinResolvedTsResponse>,
2696            tonic::Status,
2697        > {
2698            self.inner
2699                .ready()
2700                .await
2701                .map_err(|e| {
2702                    tonic::Status::new(
2703                        tonic::Code::Unknown,
2704                        format!("Service was not ready: {}", e.into()),
2705                    )
2706                })?;
2707            let codec = tonic::codec::ProstCodec::default();
2708            let path = http::uri::PathAndQuery::from_static(
2709                "/pdpb.PD/ReportMinResolvedTS",
2710            );
2711            let mut req = request.into_request();
2712            req.extensions_mut()
2713                .insert(GrpcMethod::new("pdpb.PD", "ReportMinResolvedTS"));
2714            self.inner.unary(req, path, codec).await
2715        }
2716        pub async fn set_external_timestamp(
2717            &mut self,
2718            request: impl tonic::IntoRequest<super::SetExternalTimestampRequest>,
2719        ) -> std::result::Result<
2720            tonic::Response<super::SetExternalTimestampResponse>,
2721            tonic::Status,
2722        > {
2723            self.inner
2724                .ready()
2725                .await
2726                .map_err(|e| {
2727                    tonic::Status::new(
2728                        tonic::Code::Unknown,
2729                        format!("Service was not ready: {}", e.into()),
2730                    )
2731                })?;
2732            let codec = tonic::codec::ProstCodec::default();
2733            let path = http::uri::PathAndQuery::from_static(
2734                "/pdpb.PD/SetExternalTimestamp",
2735            );
2736            let mut req = request.into_request();
2737            req.extensions_mut()
2738                .insert(GrpcMethod::new("pdpb.PD", "SetExternalTimestamp"));
2739            self.inner.unary(req, path, codec).await
2740        }
2741        pub async fn get_external_timestamp(
2742            &mut self,
2743            request: impl tonic::IntoRequest<super::GetExternalTimestampRequest>,
2744        ) -> std::result::Result<
2745            tonic::Response<super::GetExternalTimestampResponse>,
2746            tonic::Status,
2747        > {
2748            self.inner
2749                .ready()
2750                .await
2751                .map_err(|e| {
2752                    tonic::Status::new(
2753                        tonic::Code::Unknown,
2754                        format!("Service was not ready: {}", e.into()),
2755                    )
2756                })?;
2757            let codec = tonic::codec::ProstCodec::default();
2758            let path = http::uri::PathAndQuery::from_static(
2759                "/pdpb.PD/GetExternalTimestamp",
2760            );
2761            let mut req = request.into_request();
2762            req.extensions_mut()
2763                .insert(GrpcMethod::new("pdpb.PD", "GetExternalTimestamp"));
2764            self.inner.unary(req, path, codec).await
2765        }
2766        /// Get the minimum timestamp across all keyspace groups from API server
2767        /// TODO: Currently, we need to ask API server to get the minimum timestamp.
2768        /// Once we support service discovery, we can remove it.
2769        pub async fn get_min_ts(
2770            &mut self,
2771            request: impl tonic::IntoRequest<super::GetMinTsRequest>,
2772        ) -> std::result::Result<
2773            tonic::Response<super::GetMinTsResponse>,
2774            tonic::Status,
2775        > {
2776            self.inner
2777                .ready()
2778                .await
2779                .map_err(|e| {
2780                    tonic::Status::new(
2781                        tonic::Code::Unknown,
2782                        format!("Service was not ready: {}", e.into()),
2783                    )
2784                })?;
2785            let codec = tonic::codec::ProstCodec::default();
2786            let path = http::uri::PathAndQuery::from_static("/pdpb.PD/GetMinTS");
2787            let mut req = request.into_request();
2788            req.extensions_mut().insert(GrpcMethod::new("pdpb.PD", "GetMinTS"));
2789            self.inner.unary(req, path, codec).await
2790        }
2791    }
2792}