[refactor] Use Collections.emptyList() instead of new ArrayList<> for better code quality#39
Open
[refactor] Use Collections.emptyList() instead of new ArrayList<> for better code quality#39
Conversation
…lusterName’ cluster. (apache#9327)
* [#ISSUE 9333] Use fastjson2 in broker module * Update * Fix the serialization failure caused by improper get/set naming
…from tiered storage (apache#9359)
* add scheduled clean task. * make code compatible to lmq. * make code compatible to lmq. * make code compatible to lmq. * make code compatible to lmq.
…consumer service (apache#9370)
…pache#9384) * [ISSUE apache#9379] Fix timeStoreTable delete logic in IndexService * [ISSUE apache#9379] Fix delete logic from TimeStoreTable in IndexService
…er/config/v1 (…" (apache#9386) This reverts commit f86fb40.
…pache#9387) This reverts commit b1daa3c.
…ocess encounters errors (apache#9255)
Fix revive lag metric calculation (apache#8652)
Add RocketmqTraffic appender to rmq.proxy.logback.xml (apache#8630)
…lation does not take effect (apache#8233)
…al file (apache#9413) * flush bak file before delete original file. * timer metrics. * english comment.
… between master and slave when the topic has attributes (apache#9404)
…urable and shutdown gracefully (apache#10044)
… shutdown (apache#10060) * fix(store): close all consume queue file handles on ConsumeQueueStore shutdown * remove implementation --------- Co-authored-by: RongtongJin <[email protected]>
… message reconsume times (apache#10051)
…n to support on-demand wake-up (apache#10064)
…gProcessor.init (apache#10069)
Problem: The cleanUnusedResource method was cleaning up client long polling requests without returning results to clients, causing client errors. Solution: 1. Simplified the cleanUnusedResource method to only remove entries with empty request queues 2. Changed cleanup interval from 5 minutes to 3 minutes Change-Id: If7052ba0d088e68cf654e6b7efafe09f5fa877be
…t flushed consume queue storetime (apache#10074) * Fix StoreCheckpoint: set logicsMsgTimestamp only after CQ flush, use logicsMsgTempTimestamp for in-memory storetime Change-Id: I6085bf6efaef84168ece31d080481717465f2b13 * rename to tmpLogicsMsgTimestamp Change-Id: Ia65ca06751f765bdc2bf053c58e08789f4b2fb22 --------- Co-authored-by: guyinyou <[email protected]>
…ckpoint after CQ flush (apache#10080) Change-Id: I57c0922bb81c2d43359867e82a92fdf2deab7ad7 Co-authored-by: guyinyou <[email protected]>
…n delay message type validation (apache#10084)
…#10096) Signed-off-by: Shubham Kalloli <[email protected]>
Signed-off-by: Shubham Kalloli <[email protected]>
Signed-off-by: Shubham Kalloli <[email protected]>
Signed-off-by: Shubham Kalloli <[email protected]>
…when tlsMode=enforcing (apache#10111)
…or code (apache#10012) * When IndexRocksDBEnable or TransRocksDBEnable are enabled, we need to take these two offsets into account to accelerate recovery. * Add UTs * Refactor the code based on the review comments * Revert "[ISSUE apache#8127]Optimize the metric calculation logic of the time wheel" * Remove useless import * Refactor Code * Refactor Code * Refactor Code * Refactor Code * Refactor Code * Implement accelerated recovery for the file-based ConsumeQueue. * Implement accelerated recovery for the file-based ConsumeQueue. Change-Id: Ieac45d0582f2f83d977aeb8e6f5084268b7f8752 * Implement accelerated recovery for the file-based ConsumeQueue. * Ignore testTruncateCQ UT --------- Co-authored-by: RongtongJin <[email protected]>
Replace return new ArrayList<>() with Collections.emptyList() for better code quality and performance. Collections.emptyList() returns a singleton immutable empty list, avoiding unnecessary object allocation. Signed-off-by: Senrian <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Replace
return new ArrayList<>()withCollections.emptyList()for better code quality and performance.Collections.emptyList()returns a singleton immutable empty list, avoiding unnecessary object allocation.Changes
proxy/src/main/java/org/apache/rocketmq/proxy/service/route/MessageQueueSelector.java- 2 changesstore/src/main/java/org/apache/rocketmq/store/MappedFileQueue.java- 1 changetest/src/main/java/org/apache/rocketmq/test/util/StatUtil.java- 1 changetieredstore/src/main/java/org/apache/rocketmq/tieredstore/util/MessageFormatUtil.java- 1 changeTotal: 4 files, 5 changes
Testing
Existing unit tests should cover these changes.
Signed-off-by: Senrian [email protected]