Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ where
}
let topic = CheetahString::from(key_parts[0]);
let queue_id = key_parts[1].parse::<i32>().unwrap();
/*info!(
"check hold request, topic: {}, queue_id: {}",
topic, queue_id
);*/
let max_offset = self
.broker_runtime_inner
.message_store()
Expand Down
2 changes: 1 addition & 1 deletion rocketmq-common/src/common/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ pub trait MessageTrait: Any + Display + Debug {
/// # Returns
///
/// An `Option<String>` containing the buyer ID if it exists, otherwise `None`.
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docstring says this returns Option<String>, but the signature returns Option<CheetahString>. Please update the documentation to match the actual return type to avoid misleading API consumers.

Suggested change
/// An `Option<String>` containing the buyer ID if it exists, otherwise `None`.
/// An `Option<CheetahString>` containing the buyer ID if it exists, otherwise `None`.

Copilot uses AI. Check for mistakes.
fn get_buyer_id(&self) -> Option<CheetahString> {
fn buyer_id(&self) -> Option<CheetahString> {
self.property(&CheetahString::from_static_str(MessageConst::PROPERTY_BUYER_ID))
}

Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renaming get_buyer_id to buyer_id is a breaking change for downstream crates implementing/using MessageTrait. Consider keeping a deprecated get_buyer_id default method that forwards to buyer_id() for at least one release to preserve backward compatibility.

Suggested change
/// Deprecated compatibility method for retrieving the buyer ID.
///
/// This method is kept for backward compatibility with older versions
/// of the API. Prefer using [`buyer_id`] instead.
#[deprecated(
note = "get_buyer_id is deprecated, use buyer_id() instead. This method may be removed in a future release."
)]
fn get_buyer_id(&self) -> Option<CheetahString> {
self.buyer_id()
}

Copilot uses AI. Check for mistakes.
Expand Down
6 changes: 2 additions & 4 deletions rocketmq-store/src/stats/broker_stats_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
// limitations under the License.

use std::sync::Arc;
use std::time::SystemTime;
use std::time::UNIX_EPOCH;

use cheetah_string::CheetahString;
use dashmap::DashMap;
Expand All @@ -33,11 +31,11 @@ use rocketmq_common::common::stats::stats_item::StatsItem;
use rocketmq_common::common::stats::stats_item_set::StatsItemSet;
use rocketmq_common::common::stats::Stats;
use rocketmq_common::common::topic::TopicValidator;
use rocketmq_common::TimeUtils::current_millis;
use rocketmq_rust::schedule::simple_scheduler::ScheduledTaskManager;
use tokio::time::Duration;
use tracing::info;
use tracing::warn;

type TaskId = u64;

pub struct BrokerStatsManager {
Expand Down Expand Up @@ -167,7 +165,7 @@ impl BrokerStatsManager {

/// Compute delay to next minute boundary
fn compute_initial_delay_to_next_minute() -> Duration {
let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_millis() as u64;
let now = current_millis();

let next_minute = ((now / 60000) + 1) * 60000;
let delay_ms = next_minute - now;
Expand Down
Loading