Closed 847850277 closed 1 month ago
The recent changes enhance the functionality of the RocketMQ system by introducing a new method in the AdminBrokerProcessor
for retrieving topic statistics. This is complemented by the addition of new data structures and methods in the remoting protocol to manage topic offsets and statistics, improving overall message monitoring and administration capabilities within the messaging system.
Files | Change Summary |
---|---|
rocketmq-broker/src/.../admin_broker_processor.rs |
Added handling for RequestCode::GetTopicStatsInfo in AdminBrokerProcessor , invoking get_topic_stats_info method to enhance request handling capabilities. |
rocketmq-broker/src/.../topic_request_handler.rs |
Introduced get_topic_stats_info method in TopicRequestHandler for retrieving topic statistics, including offsets and last message timestamps. |
rocketmq-remoting/src/protocol.rs |
Added new public module admin to organize administrative functionalities related to the RocketMQ protocol. |
rocketmq-remoting/src/protocol/admin.rs |
Created admin.rs to establish modules for topic_offset and topic_stats_table for managing topic data. |
rocketmq-remoting/src/protocol/admin/.../topic_offset.rs |
Defined TopicOffset struct to represent offsets with fields for min, max, and last update timestamp. |
rocketmq-remoting/src/protocol/admin/.../topic_stats_table.rs |
Introduced TopicStatsTable struct to hold mappings of message queues to their offsets using a HashMap . |
rocketmq-remoting/src/protocol/header.rs |
Added public module declaration for get_topic_stats_request_header . |
rocketmq-remoting/src/protocol/header/.../get_topic_stats_request_header.rs |
Defined GetTopicStatsRequestHeader struct for encapsulating topic statistics request headers with serialization support. |
rocketmq-store/src/log_file.rs |
Added get_message_store_timestamp method to RocketMQMessageStore trait to retrieve message store timestamps. |
rocketmq-store/src/message_store/default_message_store.rs |
Implemented get_message_store_timestamp in DefaultMessageStore for fetching timestamps based on topic and queue parameters. |
sequenceDiagram
participant Client
participant AdminBrokerProcessor
participant TopicRequestHandler
participant TopicStatsTable
Client->>AdminBrokerProcessor: Request GetTopicStatsInfo
AdminBrokerProcessor->>TopicRequestHandler: Call get_topic_stats_info
TopicRequestHandler->>TopicStatsTable: Fetch topic offsets
TopicStatsTable-->>TopicRequestHandler: Return offsets
TopicRequestHandler-->>AdminBrokerProcessor: Return topic statistics
AdminBrokerProcessor-->>Client: Send topic statistics response
Objective | Addressed | Explanation |
---|---|---|
Support for get_topic_stats_info in AdminBrokerProcessor (#[833]) |
✅ |
🐰 In the land where messages flow,
New stats arise, our knowledge will grow!
With offsets tracked, each hop and skip,
Admins rejoice, let their worries skip!
RocketMQ shines, a rabbit's delight,
Hopping through data, from morning to night! 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
🚀Thanks for your contribution🎉. CodeRabbit(AI) will review your code first🔥
Attention: Patch coverage is 0%
with 113 lines
in your changes missing coverage. Please review.
Project coverage is 26.16%. Comparing base (
f5f8922
) to head (79abed9
). Report is 3 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Which Issue(s) This PR Fixes(Closes)
Fixes #833
Brief Description
How Did You Test This Change?
Summary by CodeRabbit
New Features
Improvements
Documentation