diff --git a/rocketmq-client/src/implementation/mq_client_api_impl.rs b/rocketmq-client/src/implementation/mq_client_api_impl.rs index 5c403377..8654ad25 100644 --- a/rocketmq-client/src/implementation/mq_client_api_impl.rs +++ b/rocketmq-client/src/implementation/mq_client_api_impl.rs @@ -241,10 +241,10 @@ impl MQClientAPIImpl { )) } } - return Err(MQClientError::MQClientErr( + Err(MQClientError::MQClientErr( code, result.remark().cloned().unwrap_or_default(), - )); + )) } Err(err) => Err(MQClientError::RemotingError(err)), } diff --git a/rocketmq-common/src/common/config_manager.rs b/rocketmq-common/src/common/config_manager.rs index 5cba07e2..6fda47f9 100644 --- a/rocketmq-common/src/common/config_manager.rs +++ b/rocketmq-common/src/common/config_manager.rs @@ -64,7 +64,7 @@ pub trait ConfigManager { /// * `false` if the configuration loading fails. fn load_bak(&self) -> bool { let file_name = self.config_file_path(); - return if let Ok(ref content) = + if let Ok(ref content) = FileUtils::file_to_string(format!("{}{}", file_name, ".bak").as_str()) { if !content.is_empty() { @@ -75,7 +75,7 @@ pub trait ConfigManager { } else { error!("load Config file: {}.bak -----Failed", file_name); false - }; + } } /// Persists the configuration with a topic. diff --git a/rocketmq-store/src/queue/batch_consume_queue.rs b/rocketmq-store/src/queue/batch_consume_queue.rs index c8285b7e..1f7a51b6 100644 --- a/rocketmq-store/src/queue/batch_consume_queue.rs +++ b/rocketmq-store/src/queue/batch_consume_queue.rs @@ -58,7 +58,6 @@ const INVALID_POS: i32 = -1; /// BatchConsumeQueue's store unit. Size: /// CommitLog Physical Offset(8) + Body Size(4) + Tag HashCode(8) + Store time(8) + /// msgBaseOffset(8) + batchSize(2) + compactedOffset(4) + reserved(4)= 46 Bytes - pub struct BatchConsumeQueue { message_store_config: Arc, mapped_file_queue: MappedFileQueue, diff --git a/rocketmq-store/src/queue/single_consume_queue.rs b/rocketmq-store/src/queue/single_consume_queue.rs index 7f5dd840..4ae07319 100644 --- a/rocketmq-store/src/queue/single_consume_queue.rs +++ b/rocketmq-store/src/queue/single_consume_queue.rs @@ -50,6 +50,9 @@ use crate::queue::FileQueueLifeCycle; use crate::store::running_flags::RunningFlags; use crate::store_path_config_helper::get_store_path_consume_queue_ext; +pub const CQ_STORE_UNIT_SIZE: i32 = 20; +pub const MSG_TAG_OFFSET_INDEX: i32 = 12; + /// /// ConsumeQueue's store unit. Format: /// @@ -62,10 +65,6 @@ use crate::store_path_config_helper::get_store_path_consume_queue_ext; /// /// ConsumeQueue's store unit. Size: CommitLog Physical Offset(8) + Body Size(4) + Tag HashCode(8) = /// 20 Bytes - -pub const CQ_STORE_UNIT_SIZE: i32 = 20; -pub const MSG_TAG_OFFSET_INDEX: i32 = 12; - #[derive(Clone)] pub struct ConsumeQueue { message_store_config: Arc,