rocketmq_client_rust/admin/default_mq_admin_ext_impl/controller_read.rs
1// Copyright 2026 The RocketMQ Rust Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15use cheetah_string::CheetahString;
16use rocketmq_protocol::protocol::body::controller_rollout::RolloutQuorumStatus;
17
18use super::DefaultMQAdminExtImpl;
19use crate::ClientResult;
20
21impl DefaultMQAdminExtImpl {
22 /// Uses this admin session's credentials and transport for a fresh rollout check.
23 ///
24 /// # Errors
25 ///
26 /// Fails if the session is stopped or the current leader cannot confirm the remaining quorum.
27 pub async fn check_controller_rollout(
28 &self,
29 controller_address: CheetahString,
30 target_node_id: u64,
31 ) -> ClientResult<RolloutQuorumStatus> {
32 self.mq_client_api()?
33 .check_controller_rollout(controller_address, target_node_id, self.remoting_timeout_millis()?)
34 .await
35 }
36}