!46 backport add improve performance
From: @zhiliatox Reviewed-by: @hu-zongtang Signed-off-by: @hu-zongtang
This commit is contained in:
commit
e0aa47ed26
53
patch041-backport-improve-performance.patch
Normal file
53
patch041-backport-improve-performance.patch
Normal file
@ -0,0 +1,53 @@
|
||||
From 65faea22fd54fd9875f2ca9d3088b4dc46d31cce Mon Sep 17 00:00:00 2001
|
||||
From: keranbingaa <397294722@qq.com>
|
||||
Date: Fri, 1 Dec 2023 10:05:16 +0800
|
||||
Subject: [PATCH] [ISSUE #7534] Use high performance concurrent set to replace
|
||||
copyonwriteset (#7583)
|
||||
|
||||
* fix ISSUE #7534
|
||||
|
||||
* reformat code
|
||||
|
||||
* Remove the useless unit test
|
||||
|
||||
---------
|
||||
|
||||
Co-authored-by: RongtongJin <jinrongtong16@mails.ucas.ac.cn>
|
||||
---
|
||||
.../rocketmq/namesrv/routeinfo/RouteInfoManagerNewTest.java | 1 -
|
||||
.../org/apache/rocketmq/remoting/protocol/body/TopicList.java | 4 ++--
|
||||
2 files changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/namesrv/src/test/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManagerNewTest.java b/namesrv/src/test/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManagerNewTest.java
|
||||
index 6002d1f5a..b52cf5074 100644
|
||||
--- a/namesrv/src/test/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManagerNewTest.java
|
||||
+++ b/namesrv/src/test/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManagerNewTest.java
|
||||
@@ -130,7 +130,6 @@ public class RouteInfoManagerNewTest {
|
||||
topicList = TopicList.decode(content, TopicList.class);
|
||||
assertThat(topicList.getTopicList()).contains("TestTopic", "TestTopic1", "TestTopic2");
|
||||
}
|
||||
-
|
||||
@Test
|
||||
public void registerBroker() {
|
||||
// Register master broker
|
||||
diff --git a/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/body/TopicList.java b/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/body/TopicList.java
|
||||
index 30edfb5a9..0de0bae7e 100644
|
||||
--- a/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/body/TopicList.java
|
||||
+++ b/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/body/TopicList.java
|
||||
@@ -17,11 +17,11 @@
|
||||
package org.apache.rocketmq.remoting.protocol.body;
|
||||
|
||||
import java.util.Set;
|
||||
-import java.util.concurrent.CopyOnWriteArraySet;
|
||||
+import java.util.concurrent.ConcurrentHashMap;
|
||||
import org.apache.rocketmq.remoting.protocol.RemotingSerializable;
|
||||
|
||||
public class TopicList extends RemotingSerializable {
|
||||
- private Set<String> topicList = new CopyOnWriteArraySet<>();
|
||||
+ private Set<String> topicList = ConcurrentHashMap.newKeySet();
|
||||
private String brokerAddr;
|
||||
|
||||
public Set<String> getTopicList() {
|
||||
--
|
||||
2.32.0.windows.2
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
Summary: Cloud-Native, Distributed Messaging and Streaming
|
||||
Name: rocketmq
|
||||
Version: 5.1.5
|
||||
Release: 41
|
||||
Release: 42
|
||||
License: Apache-2.0
|
||||
Group: Applications/Message
|
||||
URL: https://rocketmq.apache.org/
|
||||
@ -50,6 +50,7 @@ Patch0037: patch037-backport-Retry-topic-v2-in-pop.patch
|
||||
Patch0038: patch038-backport-SlaveActingMaster-Timer-Message-retry-without-escape-logic.patch
|
||||
Patch0039: patch039-backport-add-some-validations.patch
|
||||
Patch0040: patch040-backport-add-some-test-cases.patch
|
||||
Patch0041: patch041-backport-improve-performance.patch
|
||||
BuildRequires: java-1.8.0-openjdk-devel, maven, maven-local, git
|
||||
Requires: java-1.8.0-openjdk-devel
|
||||
|
||||
@ -90,6 +91,9 @@ exit 0
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Dec 11 2023 ShiZhili <shizhili_yewu@cmss.chinamobile.com> - 5.1.3-42
|
||||
- backport add improve performance
|
||||
|
||||
* Mon Dec 11 2023 ShiZhili <shizhili_yewu@cmss.chinamobile.com> - 5.1.3-41
|
||||
- backport add some test cases
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user