1use std::collections::HashMap;
16use std::collections::HashSet;
17
18use cheetah_string::CheetahString;
19use rocketmq_model::common::base::plain_access_config::PlainAccessConfig;
20use rocketmq_model::common::config::TopicConfig;
21use rocketmq_model::common::message::message_enum::MessageRequestMode;
22use rocketmq_model::common::message::message_ext::MessageExt;
23use rocketmq_model::common::message::message_queue::MessageQueue;
24#[allow(deprecated)]
25use rocketmq_model::common::tools::broker_operator_result::BrokerOperatorResult;
26#[allow(deprecated)]
27use rocketmq_model::common::tools::message_track::MessageTrack;
28use rocketmq_protocol::protocol::admin::consume_stats::ConsumeStats;
29use rocketmq_protocol::protocol::admin::consume_stats_list::ConsumeStatsList;
30use rocketmq_protocol::protocol::admin::rollback_stats::RollbackStats;
31use rocketmq_protocol::protocol::admin::topic_stats_table::TopicStatsTable;
32use rocketmq_protocol::protocol::body::acl_info::AclInfo;
33use rocketmq_protocol::protocol::body::broker_body::broker_member_group::BrokerMemberGroup;
34use rocketmq_protocol::protocol::body::broker_body::cluster_info::ClusterInfo;
35use rocketmq_protocol::protocol::body::broker_replicas_info::BrokerReplicasInfo;
36use rocketmq_protocol::protocol::body::check_rocksdb_cqwrite_progress_response_body::CheckRocksdbCqWriteResult;
37use rocketmq_protocol::protocol::body::consume_message_directly_result::ConsumeMessageDirectlyResult;
38use rocketmq_protocol::protocol::body::consumer_connection::ConsumerConnection;
39use rocketmq_protocol::protocol::body::consumer_running_info::ConsumerRunningInfo;
40use rocketmq_protocol::protocol::body::epoch_entry_cache::EpochEntryCache;
41use rocketmq_protocol::protocol::body::get_broker_lite_info_response_body::GetBrokerLiteInfoResponseBody;
42use rocketmq_protocol::protocol::body::get_lite_client_info_response_body::GetLiteClientInfoResponseBody;
43use rocketmq_protocol::protocol::body::get_lite_group_info_response_body::GetLiteGroupInfoResponseBody;
44use rocketmq_protocol::protocol::body::get_lite_topic_info_response_body::GetLiteTopicInfoResponseBody;
45use rocketmq_protocol::protocol::body::get_parent_topic_info_response_body::GetParentTopicInfoResponseBody;
46use rocketmq_protocol::protocol::body::group_list::GroupList;
47use rocketmq_protocol::protocol::body::ha_runtime_info::HARuntimeInfo;
48use rocketmq_protocol::protocol::body::kv_table::KVTable;
49use rocketmq_protocol::protocol::body::producer_connection::ProducerConnection;
50use rocketmq_protocol::protocol::body::producer_table_info::ProducerTableInfo;
51use rocketmq_protocol::protocol::body::query_consume_queue_response_body::QueryConsumeQueueResponseBody;
52use rocketmq_protocol::protocol::body::queue_time_span::QueueTimeSpan;
53use rocketmq_protocol::protocol::body::subscription_group_wrapper::SubscriptionGroupWrapper;
54use rocketmq_protocol::protocol::body::topic::topic_list::TopicList;
55use rocketmq_protocol::protocol::body::topic_info_wrapper::TopicConfigSerializeWrapper;
56use rocketmq_protocol::protocol::body::user_info::UserInfo;
57use rocketmq_protocol::protocol::header::elect_master_response_header::ElectMasterResponseHeader;
58use rocketmq_protocol::protocol::header::get_meta_data_response_header::GetMetaDataResponseHeader;
59use rocketmq_protocol::protocol::heartbeat::subscription_data::SubscriptionData;
60use rocketmq_protocol::protocol::route::topic_route_data::TopicRouteData;
61use rocketmq_protocol::protocol::static_topic::topic_queue_mapping_detail::TopicQueueMappingDetail;
62use rocketmq_protocol::protocol::subscription::broker_stats_data::BrokerStatsData;
63use rocketmq_protocol::protocol::subscription::group_forbidden::GroupForbidden;
64use rocketmq_protocol::protocol::subscription::subscription_group_config::SubscriptionGroupConfig;
65
66use crate::common::admin_tool_result::AdminToolResult;
67
68#[allow(dead_code, reason = "command families consume selected capability methods")]
69#[allow(async_fn_in_trait)]
70pub trait RouteAdmin: Send {
71 async fn examine_broker_cluster_info(&self) -> crate::ClientResult<ClusterInfo>;
72
73 async fn get_name_server_address_list(&self) -> Vec<CheetahString>;
74
75 async fn put_kv_config(&self, namespace: CheetahString, key: CheetahString, value: CheetahString);
76
77 async fn get_kv_config(&self, namespace: CheetahString, key: CheetahString) -> crate::ClientResult<CheetahString>;
78
79 async fn get_kv_list_by_namespace(&self, namespace: CheetahString) -> crate::ClientResult<KVTable>;
80
81 async fn create_and_update_kv_config(
82 &self,
83 namespace: CheetahString,
84 key: CheetahString,
85 value: CheetahString,
86 ) -> crate::ClientResult<()>;
87
88 async fn delete_kv_config(&self, namespace: CheetahString, key: CheetahString) -> crate::ClientResult<()>;
89
90 async fn get_cluster_list(&self, topic: String) -> crate::ClientResult<HashSet<CheetahString>>;
91
92 async fn update_name_server_config(
93 &self,
94 properties: HashMap<CheetahString, CheetahString>,
95 name_servers: Option<Vec<CheetahString>>,
96 ) -> crate::ClientResult<()>;
97
98 async fn get_name_server_config(
99 &self,
100 name_servers: Vec<CheetahString>,
101 ) -> crate::ClientResult<HashMap<CheetahString, HashMap<CheetahString, CheetahString>>>;
102
103 async fn probe_name_server(&self, name_server: CheetahString) -> crate::ClientResult<()>;
104}
105
106#[allow(dead_code, reason = "command families consume selected capability methods")]
107#[allow(async_fn_in_trait)]
108pub trait TopicAdmin: Send {
109 async fn create_and_update_topic_config(&self, addr: CheetahString, config: TopicConfig)
110 -> crate::ClientResult<()>;
111
112 async fn create_and_update_topic_config_list(
113 &self,
114 addr: CheetahString,
115 topic_config_list: Vec<TopicConfig>,
116 ) -> crate::ClientResult<()>;
117
118 async fn examine_topic_stats(
119 &self,
120 topic: CheetahString,
121 broker_addr: Option<CheetahString>,
122 ) -> crate::ClientResult<TopicStatsTable>;
123
124 async fn examine_topic_stats_concurrent(&self, topic: CheetahString) -> AdminToolResult<TopicStatsTable>;
125
126 async fn fetch_all_topic_list(&self) -> crate::ClientResult<TopicList>;
127
128 async fn fetch_topics_by_cluster(&self, cluster_name: CheetahString) -> crate::ClientResult<TopicList>;
129
130 async fn examine_topic_route_info(&self, topic: CheetahString) -> crate::ClientResult<Option<TopicRouteData>>;
131
132 async fn delete_topic(&self, topic_name: CheetahString, cluster_name: CheetahString) -> crate::ClientResult<()>;
133
134 async fn delete_topic_in_broker(
135 &self,
136 addrs: HashSet<CheetahString>,
137 topic: CheetahString,
138 ) -> crate::ClientResult<()>;
139
140 async fn delete_topic_in_broker_list(
141 &self,
142 addrs: HashSet<CheetahString>,
143 topics: Vec<CheetahString>,
144 ) -> crate::ClientResult<()>;
145 #[allow(deprecated)]
146 async fn delete_topic_in_broker_concurrent(
147 &self,
148 addrs: HashSet<CheetahString>,
149 topic: CheetahString,
150 ) -> AdminToolResult<BrokerOperatorResult>;
151
152 async fn delete_topic_in_name_server(
153 &self,
154 addrs: HashSet<CheetahString>,
155 cluster_name: Option<CheetahString>,
156 topic: CheetahString,
157 ) -> crate::ClientResult<()>;
158
159 async fn create_or_update_order_conf(
160 &self,
161 key: CheetahString,
162 value: CheetahString,
163 is_cluster: bool,
164 ) -> crate::ClientResult<()>;
165
166 async fn query_topic_consume_by_who(&self, topic: CheetahString) -> crate::ClientResult<GroupList>;
167
168 async fn query_topics_by_consumer(&self, group: CheetahString) -> crate::ClientResult<TopicList>;
169
170 async fn query_topics_by_consumer_concurrent(&self, group: CheetahString) -> AdminToolResult<TopicList>;
171
172 async fn clean_unused_topic(
173 &self,
174 cluster: Option<CheetahString>,
175 addr: Option<CheetahString>,
176 ) -> crate::ClientResult<bool>;
177
178 async fn clean_unused_topic_by_addr(&self, addr: CheetahString) -> crate::ClientResult<bool>;
179
180 async fn get_topic_cluster_list(&self, topic: String) -> crate::ClientResult<HashSet<CheetahString>>;
181
182 async fn get_all_topic_config(
183 &self,
184 broker_addr: CheetahString,
185 timeout_millis: u64,
186 ) -> crate::ClientResult<TopicConfigSerializeWrapper>;
187
188 async fn set_message_request_mode(
189 &self,
190 broker_addr: CheetahString,
191 topic: CheetahString,
192 consumer_group: CheetahString,
193 mode: MessageRequestMode,
194 pop_work_group_size: i32,
195 timeout_millis: u64,
196 ) -> crate::ClientResult<()>;
197
198 async fn examine_topic_config(&self, addr: CheetahString, topic: CheetahString)
199 -> crate::ClientResult<TopicConfig>;
200
201 async fn create_static_topic(
202 &self,
203 addr: CheetahString,
204 default_topic: CheetahString,
205 topic_config: TopicConfig,
206 mapping_detail: TopicQueueMappingDetail,
207 force: bool,
208 ) -> crate::ClientResult<()>;
209
210 async fn create_lite_pull_topic(
211 &self,
212 addr: CheetahString,
213 topic: CheetahString,
214 queue_num: i32,
215 topic_sys_flag: i32,
216 read_queue_nums: i32,
217 write_queue_nums: i32,
218 ) -> crate::ClientResult<()>;
219
220 async fn update_lite_pull_topic(
221 &self,
222 addr: CheetahString,
223 topic: CheetahString,
224 read_queue_nums: i32,
225 write_queue_nums: i32,
226 ) -> crate::ClientResult<()>;
227
228 async fn get_lite_pull_topic(&self, addr: CheetahString, topic: CheetahString) -> crate::ClientResult<TopicConfig>;
229
230 async fn delete_lite_pull_topic(
231 &self,
232 addr: CheetahString,
233 cluster_name: CheetahString,
234 topic: CheetahString,
235 ) -> crate::ClientResult<()>;
236
237 async fn query_lite_pull_topic_list(&self, addr: CheetahString) -> crate::ClientResult<TopicList>;
238
239 async fn query_lite_pull_topic_by_cluster(&self, cluster_name: CheetahString) -> crate::ClientResult<TopicList>;
240
241 async fn get_topic_config_by_topic_name(
242 &self,
243 broker_addr: CheetahString,
244 topic_name: CheetahString,
245 ) -> crate::ClientResult<TopicConfig>;
246
247 async fn get_topic_stats_info(
248 &self,
249 broker_addr: CheetahString,
250 topic: CheetahString,
251 ) -> crate::ClientResult<TopicStatsTable>;
252
253 async fn query_broker_has_topic(
254 &self,
255 broker_addr: CheetahString,
256 topic: CheetahString,
257 ) -> crate::ClientResult<bool>;
258
259 async fn get_system_topic_list_from_broker(&self, broker_addr: CheetahString) -> crate::ClientResult<TopicList>;
260
261 async fn examine_topic_route_info_with_timeout(
262 &self,
263 topic: CheetahString,
264 timeout_millis: u64,
265 ) -> crate::ClientResult<Option<TopicRouteData>>;
266
267 async fn get_parent_topic_info(
268 &self,
269 broker_addr: CheetahString,
270 topic: CheetahString,
271 ) -> crate::ClientResult<GetParentTopicInfoResponseBody>;
272
273 async fn get_lite_topic_info(
274 &self,
275 broker_addr: CheetahString,
276 parent_topic: CheetahString,
277 lite_topic: CheetahString,
278 ) -> crate::ClientResult<GetLiteTopicInfoResponseBody>;
279}
280
281#[allow(dead_code, reason = "command families consume selected capability methods")]
282#[allow(async_fn_in_trait)]
283pub trait ConsumerAdmin: Send {
284 async fn create_and_update_subscription_group_config(
285 &self,
286 addr: CheetahString,
287 config: SubscriptionGroupConfig,
288 ) -> crate::ClientResult<()>;
289
290 async fn create_and_update_subscription_group_config_list(
291 &self,
292 broker_addr: CheetahString,
293 configs: Vec<SubscriptionGroupConfig>,
294 ) -> crate::ClientResult<()>;
295
296 async fn examine_subscription_group_config(
297 &self,
298 addr: CheetahString,
299 group: CheetahString,
300 ) -> crate::ClientResult<SubscriptionGroupConfig>;
301
302 async fn examine_consume_stats(
303 &self,
304 consumer_group: CheetahString,
305 topic: Option<CheetahString>,
306 cluster_name: Option<CheetahString>,
307 broker_addr: Option<CheetahString>,
308 timeout_millis: Option<u64>,
309 ) -> crate::ClientResult<ConsumeStats>;
310
311 async fn examine_consumer_connection_info(
312 &self,
313 consumer_group: CheetahString,
314 broker_addr: Option<CheetahString>,
315 ) -> crate::ClientResult<ConsumerConnection>;
316
317 async fn examine_producer_connection_info(
318 &self,
319 producer_group: CheetahString,
320 topic: CheetahString,
321 ) -> crate::ClientResult<ProducerConnection>;
322
323 async fn get_all_producer_info(&self, broker_addr: CheetahString) -> crate::ClientResult<ProducerTableInfo>;
324
325 async fn delete_subscription_group(
326 &self,
327 addr: CheetahString,
328 group_name: CheetahString,
329 remove_offset: Option<bool>,
330 ) -> crate::ClientResult<()>;
331
332 async fn delete_subscription_group_list(
333 &self,
334 addr: CheetahString,
335 group_names: Vec<CheetahString>,
336 clean_offset: bool,
337 ) -> crate::ClientResult<()>;
338
339 async fn get_consume_status(
340 &self,
341 topic: CheetahString,
342 group: CheetahString,
343 client_addr: CheetahString,
344 ) -> crate::ClientResult<HashMap<CheetahString, HashMap<MessageQueue, u64>>>;
345
346 async fn query_subscription(
347 &self,
348 group: CheetahString,
349 topic: CheetahString,
350 ) -> crate::ClientResult<SubscriptionData>;
351
352 async fn clean_expired_consumer_queue(
353 &self,
354 cluster: Option<CheetahString>,
355 addr: Option<CheetahString>,
356 ) -> crate::ClientResult<bool>;
357
358 async fn clean_expired_consumer_queue_by_addr(&self, addr: CheetahString) -> crate::ClientResult<bool>;
359
360 async fn get_consumer_running_info(
361 &self,
362 consumer_group: CheetahString,
363 client_id: CheetahString,
364 jstack: bool,
365 metrics: Option<bool>,
366 ) -> crate::ClientResult<ConsumerRunningInfo>;
367
368 async fn consume_message_directly(
369 &self,
370 consumer_group: CheetahString,
371 client_id: CheetahString,
372 topic: CheetahString,
373 msg_id: CheetahString,
374 ) -> crate::ClientResult<ConsumeMessageDirectlyResult>;
375
376 async fn consume_message_directly_ext(
377 &self,
378 cluster_name: CheetahString,
379 consumer_group: CheetahString,
380 client_id: CheetahString,
381 topic: CheetahString,
382 msg_id: CheetahString,
383 ) -> crate::ClientResult<ConsumeMessageDirectlyResult>;
384 #[allow(deprecated)]
385 async fn message_track_detail(&self, msg: MessageExt) -> crate::ClientResult<Vec<MessageTrack>>;
386 #[allow(deprecated)]
387 async fn message_track_detail_concurrent(&self, msg: MessageExt) -> AdminToolResult<Vec<MessageTrack>>;
388
389 async fn fetch_consume_stats_in_broker(
390 &self,
391 broker_addr: CheetahString,
392 is_order: bool,
393 timeout_millis: u64,
394 ) -> crate::ClientResult<ConsumeStatsList>;
395
396 async fn get_all_subscription_group(
397 &self,
398 broker_addr: CheetahString,
399 timeout_millis: u64,
400 ) -> crate::ClientResult<SubscriptionGroupWrapper>;
401
402 async fn query_consume_queue(
403 &self,
404 broker_addr: CheetahString,
405 topic: CheetahString,
406 queue_id: i32,
407 index: u64,
408 count: i32,
409 consumer_group: CheetahString,
410 ) -> crate::ClientResult<QueryConsumeQueueResponseBody>;
411
412 async fn update_and_get_group_read_forbidden(
413 &self,
414 broker_addr: CheetahString,
415 group_name: CheetahString,
416 topic_name: CheetahString,
417 readable: Option<bool>,
418 ) -> crate::ClientResult<GroupForbidden>;
419
420 async fn query_message(
421 &self,
422 cluster_name: CheetahString,
423 topic: CheetahString,
424 msg_id: CheetahString,
425 ) -> crate::ClientResult<MessageExt>;
426
427 async fn update_cold_data_flow_ctr_group_config(
428 &self,
429 broker_addr: CheetahString,
430 properties: HashMap<CheetahString, CheetahString>,
431 ) -> crate::ClientResult<()>;
432
433 async fn remove_cold_data_flow_ctr_group_config(
434 &self,
435 broker_addr: CheetahString,
436 consumer_group: CheetahString,
437 ) -> crate::ClientResult<()>;
438
439 async fn query_lite_pull_subscription_list(
440 &self,
441 addr: CheetahString,
442 topic: CheetahString,
443 ) -> crate::ClientResult<GroupList>;
444
445 async fn examine_consume_stats_with_queue(
446 &self,
447 consumer_group: CheetahString,
448 topic: Option<CheetahString>,
449 queue_id: Option<i32>,
450 ) -> crate::ClientResult<ConsumeStats>;
451
452 async fn examine_consume_stats_concurrent(
453 &self,
454 consumer_group: CheetahString,
455 topic: Option<CheetahString>,
456 ) -> AdminToolResult<ConsumeStats>;
457
458 async fn examine_consume_stats_concurrent_with_cluster(
459 &self,
460 consumer_group: CheetahString,
461 topic: Option<CheetahString>,
462 cluster_name: Option<CheetahString>,
463 ) -> AdminToolResult<ConsumeStats>;
464
465 async fn sync_broker_member_group(
466 &self,
467 controller_addr: CheetahString,
468 cluster_name: CheetahString,
469 broker_name: CheetahString,
470 ) -> crate::ClientResult<()>;
471
472 async fn get_lite_group_info(
473 &self,
474 broker_addr: CheetahString,
475 group: CheetahString,
476 lite_topic: CheetahString,
477 top_k: i32,
478 ) -> crate::ClientResult<GetLiteGroupInfoResponseBody>;
479}
480
481#[allow(dead_code, reason = "command families consume selected capability methods")]
482#[allow(async_fn_in_trait)]
483pub trait BrokerAdmin: Send {
484 async fn start(&mut self) -> crate::ClientResult<()>;
485 async fn shutdown(&mut self);
486 async fn add_broker_to_container(
487 &self,
488 broker_container_addr: CheetahString,
489 broker_config: CheetahString,
490 ) -> crate::ClientResult<()>;
491
492 async fn remove_broker_from_container(
493 &self,
494 broker_container_addr: CheetahString,
495 cluster_name: CheetahString,
496 broker_name: CheetahString,
497 broker_id: u64,
498 ) -> crate::ClientResult<()>;
499
500 async fn update_broker_config(
501 &self,
502 broker_addr: CheetahString,
503 properties: HashMap<CheetahString, CheetahString>,
504 ) -> crate::ClientResult<()>;
505
506 async fn get_broker_config(
507 &self,
508 broker_addr: CheetahString,
509 ) -> crate::ClientResult<HashMap<CheetahString, CheetahString>>;
510
511 async fn fetch_broker_runtime_stats(&self, broker_addr: CheetahString) -> crate::ClientResult<KVTable>;
512
513 async fn check_rocksdb_cq_write_progress(
514 &self,
515 broker_addr: CheetahString,
516 topic: CheetahString,
517 check_store_time: i64,
518 ) -> crate::ClientResult<CheckRocksdbCqWriteResult>;
519
520 async fn wipe_write_perm_of_broker(
521 &self,
522 namesrv_addr: CheetahString,
523 broker_name: CheetahString,
524 ) -> crate::ClientResult<i32>;
525
526 async fn add_write_perm_of_broker(
527 &self,
528 namesrv_addr: CheetahString,
529 broker_name: CheetahString,
530 ) -> crate::ClientResult<i32>;
531
532 async fn view_broker_stats_data(
533 &self,
534 broker_addr: CheetahString,
535 stats_name: CheetahString,
536 stats_key: CheetahString,
537 ) -> crate::ClientResult<BrokerStatsData>;
538
539 async fn resume_check_half_message(&self, topic: CheetahString, msg_id: CheetahString)
540 -> crate::ClientResult<bool>;
541
542 async fn get_broker_ha_status(&self, broker_addr: CheetahString) -> crate::ClientResult<HARuntimeInfo>;
543
544 async fn get_in_sync_state_data(
545 &self,
546 controller_address: CheetahString,
547 brokers: Vec<CheetahString>,
548 ) -> crate::ClientResult<BrokerReplicasInfo>;
549
550 async fn get_broker_epoch_cache(&self, broker_addr: CheetahString) -> crate::ClientResult<EpochEntryCache>;
551
552 async fn get_controller_meta_data(
553 &self,
554 controller_addr: CheetahString,
555 ) -> crate::ClientResult<GetMetaDataResponseHeader>;
556
557 async fn get_controller_config(
558 &self,
559 controller_servers: Vec<CheetahString>,
560 ) -> crate::ClientResult<HashMap<CheetahString, HashMap<CheetahString, CheetahString>>>;
561
562 async fn update_controller_config(
563 &self,
564 properties: HashMap<CheetahString, CheetahString>,
565 controllers: Vec<CheetahString>,
566 ) -> crate::ClientResult<()>;
567
568 async fn elect_master(
569 &self,
570 controller_addr: CheetahString,
571 cluster_name: CheetahString,
572 broker_name: CheetahString,
573 broker_id: Option<u64>,
574 ) -> crate::ClientResult<(ElectMasterResponseHeader, BrokerMemberGroup)>;
575
576 async fn clean_controller_broker_data(
577 &self,
578 controller_addr: CheetahString,
579 cluster_name: CheetahString,
580 broker_name: CheetahString,
581 broker_controller_ids_to_clean: Option<CheetahString>,
582 is_clean_living_broker: bool,
583 ) -> crate::ClientResult<()>;
584
585 async fn get_cold_data_flow_ctr_info(&self, broker_addr: CheetahString) -> crate::ClientResult<CheetahString>;
586
587 async fn notify_min_broker_id_changed(
588 &self,
589 cluster_name: CheetahString,
590 broker_name: CheetahString,
591 min_broker_id: u64,
592 min_broker_addr: CheetahString,
593 offline_broker_addr: Option<CheetahString>,
594 ha_broker_addr: Option<CheetahString>,
595 ) -> crate::ClientResult<()>;
596
597 async fn export_pop_records(&self, broker_addr: CheetahString, timeout: u64) -> crate::ClientResult<()>;
598
599 async fn switch_timer_engine(
600 &self,
601 broker_addr: CheetahString,
602 des_timer_engine: CheetahString,
603 ) -> crate::ClientResult<()>;
604
605 async fn get_broker_lite_info(
606 &self,
607 broker_addr: CheetahString,
608 ) -> crate::ClientResult<GetBrokerLiteInfoResponseBody>;
609
610 async fn get_lite_client_info(
611 &self,
612 broker_addr: CheetahString,
613 parent_topic: CheetahString,
614 group: CheetahString,
615 client_id: CheetahString,
616 ) -> crate::ClientResult<GetLiteClientInfoResponseBody>;
617
618 async fn trigger_lite_dispatch(
619 &self,
620 broker_addr: CheetahString,
621 group: CheetahString,
622 client_id: CheetahString,
623 ) -> crate::ClientResult<()>;
624
625 async fn export_rocksdb_config_to_json(
626 &self,
627 broker_addr: CheetahString,
628 config_types: Vec<CheetahString>,
629 ) -> crate::ClientResult<()>;
630}
631
632#[allow(dead_code, reason = "command families consume selected capability methods")]
633#[allow(async_fn_in_trait)]
634pub trait AuthAdmin: Send {
635 async fn create_and_update_plain_access_config(
636 &self,
637 addr: CheetahString,
638 config: PlainAccessConfig,
639 ) -> crate::ClientResult<()>;
640
641 async fn delete_plain_access_config(
642 &self,
643 addr: CheetahString,
644 access_key: CheetahString,
645 ) -> crate::ClientResult<()>;
646
647 async fn update_global_white_addr_config(
648 &self,
649 addr: CheetahString,
650 global_white_addrs: CheetahString,
651 acl_file_full_path: Option<CheetahString>,
652 ) -> crate::ClientResult<()>;
653
654 async fn examine_broker_cluster_acl_version_info(&self, addr: CheetahString) -> crate::ClientResult<CheetahString>;
655
656 async fn get_user_subscription_group(
657 &self,
658 broker_addr: CheetahString,
659 timeout_millis: u64,
660 ) -> crate::ClientResult<SubscriptionGroupWrapper>;
661
662 async fn get_user_topic_config(
663 &self,
664 broker_addr: CheetahString,
665 special_topic: bool,
666 timeout_millis: u64,
667 ) -> crate::ClientResult<TopicConfigSerializeWrapper>;
668
669 async fn create_user(
670 &self,
671 broker_addr: CheetahString,
672 username: CheetahString,
673 password: CheetahString,
674 user_type: CheetahString,
675 ) -> crate::ClientResult<()>;
676
677 async fn create_user_with_info(
678 &self,
679 broker_addr: CheetahString,
680 username: CheetahString,
681 password: CheetahString,
682 ) -> crate::ClientResult<()>;
683
684 async fn update_user(
685 &self,
686 broker_addr: CheetahString,
687 username: CheetahString,
688 password: CheetahString,
689 user_type: CheetahString,
690 user_status: CheetahString,
691 ) -> crate::ClientResult<()>;
692
693 async fn update_user_with_info(
694 &self,
695 broker_addr: CheetahString,
696 username: CheetahString,
697 password: CheetahString,
698 ) -> crate::ClientResult<()>;
699
700 async fn delete_user(&self, broker_addr: CheetahString, username: CheetahString) -> crate::ClientResult<()>;
701
702 async fn get_user(
703 &self,
704 broker_addr: CheetahString,
705 username: CheetahString,
706 ) -> crate::ClientResult<Option<UserInfo>>;
707
708 async fn list_users(&self, broker_addr: CheetahString, filter: CheetahString)
709 -> crate::ClientResult<Vec<UserInfo>>;
710
711 async fn list_user(&self, broker_addr: CheetahString, filter: CheetahString) -> crate::ClientResult<Vec<UserInfo>> {
712 self.list_users(broker_addr, filter).await
713 }
714
715 async fn create_acl(
716 &self,
717 broker_addr: CheetahString,
718 subject: CheetahString,
719 resources: Vec<CheetahString>,
720 actions: Vec<CheetahString>,
721 source_ips: Vec<CheetahString>,
722 decision: CheetahString,
723 ) -> crate::ClientResult<()>;
724
725 async fn create_acl_with_info(&self, broker_addr: CheetahString, subject: CheetahString)
726 -> crate::ClientResult<()>;
727
728 async fn update_acl(
729 &self,
730 broker_addr: CheetahString,
731 subject: CheetahString,
732 resources: Vec<CheetahString>,
733 actions: Vec<CheetahString>,
734 source_ips: Vec<CheetahString>,
735 decision: CheetahString,
736 ) -> crate::ClientResult<()>;
737
738 async fn update_acl_with_info(&self, broker_addr: CheetahString, subject: CheetahString)
739 -> crate::ClientResult<()>;
740
741 async fn delete_acl(
742 &self,
743 broker_addr: CheetahString,
744 subject: CheetahString,
745 resource: CheetahString,
746 ) -> crate::ClientResult<()>;
747
748 async fn delete_acl_entry(
754 &self,
755 broker_addr: CheetahString,
756 subject: CheetahString,
757 policy_type: CheetahString,
758 resource: CheetahString,
759 ) -> crate::ClientResult<()> {
760 let _ = (broker_addr, subject, policy_type, resource);
761 Err(crate::ClientError::illegal_argument(
762 "Typed ACL entry deletion is not supported by this admin implementation",
763 ))
764 }
765
766 async fn get_acl(&self, broker_addr: CheetahString, subject: CheetahString) -> crate::ClientResult<AclInfo>;
767
768 async fn list_acl(
769 &self,
770 broker_addr: CheetahString,
771 subject_filter: CheetahString,
772 resource_filter: CheetahString,
773 ) -> crate::ClientResult<Vec<AclInfo>>;
774}
775
776#[allow(dead_code, reason = "command families consume selected capability methods")]
777#[allow(async_fn_in_trait)]
778pub trait OffsetAdmin: Send {
779 async fn reset_offset_by_timestamp_old(
780 &self,
781 cluster_name: Option<CheetahString>,
782 consumer_group: CheetahString,
783 topic: CheetahString,
784 timestamp: u64,
785 force: bool,
786 ) -> crate::ClientResult<Vec<RollbackStats>>;
787
788 async fn reset_offset_by_timestamp(
789 &self,
790 cluster_name: Option<CheetahString>,
791 topic: CheetahString,
792 group: CheetahString,
793 timestamp: u64,
794 is_force: bool,
795 ) -> crate::ClientResult<HashMap<MessageQueue, u64>>;
796
797 async fn reset_offset_new(
798 &self,
799 consumer_group: CheetahString,
800 topic: CheetahString,
801 timestamp: u64,
802 ) -> crate::ClientResult<()>;
803 #[allow(deprecated)]
804 async fn reset_offset_new_concurrent(
805 &self,
806 group: CheetahString,
807 topic: CheetahString,
808 timestamp: u64,
809 ) -> AdminToolResult<BrokerOperatorResult>;
810
811 async fn query_consume_time_span(
812 &self,
813 topic: CheetahString,
814 group: CheetahString,
815 ) -> crate::ClientResult<Vec<QueueTimeSpan>>;
816
817 async fn query_consume_time_span_concurrent(
818 &self,
819 topic: CheetahString,
820 group: CheetahString,
821 ) -> AdminToolResult<Vec<QueueTimeSpan>>;
822
823 async fn delete_expired_commit_log(
824 &self,
825 cluster: Option<CheetahString>,
826 addr: Option<CheetahString>,
827 ) -> crate::ClientResult<bool>;
828
829 async fn delete_expired_commit_log_by_addr(&self, addr: CheetahString) -> crate::ClientResult<bool>;
830
831 async fn clone_group_offset(
832 &self,
833 src_group: CheetahString,
834 dest_group: CheetahString,
835 topic: CheetahString,
836 is_offline: bool,
837 ) -> crate::ClientResult<()>;
838
839 async fn update_consume_offset(
840 &self,
841 broker_addr: CheetahString,
842 consume_group: CheetahString,
843 mq: MessageQueue,
844 offset: u64,
845 ) -> crate::ClientResult<()>;
846
847 async fn reset_offset_by_queue_id(
848 &self,
849 broker_addr: CheetahString,
850 consumer_group: CheetahString,
851 topic_name: CheetahString,
852 queue_id: i32,
853 reset_offset: u64,
854 ) -> crate::ClientResult<()>;
855
856 async fn reset_master_flush_offset(
857 &self,
858 broker_addr: CheetahString,
859 master_flush_offset: u64,
860 ) -> crate::ClientResult<()>;
861
862 async fn set_commit_log_read_ahead_mode(
863 &self,
864 broker_addr: CheetahString,
865 mode: CheetahString,
866 ) -> crate::ClientResult<CheetahString>;
867
868 async fn update_lite_pull_consumer_offset(
869 &self,
870 addr: CheetahString,
871 topic: CheetahString,
872 group: CheetahString,
873 queue_id: i32,
874 offset: u64,
875 ) -> crate::ClientResult<()>;
876
877 async fn export_rocksdb_consumer_offset_to_json(
878 &self,
879 broker_addr: CheetahString,
880 file_path: CheetahString,
881 ) -> crate::ClientResult<()>;
882
883 async fn export_rocksdb_consumer_offset_from_memory(
884 &self,
885 broker_addr: CheetahString,
886 ) -> crate::ClientResult<CheetahString>;
887
888 async fn search_offset(
889 &self,
890 broker_addr: CheetahString,
891 topic_name: CheetahString,
892 queue_id: i32,
893 timestamp: u64,
894 timeout_millis: u64,
895 ) -> crate::ClientResult<u64>;
896
897 async fn min_offset(
898 &self,
899 broker_addr: CheetahString,
900 message_queue: MessageQueue,
901 timeout_millis: u64,
902 ) -> crate::ClientResult<i64>;
903
904 async fn max_offset(
905 &self,
906 broker_addr: CheetahString,
907 message_queue: MessageQueue,
908 timeout_millis: u64,
909 ) -> crate::ClientResult<i64>;
910}
911
912#[allow(deprecated)]
913impl RouteAdmin for crate::admin::default_mq_admin_ext::DefaultMQAdminExt {
914 async fn examine_broker_cluster_info(&self) -> crate::ClientResult<ClusterInfo> {
915 RouteAdmin::examine_broker_cluster_info(self.inner()).await
916 }
917
918 async fn get_name_server_address_list(&self) -> Vec<CheetahString> {
919 RouteAdmin::get_name_server_address_list(self.inner()).await
920 }
921
922 async fn put_kv_config(&self, namespace: CheetahString, key: CheetahString, value: CheetahString) {
923 RouteAdmin::put_kv_config(self.inner(), namespace, key, value).await
924 }
925
926 async fn get_kv_config(&self, namespace: CheetahString, key: CheetahString) -> crate::ClientResult<CheetahString> {
927 RouteAdmin::get_kv_config(self.inner(), namespace, key).await
928 }
929
930 async fn get_kv_list_by_namespace(&self, namespace: CheetahString) -> crate::ClientResult<KVTable> {
931 RouteAdmin::get_kv_list_by_namespace(self.inner(), namespace).await
932 }
933
934 async fn create_and_update_kv_config(
935 &self,
936 namespace: CheetahString,
937 key: CheetahString,
938 value: CheetahString,
939 ) -> crate::ClientResult<()> {
940 RouteAdmin::create_and_update_kv_config(self.inner(), namespace, key, value).await
941 }
942
943 async fn delete_kv_config(&self, namespace: CheetahString, key: CheetahString) -> crate::ClientResult<()> {
944 RouteAdmin::delete_kv_config(self.inner(), namespace, key).await
945 }
946
947 async fn get_cluster_list(&self, topic: String) -> crate::ClientResult<HashSet<CheetahString>> {
948 RouteAdmin::get_cluster_list(self.inner(), topic).await
949 }
950
951 async fn update_name_server_config(
952 &self,
953 properties: HashMap<CheetahString, CheetahString>,
954 name_servers: Option<Vec<CheetahString>>,
955 ) -> crate::ClientResult<()> {
956 RouteAdmin::update_name_server_config(self.inner(), properties, name_servers).await
957 }
958
959 async fn get_name_server_config(
960 &self,
961 name_servers: Vec<CheetahString>,
962 ) -> crate::ClientResult<HashMap<CheetahString, HashMap<CheetahString, CheetahString>>> {
963 RouteAdmin::get_name_server_config(self.inner(), name_servers).await
964 }
965
966 async fn probe_name_server(&self, name_server: CheetahString) -> crate::ClientResult<()> {
967 RouteAdmin::probe_name_server(self.inner(), name_server).await
968 }
969}
970
971impl TopicAdmin for crate::admin::default_mq_admin_ext::DefaultMQAdminExt {
972 async fn create_and_update_topic_config(
973 &self,
974 addr: CheetahString,
975 config: TopicConfig,
976 ) -> crate::ClientResult<()> {
977 TopicAdmin::create_and_update_topic_config(self.inner(), addr, config).await
978 }
979
980 async fn create_and_update_topic_config_list(
981 &self,
982 addr: CheetahString,
983 topic_config_list: Vec<TopicConfig>,
984 ) -> crate::ClientResult<()> {
985 TopicAdmin::create_and_update_topic_config_list(self.inner(), addr, topic_config_list).await
986 }
987
988 async fn examine_topic_stats(
989 &self,
990 topic: CheetahString,
991 broker_addr: Option<CheetahString>,
992 ) -> crate::ClientResult<TopicStatsTable> {
993 TopicAdmin::examine_topic_stats(self.inner(), topic, broker_addr).await
994 }
995
996 async fn examine_topic_stats_concurrent(&self, topic: CheetahString) -> AdminToolResult<TopicStatsTable> {
997 TopicAdmin::examine_topic_stats_concurrent(self.inner(), topic).await
998 }
999
1000 async fn fetch_all_topic_list(&self) -> crate::ClientResult<TopicList> {
1001 TopicAdmin::fetch_all_topic_list(self.inner()).await
1002 }
1003
1004 async fn fetch_topics_by_cluster(&self, cluster_name: CheetahString) -> crate::ClientResult<TopicList> {
1005 TopicAdmin::fetch_topics_by_cluster(self.inner(), cluster_name).await
1006 }
1007
1008 async fn examine_topic_route_info(&self, topic: CheetahString) -> crate::ClientResult<Option<TopicRouteData>> {
1009 TopicAdmin::examine_topic_route_info(self.inner(), topic).await
1010 }
1011
1012 async fn delete_topic(&self, topic_name: CheetahString, cluster_name: CheetahString) -> crate::ClientResult<()> {
1013 TopicAdmin::delete_topic(self.inner(), topic_name, cluster_name).await
1014 }
1015
1016 async fn delete_topic_in_broker(
1017 &self,
1018 addrs: HashSet<CheetahString>,
1019 topic: CheetahString,
1020 ) -> crate::ClientResult<()> {
1021 TopicAdmin::delete_topic_in_broker(self.inner(), addrs, topic).await
1022 }
1023
1024 async fn delete_topic_in_broker_list(
1025 &self,
1026 addrs: HashSet<CheetahString>,
1027 topics: Vec<CheetahString>,
1028 ) -> crate::ClientResult<()> {
1029 TopicAdmin::delete_topic_in_broker_list(self.inner(), addrs, topics).await
1030 }
1031
1032 #[allow(deprecated)]
1033 async fn delete_topic_in_broker_concurrent(
1034 &self,
1035 addrs: HashSet<CheetahString>,
1036 topic: CheetahString,
1037 ) -> AdminToolResult<BrokerOperatorResult> {
1038 TopicAdmin::delete_topic_in_broker_concurrent(self.inner(), addrs, topic).await
1039 }
1040
1041 async fn delete_topic_in_name_server(
1042 &self,
1043 addrs: HashSet<CheetahString>,
1044 cluster_name: Option<CheetahString>,
1045 topic: CheetahString,
1046 ) -> crate::ClientResult<()> {
1047 TopicAdmin::delete_topic_in_name_server(self.inner(), addrs, cluster_name, topic).await
1048 }
1049
1050 async fn create_or_update_order_conf(
1051 &self,
1052 key: CheetahString,
1053 value: CheetahString,
1054 is_cluster: bool,
1055 ) -> crate::ClientResult<()> {
1056 TopicAdmin::create_or_update_order_conf(self.inner(), key, value, is_cluster).await
1057 }
1058
1059 async fn query_topic_consume_by_who(&self, topic: CheetahString) -> crate::ClientResult<GroupList> {
1060 TopicAdmin::query_topic_consume_by_who(self.inner(), topic).await
1061 }
1062
1063 async fn query_topics_by_consumer(&self, group: CheetahString) -> crate::ClientResult<TopicList> {
1064 TopicAdmin::query_topics_by_consumer(self.inner(), group).await
1065 }
1066
1067 async fn query_topics_by_consumer_concurrent(&self, group: CheetahString) -> AdminToolResult<TopicList> {
1068 TopicAdmin::query_topics_by_consumer_concurrent(self.inner(), group).await
1069 }
1070
1071 async fn clean_unused_topic(
1072 &self,
1073 cluster: Option<CheetahString>,
1074 addr: Option<CheetahString>,
1075 ) -> crate::ClientResult<bool> {
1076 TopicAdmin::clean_unused_topic(self.inner(), cluster, addr).await
1077 }
1078
1079 async fn clean_unused_topic_by_addr(&self, addr: CheetahString) -> crate::ClientResult<bool> {
1080 TopicAdmin::clean_unused_topic_by_addr(self.inner(), addr).await
1081 }
1082
1083 async fn get_topic_cluster_list(&self, topic: String) -> crate::ClientResult<HashSet<CheetahString>> {
1084 TopicAdmin::get_topic_cluster_list(self.inner(), topic).await
1085 }
1086
1087 async fn get_all_topic_config(
1088 &self,
1089 broker_addr: CheetahString,
1090 timeout_millis: u64,
1091 ) -> crate::ClientResult<TopicConfigSerializeWrapper> {
1092 TopicAdmin::get_all_topic_config(self.inner(), broker_addr, timeout_millis).await
1093 }
1094
1095 async fn set_message_request_mode(
1096 &self,
1097 broker_addr: CheetahString,
1098 topic: CheetahString,
1099 consumer_group: CheetahString,
1100 mode: MessageRequestMode,
1101 pop_work_group_size: i32,
1102 timeout_millis: u64,
1103 ) -> crate::ClientResult<()> {
1104 TopicAdmin::set_message_request_mode(
1105 self.inner(),
1106 broker_addr,
1107 topic,
1108 consumer_group,
1109 mode,
1110 pop_work_group_size,
1111 timeout_millis,
1112 )
1113 .await
1114 }
1115
1116 async fn examine_topic_config(
1117 &self,
1118 addr: CheetahString,
1119 topic: CheetahString,
1120 ) -> crate::ClientResult<TopicConfig> {
1121 TopicAdmin::examine_topic_config(self.inner(), addr, topic).await
1122 }
1123
1124 async fn create_static_topic(
1125 &self,
1126 addr: CheetahString,
1127 default_topic: CheetahString,
1128 topic_config: TopicConfig,
1129 mapping_detail: TopicQueueMappingDetail,
1130 force: bool,
1131 ) -> crate::ClientResult<()> {
1132 TopicAdmin::create_static_topic(self.inner(), addr, default_topic, topic_config, mapping_detail, force).await
1133 }
1134
1135 async fn create_lite_pull_topic(
1136 &self,
1137 addr: CheetahString,
1138 topic: CheetahString,
1139 queue_num: i32,
1140 topic_sys_flag: i32,
1141 read_queue_nums: i32,
1142 write_queue_nums: i32,
1143 ) -> crate::ClientResult<()> {
1144 TopicAdmin::create_lite_pull_topic(
1145 self.inner(),
1146 addr,
1147 topic,
1148 queue_num,
1149 topic_sys_flag,
1150 read_queue_nums,
1151 write_queue_nums,
1152 )
1153 .await
1154 }
1155
1156 async fn update_lite_pull_topic(
1157 &self,
1158 addr: CheetahString,
1159 topic: CheetahString,
1160 read_queue_nums: i32,
1161 write_queue_nums: i32,
1162 ) -> crate::ClientResult<()> {
1163 TopicAdmin::update_lite_pull_topic(self.inner(), addr, topic, read_queue_nums, write_queue_nums).await
1164 }
1165
1166 async fn get_lite_pull_topic(&self, addr: CheetahString, topic: CheetahString) -> crate::ClientResult<TopicConfig> {
1167 TopicAdmin::get_lite_pull_topic(self.inner(), addr, topic).await
1168 }
1169
1170 async fn delete_lite_pull_topic(
1171 &self,
1172 addr: CheetahString,
1173 cluster_name: CheetahString,
1174 topic: CheetahString,
1175 ) -> crate::ClientResult<()> {
1176 TopicAdmin::delete_lite_pull_topic(self.inner(), addr, cluster_name, topic).await
1177 }
1178
1179 async fn query_lite_pull_topic_list(&self, addr: CheetahString) -> crate::ClientResult<TopicList> {
1180 TopicAdmin::query_lite_pull_topic_list(self.inner(), addr).await
1181 }
1182
1183 async fn query_lite_pull_topic_by_cluster(&self, cluster_name: CheetahString) -> crate::ClientResult<TopicList> {
1184 TopicAdmin::query_lite_pull_topic_by_cluster(self.inner(), cluster_name).await
1185 }
1186
1187 async fn get_topic_config_by_topic_name(
1188 &self,
1189 broker_addr: CheetahString,
1190 topic_name: CheetahString,
1191 ) -> crate::ClientResult<TopicConfig> {
1192 TopicAdmin::get_topic_config_by_topic_name(self.inner(), broker_addr, topic_name).await
1193 }
1194
1195 async fn get_topic_stats_info(
1196 &self,
1197 broker_addr: CheetahString,
1198 topic: CheetahString,
1199 ) -> crate::ClientResult<TopicStatsTable> {
1200 TopicAdmin::get_topic_stats_info(self.inner(), broker_addr, topic).await
1201 }
1202
1203 async fn query_broker_has_topic(
1204 &self,
1205 broker_addr: CheetahString,
1206 topic: CheetahString,
1207 ) -> crate::ClientResult<bool> {
1208 TopicAdmin::query_broker_has_topic(self.inner(), broker_addr, topic).await
1209 }
1210
1211 async fn get_system_topic_list_from_broker(&self, broker_addr: CheetahString) -> crate::ClientResult<TopicList> {
1212 TopicAdmin::get_system_topic_list_from_broker(self.inner(), broker_addr).await
1213 }
1214
1215 async fn examine_topic_route_info_with_timeout(
1216 &self,
1217 topic: CheetahString,
1218 timeout_millis: u64,
1219 ) -> crate::ClientResult<Option<TopicRouteData>> {
1220 TopicAdmin::examine_topic_route_info_with_timeout(self.inner(), topic, timeout_millis).await
1221 }
1222
1223 async fn get_parent_topic_info(
1224 &self,
1225 broker_addr: CheetahString,
1226 topic: CheetahString,
1227 ) -> crate::ClientResult<GetParentTopicInfoResponseBody> {
1228 TopicAdmin::get_parent_topic_info(self.inner(), broker_addr, topic).await
1229 }
1230
1231 async fn get_lite_topic_info(
1232 &self,
1233 broker_addr: CheetahString,
1234 parent_topic: CheetahString,
1235 lite_topic: CheetahString,
1236 ) -> crate::ClientResult<GetLiteTopicInfoResponseBody> {
1237 TopicAdmin::get_lite_topic_info(self.inner(), broker_addr, parent_topic, lite_topic).await
1238 }
1239}
1240
1241impl ConsumerAdmin for crate::admin::default_mq_admin_ext::DefaultMQAdminExt {
1242 async fn create_and_update_subscription_group_config(
1243 &self,
1244 addr: CheetahString,
1245 config: SubscriptionGroupConfig,
1246 ) -> crate::ClientResult<()> {
1247 ConsumerAdmin::create_and_update_subscription_group_config(self.inner(), addr, config).await
1248 }
1249
1250 async fn create_and_update_subscription_group_config_list(
1251 &self,
1252 broker_addr: CheetahString,
1253 configs: Vec<SubscriptionGroupConfig>,
1254 ) -> crate::ClientResult<()> {
1255 ConsumerAdmin::create_and_update_subscription_group_config_list(self.inner(), broker_addr, configs).await
1256 }
1257
1258 async fn examine_subscription_group_config(
1259 &self,
1260 addr: CheetahString,
1261 group: CheetahString,
1262 ) -> crate::ClientResult<SubscriptionGroupConfig> {
1263 ConsumerAdmin::examine_subscription_group_config(self.inner(), addr, group).await
1264 }
1265
1266 async fn examine_consume_stats(
1267 &self,
1268 consumer_group: CheetahString,
1269 topic: Option<CheetahString>,
1270 cluster_name: Option<CheetahString>,
1271 broker_addr: Option<CheetahString>,
1272 timeout_millis: Option<u64>,
1273 ) -> crate::ClientResult<ConsumeStats> {
1274 ConsumerAdmin::examine_consume_stats(
1275 self.inner(),
1276 consumer_group,
1277 topic,
1278 cluster_name,
1279 broker_addr,
1280 timeout_millis,
1281 )
1282 .await
1283 }
1284
1285 async fn examine_consumer_connection_info(
1286 &self,
1287 consumer_group: CheetahString,
1288 broker_addr: Option<CheetahString>,
1289 ) -> crate::ClientResult<ConsumerConnection> {
1290 ConsumerAdmin::examine_consumer_connection_info(self.inner(), consumer_group, broker_addr).await
1291 }
1292
1293 async fn examine_producer_connection_info(
1294 &self,
1295 producer_group: CheetahString,
1296 topic: CheetahString,
1297 ) -> crate::ClientResult<ProducerConnection> {
1298 ConsumerAdmin::examine_producer_connection_info(self.inner(), producer_group, topic).await
1299 }
1300
1301 async fn get_all_producer_info(&self, broker_addr: CheetahString) -> crate::ClientResult<ProducerTableInfo> {
1302 ConsumerAdmin::get_all_producer_info(self.inner(), broker_addr).await
1303 }
1304
1305 async fn delete_subscription_group(
1306 &self,
1307 addr: CheetahString,
1308 group_name: CheetahString,
1309 remove_offset: Option<bool>,
1310 ) -> crate::ClientResult<()> {
1311 ConsumerAdmin::delete_subscription_group(self.inner(), addr, group_name, remove_offset).await
1312 }
1313
1314 async fn delete_subscription_group_list(
1315 &self,
1316 addr: CheetahString,
1317 group_names: Vec<CheetahString>,
1318 clean_offset: bool,
1319 ) -> crate::ClientResult<()> {
1320 ConsumerAdmin::delete_subscription_group_list(self.inner(), addr, group_names, clean_offset).await
1321 }
1322
1323 async fn get_consume_status(
1324 &self,
1325 topic: CheetahString,
1326 group: CheetahString,
1327 client_addr: CheetahString,
1328 ) -> crate::ClientResult<HashMap<CheetahString, HashMap<MessageQueue, u64>>> {
1329 ConsumerAdmin::get_consume_status(self.inner(), topic, group, client_addr).await
1330 }
1331
1332 async fn query_subscription(
1333 &self,
1334 group: CheetahString,
1335 topic: CheetahString,
1336 ) -> crate::ClientResult<SubscriptionData> {
1337 ConsumerAdmin::query_subscription(self.inner(), group, topic).await
1338 }
1339
1340 async fn clean_expired_consumer_queue(
1341 &self,
1342 cluster: Option<CheetahString>,
1343 addr: Option<CheetahString>,
1344 ) -> crate::ClientResult<bool> {
1345 ConsumerAdmin::clean_expired_consumer_queue(self.inner(), cluster, addr).await
1346 }
1347
1348 async fn clean_expired_consumer_queue_by_addr(&self, addr: CheetahString) -> crate::ClientResult<bool> {
1349 ConsumerAdmin::clean_expired_consumer_queue_by_addr(self.inner(), addr).await
1350 }
1351
1352 async fn get_consumer_running_info(
1353 &self,
1354 consumer_group: CheetahString,
1355 client_id: CheetahString,
1356 jstack: bool,
1357 metrics: Option<bool>,
1358 ) -> crate::ClientResult<ConsumerRunningInfo> {
1359 ConsumerAdmin::get_consumer_running_info(self.inner(), consumer_group, client_id, jstack, metrics).await
1360 }
1361
1362 async fn consume_message_directly(
1363 &self,
1364 consumer_group: CheetahString,
1365 client_id: CheetahString,
1366 topic: CheetahString,
1367 msg_id: CheetahString,
1368 ) -> crate::ClientResult<ConsumeMessageDirectlyResult> {
1369 ConsumerAdmin::consume_message_directly(self.inner(), consumer_group, client_id, topic, msg_id).await
1370 }
1371
1372 async fn consume_message_directly_ext(
1373 &self,
1374 cluster_name: CheetahString,
1375 consumer_group: CheetahString,
1376 client_id: CheetahString,
1377 topic: CheetahString,
1378 msg_id: CheetahString,
1379 ) -> crate::ClientResult<ConsumeMessageDirectlyResult> {
1380 ConsumerAdmin::consume_message_directly_ext(
1381 self.inner(),
1382 cluster_name,
1383 consumer_group,
1384 client_id,
1385 topic,
1386 msg_id,
1387 )
1388 .await
1389 }
1390
1391 #[allow(deprecated)]
1392 async fn message_track_detail(&self, msg: MessageExt) -> crate::ClientResult<Vec<MessageTrack>> {
1393 ConsumerAdmin::message_track_detail(self.inner(), msg).await
1394 }
1395
1396 #[allow(deprecated)]
1397 async fn message_track_detail_concurrent(&self, msg: MessageExt) -> AdminToolResult<Vec<MessageTrack>> {
1398 ConsumerAdmin::message_track_detail_concurrent(self.inner(), msg).await
1399 }
1400
1401 async fn fetch_consume_stats_in_broker(
1402 &self,
1403 broker_addr: CheetahString,
1404 is_order: bool,
1405 timeout_millis: u64,
1406 ) -> crate::ClientResult<ConsumeStatsList> {
1407 ConsumerAdmin::fetch_consume_stats_in_broker(self.inner(), broker_addr, is_order, timeout_millis).await
1408 }
1409
1410 async fn get_all_subscription_group(
1411 &self,
1412 broker_addr: CheetahString,
1413 timeout_millis: u64,
1414 ) -> crate::ClientResult<SubscriptionGroupWrapper> {
1415 ConsumerAdmin::get_all_subscription_group(self.inner(), broker_addr, timeout_millis).await
1416 }
1417
1418 async fn query_consume_queue(
1419 &self,
1420 broker_addr: CheetahString,
1421 topic: CheetahString,
1422 queue_id: i32,
1423 index: u64,
1424 count: i32,
1425 consumer_group: CheetahString,
1426 ) -> crate::ClientResult<QueryConsumeQueueResponseBody> {
1427 ConsumerAdmin::query_consume_queue(self.inner(), broker_addr, topic, queue_id, index, count, consumer_group)
1428 .await
1429 }
1430
1431 async fn update_and_get_group_read_forbidden(
1432 &self,
1433 broker_addr: CheetahString,
1434 group_name: CheetahString,
1435 topic_name: CheetahString,
1436 readable: Option<bool>,
1437 ) -> crate::ClientResult<GroupForbidden> {
1438 ConsumerAdmin::update_and_get_group_read_forbidden(self.inner(), broker_addr, group_name, topic_name, readable)
1439 .await
1440 }
1441
1442 async fn query_message(
1443 &self,
1444 cluster_name: CheetahString,
1445 topic: CheetahString,
1446 msg_id: CheetahString,
1447 ) -> crate::ClientResult<MessageExt> {
1448 ConsumerAdmin::query_message(self.inner(), cluster_name, topic, msg_id).await
1449 }
1450
1451 async fn update_cold_data_flow_ctr_group_config(
1452 &self,
1453 broker_addr: CheetahString,
1454 properties: HashMap<CheetahString, CheetahString>,
1455 ) -> crate::ClientResult<()> {
1456 ConsumerAdmin::update_cold_data_flow_ctr_group_config(self.inner(), broker_addr, properties).await
1457 }
1458
1459 async fn remove_cold_data_flow_ctr_group_config(
1460 &self,
1461 broker_addr: CheetahString,
1462 consumer_group: CheetahString,
1463 ) -> crate::ClientResult<()> {
1464 ConsumerAdmin::remove_cold_data_flow_ctr_group_config(self.inner(), broker_addr, consumer_group).await
1465 }
1466
1467 async fn query_lite_pull_subscription_list(
1468 &self,
1469 addr: CheetahString,
1470 topic: CheetahString,
1471 ) -> crate::ClientResult<GroupList> {
1472 ConsumerAdmin::query_lite_pull_subscription_list(self.inner(), addr, topic).await
1473 }
1474
1475 async fn examine_consume_stats_with_queue(
1476 &self,
1477 consumer_group: CheetahString,
1478 topic: Option<CheetahString>,
1479 queue_id: Option<i32>,
1480 ) -> crate::ClientResult<ConsumeStats> {
1481 ConsumerAdmin::examine_consume_stats_with_queue(self.inner(), consumer_group, topic, queue_id).await
1482 }
1483
1484 async fn examine_consume_stats_concurrent(
1485 &self,
1486 consumer_group: CheetahString,
1487 topic: Option<CheetahString>,
1488 ) -> AdminToolResult<ConsumeStats> {
1489 ConsumerAdmin::examine_consume_stats_concurrent(self.inner(), consumer_group, topic).await
1490 }
1491
1492 async fn examine_consume_stats_concurrent_with_cluster(
1493 &self,
1494 consumer_group: CheetahString,
1495 topic: Option<CheetahString>,
1496 cluster_name: Option<CheetahString>,
1497 ) -> AdminToolResult<ConsumeStats> {
1498 ConsumerAdmin::examine_consume_stats_concurrent_with_cluster(self.inner(), consumer_group, topic, cluster_name)
1499 .await
1500 }
1501
1502 async fn sync_broker_member_group(
1503 &self,
1504 controller_addr: CheetahString,
1505 cluster_name: CheetahString,
1506 broker_name: CheetahString,
1507 ) -> crate::ClientResult<()> {
1508 ConsumerAdmin::sync_broker_member_group(self.inner(), controller_addr, cluster_name, broker_name).await
1509 }
1510
1511 async fn get_lite_group_info(
1512 &self,
1513 broker_addr: CheetahString,
1514 group: CheetahString,
1515 lite_topic: CheetahString,
1516 top_k: i32,
1517 ) -> crate::ClientResult<GetLiteGroupInfoResponseBody> {
1518 ConsumerAdmin::get_lite_group_info(self.inner(), broker_addr, group, lite_topic, top_k).await
1519 }
1520}
1521
1522impl BrokerAdmin for crate::admin::default_mq_admin_ext::DefaultMQAdminExt {
1523 async fn start(&mut self) -> crate::ClientResult<()> {
1524 BrokerAdmin::start(self.inner_mut()).await
1525 }
1526
1527 async fn shutdown(&mut self) {
1528 BrokerAdmin::shutdown(self.inner_mut()).await
1529 }
1530
1531 async fn add_broker_to_container(
1532 &self,
1533 broker_container_addr: CheetahString,
1534 broker_config: CheetahString,
1535 ) -> crate::ClientResult<()> {
1536 BrokerAdmin::add_broker_to_container(self.inner(), broker_container_addr, broker_config).await
1537 }
1538
1539 async fn remove_broker_from_container(
1540 &self,
1541 broker_container_addr: CheetahString,
1542 cluster_name: CheetahString,
1543 broker_name: CheetahString,
1544 broker_id: u64,
1545 ) -> crate::ClientResult<()> {
1546 BrokerAdmin::remove_broker_from_container(
1547 self.inner(),
1548 broker_container_addr,
1549 cluster_name,
1550 broker_name,
1551 broker_id,
1552 )
1553 .await
1554 }
1555
1556 async fn update_broker_config(
1557 &self,
1558 broker_addr: CheetahString,
1559 properties: HashMap<CheetahString, CheetahString>,
1560 ) -> crate::ClientResult<()> {
1561 BrokerAdmin::update_broker_config(self.inner(), broker_addr, properties).await
1562 }
1563
1564 async fn get_broker_config(
1565 &self,
1566 broker_addr: CheetahString,
1567 ) -> crate::ClientResult<HashMap<CheetahString, CheetahString>> {
1568 BrokerAdmin::get_broker_config(self.inner(), broker_addr).await
1569 }
1570
1571 async fn fetch_broker_runtime_stats(&self, broker_addr: CheetahString) -> crate::ClientResult<KVTable> {
1572 BrokerAdmin::fetch_broker_runtime_stats(self.inner(), broker_addr).await
1573 }
1574
1575 async fn check_rocksdb_cq_write_progress(
1576 &self,
1577 broker_addr: CheetahString,
1578 topic: CheetahString,
1579 check_store_time: i64,
1580 ) -> crate::ClientResult<CheckRocksdbCqWriteResult> {
1581 BrokerAdmin::check_rocksdb_cq_write_progress(self.inner(), broker_addr, topic, check_store_time).await
1582 }
1583
1584 async fn wipe_write_perm_of_broker(
1585 &self,
1586 namesrv_addr: CheetahString,
1587 broker_name: CheetahString,
1588 ) -> crate::ClientResult<i32> {
1589 BrokerAdmin::wipe_write_perm_of_broker(self.inner(), namesrv_addr, broker_name).await
1590 }
1591
1592 async fn add_write_perm_of_broker(
1593 &self,
1594 namesrv_addr: CheetahString,
1595 broker_name: CheetahString,
1596 ) -> crate::ClientResult<i32> {
1597 BrokerAdmin::add_write_perm_of_broker(self.inner(), namesrv_addr, broker_name).await
1598 }
1599
1600 async fn view_broker_stats_data(
1601 &self,
1602 broker_addr: CheetahString,
1603 stats_name: CheetahString,
1604 stats_key: CheetahString,
1605 ) -> crate::ClientResult<BrokerStatsData> {
1606 BrokerAdmin::view_broker_stats_data(self.inner(), broker_addr, stats_name, stats_key).await
1607 }
1608
1609 async fn resume_check_half_message(
1610 &self,
1611 topic: CheetahString,
1612 msg_id: CheetahString,
1613 ) -> crate::ClientResult<bool> {
1614 BrokerAdmin::resume_check_half_message(self.inner(), topic, msg_id).await
1615 }
1616
1617 async fn get_broker_ha_status(&self, broker_addr: CheetahString) -> crate::ClientResult<HARuntimeInfo> {
1618 BrokerAdmin::get_broker_ha_status(self.inner(), broker_addr).await
1619 }
1620
1621 async fn get_in_sync_state_data(
1622 &self,
1623 controller_address: CheetahString,
1624 brokers: Vec<CheetahString>,
1625 ) -> crate::ClientResult<BrokerReplicasInfo> {
1626 BrokerAdmin::get_in_sync_state_data(self.inner(), controller_address, brokers).await
1627 }
1628
1629 async fn get_broker_epoch_cache(&self, broker_addr: CheetahString) -> crate::ClientResult<EpochEntryCache> {
1630 BrokerAdmin::get_broker_epoch_cache(self.inner(), broker_addr).await
1631 }
1632
1633 async fn get_controller_meta_data(
1634 &self,
1635 controller_addr: CheetahString,
1636 ) -> crate::ClientResult<GetMetaDataResponseHeader> {
1637 BrokerAdmin::get_controller_meta_data(self.inner(), controller_addr).await
1638 }
1639
1640 async fn get_controller_config(
1641 &self,
1642 controller_servers: Vec<CheetahString>,
1643 ) -> crate::ClientResult<HashMap<CheetahString, HashMap<CheetahString, CheetahString>>> {
1644 BrokerAdmin::get_controller_config(self.inner(), controller_servers).await
1645 }
1646
1647 async fn update_controller_config(
1648 &self,
1649 properties: HashMap<CheetahString, CheetahString>,
1650 controllers: Vec<CheetahString>,
1651 ) -> crate::ClientResult<()> {
1652 BrokerAdmin::update_controller_config(self.inner(), properties, controllers).await
1653 }
1654
1655 async fn elect_master(
1656 &self,
1657 controller_addr: CheetahString,
1658 cluster_name: CheetahString,
1659 broker_name: CheetahString,
1660 broker_id: Option<u64>,
1661 ) -> crate::ClientResult<(ElectMasterResponseHeader, BrokerMemberGroup)> {
1662 BrokerAdmin::elect_master(self.inner(), controller_addr, cluster_name, broker_name, broker_id).await
1663 }
1664
1665 async fn clean_controller_broker_data(
1666 &self,
1667 controller_addr: CheetahString,
1668 cluster_name: CheetahString,
1669 broker_name: CheetahString,
1670 broker_controller_ids_to_clean: Option<CheetahString>,
1671 is_clean_living_broker: bool,
1672 ) -> crate::ClientResult<()> {
1673 BrokerAdmin::clean_controller_broker_data(
1674 self.inner(),
1675 controller_addr,
1676 cluster_name,
1677 broker_name,
1678 broker_controller_ids_to_clean,
1679 is_clean_living_broker,
1680 )
1681 .await
1682 }
1683
1684 async fn get_cold_data_flow_ctr_info(&self, broker_addr: CheetahString) -> crate::ClientResult<CheetahString> {
1685 BrokerAdmin::get_cold_data_flow_ctr_info(self.inner(), broker_addr).await
1686 }
1687
1688 async fn notify_min_broker_id_changed(
1689 &self,
1690 cluster_name: CheetahString,
1691 broker_name: CheetahString,
1692 min_broker_id: u64,
1693 min_broker_addr: CheetahString,
1694 offline_broker_addr: Option<CheetahString>,
1695 ha_broker_addr: Option<CheetahString>,
1696 ) -> crate::ClientResult<()> {
1697 BrokerAdmin::notify_min_broker_id_changed(
1698 self.inner(),
1699 cluster_name,
1700 broker_name,
1701 min_broker_id,
1702 min_broker_addr,
1703 offline_broker_addr,
1704 ha_broker_addr,
1705 )
1706 .await
1707 }
1708
1709 async fn export_pop_records(&self, broker_addr: CheetahString, timeout: u64) -> crate::ClientResult<()> {
1710 BrokerAdmin::export_pop_records(self.inner(), broker_addr, timeout).await
1711 }
1712
1713 async fn switch_timer_engine(
1714 &self,
1715 broker_addr: CheetahString,
1716 des_timer_engine: CheetahString,
1717 ) -> crate::ClientResult<()> {
1718 BrokerAdmin::switch_timer_engine(self.inner(), broker_addr, des_timer_engine).await
1719 }
1720
1721 async fn get_broker_lite_info(
1722 &self,
1723 broker_addr: CheetahString,
1724 ) -> crate::ClientResult<GetBrokerLiteInfoResponseBody> {
1725 BrokerAdmin::get_broker_lite_info(self.inner(), broker_addr).await
1726 }
1727
1728 async fn get_lite_client_info(
1729 &self,
1730 broker_addr: CheetahString,
1731 parent_topic: CheetahString,
1732 group: CheetahString,
1733 client_id: CheetahString,
1734 ) -> crate::ClientResult<GetLiteClientInfoResponseBody> {
1735 BrokerAdmin::get_lite_client_info(self.inner(), broker_addr, parent_topic, group, client_id).await
1736 }
1737
1738 async fn trigger_lite_dispatch(
1739 &self,
1740 broker_addr: CheetahString,
1741 group: CheetahString,
1742 client_id: CheetahString,
1743 ) -> crate::ClientResult<()> {
1744 BrokerAdmin::trigger_lite_dispatch(self.inner(), broker_addr, group, client_id).await
1745 }
1746
1747 async fn export_rocksdb_config_to_json(
1748 &self,
1749 broker_addr: CheetahString,
1750 config_types: Vec<CheetahString>,
1751 ) -> crate::ClientResult<()> {
1752 BrokerAdmin::export_rocksdb_config_to_json(self.inner(), broker_addr, config_types).await
1753 }
1754}
1755
1756impl AuthAdmin for crate::admin::default_mq_admin_ext::DefaultMQAdminExt {
1757 async fn create_and_update_plain_access_config(
1758 &self,
1759 addr: CheetahString,
1760 config: PlainAccessConfig,
1761 ) -> crate::ClientResult<()> {
1762 AuthAdmin::create_and_update_plain_access_config(self.inner(), addr, config).await
1763 }
1764
1765 async fn delete_plain_access_config(
1766 &self,
1767 addr: CheetahString,
1768 access_key: CheetahString,
1769 ) -> crate::ClientResult<()> {
1770 AuthAdmin::delete_plain_access_config(self.inner(), addr, access_key).await
1771 }
1772
1773 async fn update_global_white_addr_config(
1774 &self,
1775 addr: CheetahString,
1776 global_white_addrs: CheetahString,
1777 acl_file_full_path: Option<CheetahString>,
1778 ) -> crate::ClientResult<()> {
1779 AuthAdmin::update_global_white_addr_config(self.inner(), addr, global_white_addrs, acl_file_full_path).await
1780 }
1781
1782 async fn examine_broker_cluster_acl_version_info(&self, addr: CheetahString) -> crate::ClientResult<CheetahString> {
1783 AuthAdmin::examine_broker_cluster_acl_version_info(self.inner(), addr).await
1784 }
1785
1786 async fn get_user_subscription_group(
1787 &self,
1788 broker_addr: CheetahString,
1789 timeout_millis: u64,
1790 ) -> crate::ClientResult<SubscriptionGroupWrapper> {
1791 AuthAdmin::get_user_subscription_group(self.inner(), broker_addr, timeout_millis).await
1792 }
1793
1794 async fn get_user_topic_config(
1795 &self,
1796 broker_addr: CheetahString,
1797 special_topic: bool,
1798 timeout_millis: u64,
1799 ) -> crate::ClientResult<TopicConfigSerializeWrapper> {
1800 AuthAdmin::get_user_topic_config(self.inner(), broker_addr, special_topic, timeout_millis).await
1801 }
1802
1803 async fn create_user(
1804 &self,
1805 broker_addr: CheetahString,
1806 username: CheetahString,
1807 password: CheetahString,
1808 user_type: CheetahString,
1809 ) -> crate::ClientResult<()> {
1810 AuthAdmin::create_user(self.inner(), broker_addr, username, password, user_type).await
1811 }
1812
1813 async fn create_user_with_info(
1814 &self,
1815 broker_addr: CheetahString,
1816 username: CheetahString,
1817 password: CheetahString,
1818 ) -> crate::ClientResult<()> {
1819 AuthAdmin::create_user_with_info(self.inner(), broker_addr, username, password).await
1820 }
1821
1822 async fn update_user(
1823 &self,
1824 broker_addr: CheetahString,
1825 username: CheetahString,
1826 password: CheetahString,
1827 user_type: CheetahString,
1828 user_status: CheetahString,
1829 ) -> crate::ClientResult<()> {
1830 AuthAdmin::update_user(self.inner(), broker_addr, username, password, user_type, user_status).await
1831 }
1832
1833 async fn update_user_with_info(
1834 &self,
1835 broker_addr: CheetahString,
1836 username: CheetahString,
1837 password: CheetahString,
1838 ) -> crate::ClientResult<()> {
1839 AuthAdmin::update_user_with_info(self.inner(), broker_addr, username, password).await
1840 }
1841
1842 async fn delete_user(&self, broker_addr: CheetahString, username: CheetahString) -> crate::ClientResult<()> {
1843 AuthAdmin::delete_user(self.inner(), broker_addr, username).await
1844 }
1845
1846 async fn get_user(
1847 &self,
1848 broker_addr: CheetahString,
1849 username: CheetahString,
1850 ) -> crate::ClientResult<Option<UserInfo>> {
1851 AuthAdmin::get_user(self.inner(), broker_addr, username).await
1852 }
1853
1854 async fn list_users(
1855 &self,
1856 broker_addr: CheetahString,
1857 filter: CheetahString,
1858 ) -> crate::ClientResult<Vec<UserInfo>> {
1859 AuthAdmin::list_users(self.inner(), broker_addr, filter).await
1860 }
1861
1862 async fn create_acl(
1863 &self,
1864 broker_addr: CheetahString,
1865 subject: CheetahString,
1866 resources: Vec<CheetahString>,
1867 actions: Vec<CheetahString>,
1868 source_ips: Vec<CheetahString>,
1869 decision: CheetahString,
1870 ) -> crate::ClientResult<()> {
1871 AuthAdmin::create_acl(
1872 self.inner(),
1873 broker_addr,
1874 subject,
1875 resources,
1876 actions,
1877 source_ips,
1878 decision,
1879 )
1880 .await
1881 }
1882
1883 async fn create_acl_with_info(
1884 &self,
1885 broker_addr: CheetahString,
1886 subject: CheetahString,
1887 ) -> crate::ClientResult<()> {
1888 AuthAdmin::create_acl_with_info(self.inner(), broker_addr, subject).await
1889 }
1890
1891 async fn update_acl(
1892 &self,
1893 broker_addr: CheetahString,
1894 subject: CheetahString,
1895 resources: Vec<CheetahString>,
1896 actions: Vec<CheetahString>,
1897 source_ips: Vec<CheetahString>,
1898 decision: CheetahString,
1899 ) -> crate::ClientResult<()> {
1900 AuthAdmin::update_acl(
1901 self.inner(),
1902 broker_addr,
1903 subject,
1904 resources,
1905 actions,
1906 source_ips,
1907 decision,
1908 )
1909 .await
1910 }
1911
1912 async fn update_acl_with_info(
1913 &self,
1914 broker_addr: CheetahString,
1915 subject: CheetahString,
1916 ) -> crate::ClientResult<()> {
1917 AuthAdmin::update_acl_with_info(self.inner(), broker_addr, subject).await
1918 }
1919
1920 async fn delete_acl(
1921 &self,
1922 broker_addr: CheetahString,
1923 subject: CheetahString,
1924 resource: CheetahString,
1925 ) -> crate::ClientResult<()> {
1926 AuthAdmin::delete_acl(self.inner(), broker_addr, subject, resource).await
1927 }
1928
1929 async fn delete_acl_entry(
1930 &self,
1931 broker_addr: CheetahString,
1932 subject: CheetahString,
1933 policy_type: CheetahString,
1934 resource: CheetahString,
1935 ) -> crate::ClientResult<()> {
1936 AuthAdmin::delete_acl_entry(self.inner(), broker_addr, subject, policy_type, resource).await
1937 }
1938
1939 async fn get_acl(&self, broker_addr: CheetahString, subject: CheetahString) -> crate::ClientResult<AclInfo> {
1940 AuthAdmin::get_acl(self.inner(), broker_addr, subject).await
1941 }
1942
1943 async fn list_acl(
1944 &self,
1945 broker_addr: CheetahString,
1946 subject_filter: CheetahString,
1947 resource_filter: CheetahString,
1948 ) -> crate::ClientResult<Vec<AclInfo>> {
1949 AuthAdmin::list_acl(self.inner(), broker_addr, subject_filter, resource_filter).await
1950 }
1951}
1952
1953impl OffsetAdmin for crate::admin::default_mq_admin_ext::DefaultMQAdminExt {
1954 async fn reset_offset_by_timestamp_old(
1955 &self,
1956 cluster_name: Option<CheetahString>,
1957 consumer_group: CheetahString,
1958 topic: CheetahString,
1959 timestamp: u64,
1960 force: bool,
1961 ) -> crate::ClientResult<Vec<RollbackStats>> {
1962 OffsetAdmin::reset_offset_by_timestamp_old(self.inner(), cluster_name, consumer_group, topic, timestamp, force)
1963 .await
1964 }
1965
1966 async fn reset_offset_by_timestamp(
1967 &self,
1968 cluster_name: Option<CheetahString>,
1969 topic: CheetahString,
1970 group: CheetahString,
1971 timestamp: u64,
1972 is_force: bool,
1973 ) -> crate::ClientResult<HashMap<MessageQueue, u64>> {
1974 OffsetAdmin::reset_offset_by_timestamp(self.inner(), cluster_name, topic, group, timestamp, is_force).await
1975 }
1976
1977 async fn reset_offset_new(
1978 &self,
1979 consumer_group: CheetahString,
1980 topic: CheetahString,
1981 timestamp: u64,
1982 ) -> crate::ClientResult<()> {
1983 OffsetAdmin::reset_offset_new(self.inner(), consumer_group, topic, timestamp).await
1984 }
1985
1986 #[allow(deprecated)]
1987 async fn reset_offset_new_concurrent(
1988 &self,
1989 group: CheetahString,
1990 topic: CheetahString,
1991 timestamp: u64,
1992 ) -> AdminToolResult<BrokerOperatorResult> {
1993 OffsetAdmin::reset_offset_new_concurrent(self.inner(), group, topic, timestamp).await
1994 }
1995
1996 async fn query_consume_time_span(
1997 &self,
1998 topic: CheetahString,
1999 group: CheetahString,
2000 ) -> crate::ClientResult<Vec<QueueTimeSpan>> {
2001 OffsetAdmin::query_consume_time_span(self.inner(), topic, group).await
2002 }
2003
2004 async fn query_consume_time_span_concurrent(
2005 &self,
2006 topic: CheetahString,
2007 group: CheetahString,
2008 ) -> AdminToolResult<Vec<QueueTimeSpan>> {
2009 OffsetAdmin::query_consume_time_span_concurrent(self.inner(), topic, group).await
2010 }
2011
2012 async fn delete_expired_commit_log(
2013 &self,
2014 cluster: Option<CheetahString>,
2015 addr: Option<CheetahString>,
2016 ) -> crate::ClientResult<bool> {
2017 OffsetAdmin::delete_expired_commit_log(self.inner(), cluster, addr).await
2018 }
2019
2020 async fn delete_expired_commit_log_by_addr(&self, addr: CheetahString) -> crate::ClientResult<bool> {
2021 OffsetAdmin::delete_expired_commit_log_by_addr(self.inner(), addr).await
2022 }
2023
2024 async fn clone_group_offset(
2025 &self,
2026 src_group: CheetahString,
2027 dest_group: CheetahString,
2028 topic: CheetahString,
2029 is_offline: bool,
2030 ) -> crate::ClientResult<()> {
2031 OffsetAdmin::clone_group_offset(self.inner(), src_group, dest_group, topic, is_offline).await
2032 }
2033
2034 async fn update_consume_offset(
2035 &self,
2036 broker_addr: CheetahString,
2037 consume_group: CheetahString,
2038 mq: MessageQueue,
2039 offset: u64,
2040 ) -> crate::ClientResult<()> {
2041 OffsetAdmin::update_consume_offset(self.inner(), broker_addr, consume_group, mq, offset).await
2042 }
2043
2044 async fn reset_offset_by_queue_id(
2045 &self,
2046 broker_addr: CheetahString,
2047 consumer_group: CheetahString,
2048 topic_name: CheetahString,
2049 queue_id: i32,
2050 reset_offset: u64,
2051 ) -> crate::ClientResult<()> {
2052 OffsetAdmin::reset_offset_by_queue_id(
2053 self.inner(),
2054 broker_addr,
2055 consumer_group,
2056 topic_name,
2057 queue_id,
2058 reset_offset,
2059 )
2060 .await
2061 }
2062
2063 async fn reset_master_flush_offset(
2064 &self,
2065 broker_addr: CheetahString,
2066 master_flush_offset: u64,
2067 ) -> crate::ClientResult<()> {
2068 OffsetAdmin::reset_master_flush_offset(self.inner(), broker_addr, master_flush_offset).await
2069 }
2070
2071 async fn set_commit_log_read_ahead_mode(
2072 &self,
2073 broker_addr: CheetahString,
2074 mode: CheetahString,
2075 ) -> crate::ClientResult<CheetahString> {
2076 OffsetAdmin::set_commit_log_read_ahead_mode(self.inner(), broker_addr, mode).await
2077 }
2078
2079 async fn update_lite_pull_consumer_offset(
2080 &self,
2081 addr: CheetahString,
2082 topic: CheetahString,
2083 group: CheetahString,
2084 queue_id: i32,
2085 offset: u64,
2086 ) -> crate::ClientResult<()> {
2087 OffsetAdmin::update_lite_pull_consumer_offset(self.inner(), addr, topic, group, queue_id, offset).await
2088 }
2089
2090 async fn export_rocksdb_consumer_offset_to_json(
2091 &self,
2092 broker_addr: CheetahString,
2093 file_path: CheetahString,
2094 ) -> crate::ClientResult<()> {
2095 OffsetAdmin::export_rocksdb_consumer_offset_to_json(self.inner(), broker_addr, file_path).await
2096 }
2097
2098 async fn export_rocksdb_consumer_offset_from_memory(
2099 &self,
2100 broker_addr: CheetahString,
2101 ) -> crate::ClientResult<CheetahString> {
2102 OffsetAdmin::export_rocksdb_consumer_offset_from_memory(self.inner(), broker_addr).await
2103 }
2104
2105 async fn search_offset(
2106 &self,
2107 broker_addr: CheetahString,
2108 topic_name: CheetahString,
2109 queue_id: i32,
2110 timestamp: u64,
2111 timeout_millis: u64,
2112 ) -> crate::ClientResult<u64> {
2113 OffsetAdmin::search_offset(
2114 self.inner(),
2115 broker_addr,
2116 topic_name,
2117 queue_id,
2118 timestamp,
2119 timeout_millis,
2120 )
2121 .await
2122 }
2123
2124 async fn min_offset(
2125 &self,
2126 broker_addr: CheetahString,
2127 message_queue: MessageQueue,
2128 timeout_millis: u64,
2129 ) -> crate::ClientResult<i64> {
2130 OffsetAdmin::min_offset(self.inner(), broker_addr, message_queue, timeout_millis).await
2131 }
2132
2133 async fn max_offset(
2134 &self,
2135 broker_addr: CheetahString,
2136 message_queue: MessageQueue,
2137 timeout_millis: u64,
2138 ) -> crate::ClientResult<i64> {
2139 OffsetAdmin::max_offset(self.inner(), broker_addr, message_queue, timeout_millis).await
2140 }
2141}