From 4117d0019a727e8c6f9675b2f5bca2ff1960925b Mon Sep 17 00:00:00 2001 From: ph3636 <38041490+ph3636@users.noreply.github.com> Date: Wed, 14 Apr 2021 16:35:21 +0800 Subject: [PATCH] [ISSUE 2800] optimize: the spelling of topicSynFlag Co-authored-by: ph3636 --- .../impl/factory/MQClientInstanceTest.java | 2 +- .../client/producer/DefaultMQProducerTest.java | 2 +- .../trace/DefaultMQConsumerWithTraceTest.java | 4 ++-- .../trace/DefaultMQProducerWithTraceTest.java | 4 ++-- .../common/protocol/route/QueueData.java | 16 ++++++++-------- .../protocol/route/TopicRouteDataTest.java | 4 ++-- .../namesrv/routeinfo/RouteInfoManager.java | 10 +++++----- .../command/topic/UpdateTopicPermSubCommand.java | 2 +- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/client/src/test/java/org/apache/rocketmq/client/impl/factory/MQClientInstanceTest.java b/client/src/test/java/org/apache/rocketmq/client/impl/factory/MQClientInstanceTest.java index a3457e18..d8f1e18d 100644 --- a/client/src/test/java/org/apache/rocketmq/client/impl/factory/MQClientInstanceTest.java +++ b/client/src/test/java/org/apache/rocketmq/client/impl/factory/MQClientInstanceTest.java @@ -79,7 +79,7 @@ public class MQClientInstanceTest { queueData.setPerm(6); queueData.setReadQueueNums(3); queueData.setWriteQueueNums(4); - queueData.setTopicSynFlag(0); + queueData.setTopicSysFlag(0); queueDataList.add(queueData); topicRouteData.setQueueDatas(queueDataList); diff --git a/client/src/test/java/org/apache/rocketmq/client/producer/DefaultMQProducerTest.java b/client/src/test/java/org/apache/rocketmq/client/producer/DefaultMQProducerTest.java index e1771b96..5f29fe11 100644 --- a/client/src/test/java/org/apache/rocketmq/client/producer/DefaultMQProducerTest.java +++ b/client/src/test/java/org/apache/rocketmq/client/producer/DefaultMQProducerTest.java @@ -481,7 +481,7 @@ public class DefaultMQProducerTest { queueData.setPerm(6); queueData.setReadQueueNums(3); queueData.setWriteQueueNums(4); - queueData.setTopicSynFlag(0); + queueData.setTopicSysFlag(0); queueDataList.add(queueData); topicRouteData.setQueueDatas(queueDataList); return topicRouteData; diff --git a/client/src/test/java/org/apache/rocketmq/client/trace/DefaultMQConsumerWithTraceTest.java b/client/src/test/java/org/apache/rocketmq/client/trace/DefaultMQConsumerWithTraceTest.java index 5ea517c8..c54c0bb7 100644 --- a/client/src/test/java/org/apache/rocketmq/client/trace/DefaultMQConsumerWithTraceTest.java +++ b/client/src/test/java/org/apache/rocketmq/client/trace/DefaultMQConsumerWithTraceTest.java @@ -273,7 +273,7 @@ public class DefaultMQConsumerWithTraceTest { queueData.setPerm(6); queueData.setReadQueueNums(3); queueData.setWriteQueueNums(4); - queueData.setTopicSynFlag(0); + queueData.setTopicSysFlag(0); queueDataList.add(queueData); topicRouteData.setQueueDatas(queueDataList); return topicRouteData; @@ -309,7 +309,7 @@ public class DefaultMQConsumerWithTraceTest { queueData.setPerm(6); queueData.setReadQueueNums(1); queueData.setWriteQueueNums(1); - queueData.setTopicSynFlag(1); + queueData.setTopicSysFlag(1); queueDataList.add(queueData); topicRouteData.setQueueDatas(queueDataList); return topicRouteData; diff --git a/client/src/test/java/org/apache/rocketmq/client/trace/DefaultMQProducerWithTraceTest.java b/client/src/test/java/org/apache/rocketmq/client/trace/DefaultMQProducerWithTraceTest.java index da573a25..62b34175 100644 --- a/client/src/test/java/org/apache/rocketmq/client/trace/DefaultMQProducerWithTraceTest.java +++ b/client/src/test/java/org/apache/rocketmq/client/trace/DefaultMQProducerWithTraceTest.java @@ -168,7 +168,7 @@ public class DefaultMQProducerWithTraceTest { queueData.setPerm(6); queueData.setReadQueueNums(3); queueData.setWriteQueueNums(4); - queueData.setTopicSynFlag(0); + queueData.setTopicSysFlag(0); queueDataList.add(queueData); topicRouteData.setQueueDatas(queueDataList); return topicRouteData; @@ -204,7 +204,7 @@ public class DefaultMQProducerWithTraceTest { queueData.setPerm(6); queueData.setReadQueueNums(1); queueData.setWriteQueueNums(1); - queueData.setTopicSynFlag(1); + queueData.setTopicSysFlag(1); queueDataList.add(queueData); topicRouteData.setQueueDatas(queueDataList); return topicRouteData; diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/route/QueueData.java b/common/src/main/java/org/apache/rocketmq/common/protocol/route/QueueData.java index 72a21f38..2dbb2902 100644 --- a/common/src/main/java/org/apache/rocketmq/common/protocol/route/QueueData.java +++ b/common/src/main/java/org/apache/rocketmq/common/protocol/route/QueueData.java @@ -25,7 +25,7 @@ public class QueueData implements Comparable { private int readQueueNums; private int writeQueueNums; private int perm; - private int topicSynFlag; + private int topicSysFlag; public int getReadQueueNums() { return readQueueNums; @@ -51,12 +51,12 @@ public class QueueData implements Comparable { this.perm = perm; } - public int getTopicSynFlag() { - return topicSynFlag; + public int getTopicSysFlag() { + return topicSysFlag; } - public void setTopicSynFlag(int topicSynFlag) { - this.topicSynFlag = topicSynFlag; + public void setTopicSysFlag(int topicSysFlag) { + this.topicSysFlag = topicSysFlag; } @Override @@ -67,7 +67,7 @@ public class QueueData implements Comparable { result = prime * result + perm; result = prime * result + readQueueNums; result = prime * result + writeQueueNums; - result = prime * result + topicSynFlag; + result = prime * result + topicSysFlag; return result; } @@ -91,7 +91,7 @@ public class QueueData implements Comparable { return false; if (writeQueueNums != other.writeQueueNums) return false; - if (topicSynFlag != other.topicSynFlag) + if (topicSysFlag != other.topicSysFlag) return false; return true; } @@ -99,7 +99,7 @@ public class QueueData implements Comparable { @Override public String toString() { return "QueueData [brokerName=" + brokerName + ", readQueueNums=" + readQueueNums - + ", writeQueueNums=" + writeQueueNums + ", perm=" + perm + ", topicSynFlag=" + topicSynFlag + + ", writeQueueNums=" + writeQueueNums + ", perm=" + perm + ", topicSysFlag=" + topicSysFlag + "]"; } diff --git a/common/src/test/java/org/apache/rocketmq/common/protocol/route/TopicRouteDataTest.java b/common/src/test/java/org/apache/rocketmq/common/protocol/route/TopicRouteDataTest.java index 764225d6..5c7c6d1d 100644 --- a/common/src/test/java/org/apache/rocketmq/common/protocol/route/TopicRouteDataTest.java +++ b/common/src/test/java/org/apache/rocketmq/common/protocol/route/TopicRouteDataTest.java @@ -43,7 +43,7 @@ public class TopicRouteDataTest { queueData.setPerm(6); queueData.setReadQueueNums(8); queueData.setWriteQueueNums(8); - queueData.setTopicSynFlag(0); + queueData.setTopicSysFlag(0); List queueDataList = new ArrayList(); queueDataList.add(queueData); @@ -78,7 +78,7 @@ public class TopicRouteDataTest { queueData.setPerm(6); queueData.setReadQueueNums(8); queueData.setWriteQueueNums(8); - queueData.setTopicSynFlag(0); + queueData.setTopicSysFlag(0); List queueDataList = new ArrayList(); queueDataList.add(queueData); diff --git a/namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java b/namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java index ecd057a2..edef87ce 100644 --- a/namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java +++ b/namesrv/src/main/java/org/apache/rocketmq/namesrv/routeinfo/RouteInfoManager.java @@ -220,7 +220,7 @@ public class RouteInfoManager { queueData.setWriteQueueNums(topicConfig.getWriteQueueNums()); queueData.setReadQueueNums(topicConfig.getReadQueueNums()); queueData.setPerm(topicConfig.getPerm()); - queueData.setTopicSynFlag(topicConfig.getTopicSysFlag()); + queueData.setTopicSysFlag(topicConfig.getTopicSysFlag()); List queueDataList = this.topicQueueTable.get(topicConfig.getTopicName()); if (null == queueDataList) { @@ -684,7 +684,7 @@ public class RouteInfoManager { String topic = topicEntry.getKey(); List queueDatas = topicEntry.getValue(); if (queueDatas != null && queueDatas.size() > 0 - && TopicSysFlag.hasUnitFlag(queueDatas.get(0).getTopicSynFlag())) { + && TopicSysFlag.hasUnitFlag(queueDatas.get(0).getTopicSysFlag())) { topicList.getTopicList().add(topic); } } @@ -710,7 +710,7 @@ public class RouteInfoManager { String topic = topicEntry.getKey(); List queueDatas = topicEntry.getValue(); if (queueDatas != null && queueDatas.size() > 0 - && TopicSysFlag.hasUnitSubFlag(queueDatas.get(0).getTopicSynFlag())) { + && TopicSysFlag.hasUnitSubFlag(queueDatas.get(0).getTopicSysFlag())) { topicList.getTopicList().add(topic); } } @@ -736,8 +736,8 @@ public class RouteInfoManager { String topic = topicEntry.getKey(); List queueDatas = topicEntry.getValue(); if (queueDatas != null && queueDatas.size() > 0 - && !TopicSysFlag.hasUnitFlag(queueDatas.get(0).getTopicSynFlag()) - && TopicSysFlag.hasUnitSubFlag(queueDatas.get(0).getTopicSynFlag())) { + && !TopicSysFlag.hasUnitFlag(queueDatas.get(0).getTopicSysFlag()) + && TopicSysFlag.hasUnitSubFlag(queueDatas.get(0).getTopicSysFlag())) { topicList.getTopicList().add(topic); } } diff --git a/tools/src/main/java/org/apache/rocketmq/tools/command/topic/UpdateTopicPermSubCommand.java b/tools/src/main/java/org/apache/rocketmq/tools/command/topic/UpdateTopicPermSubCommand.java index a06a19d1..63a2a192 100644 --- a/tools/src/main/java/org/apache/rocketmq/tools/command/topic/UpdateTopicPermSubCommand.java +++ b/tools/src/main/java/org/apache/rocketmq/tools/command/topic/UpdateTopicPermSubCommand.java @@ -94,7 +94,7 @@ public class UpdateTopicPermSubCommand implements SubCommand { topicConfig.setTopicName(topic); topicConfig.setWriteQueueNums(queueData.getWriteQueueNums()); topicConfig.setReadQueueNums(queueData.getReadQueueNums()); - topicConfig.setTopicSysFlag(queueData.getTopicSynFlag()); + topicConfig.setTopicSysFlag(queueData.getTopicSysFlag()); //new perm int perm; if (commandLine.hasOption('p')) { -- GitLab