vongosling commented on a change in pull request #2757:
URL: https://github.com/apache/rocketmq/pull/2757#discussion_r604520038



##########
File path: pom.xml
##########
@@ -571,6 +571,11 @@
                 <artifactId>guava</artifactId>
                 <version>19.0</version>
             </dependency>
+            <dependency>
+                <groupId>com.googlecode.concurrentlinkedhashmap</groupId>

Review comment:
       Do not introduce this older(2015) dependency, you could check guava's 
MapMaker or CacheBuilder. Or, use Caffeine.

##########
File path: 
broker/src/main/java/org/apache/rocketmq/broker/loadbalance/AssignmentManager.java
##########
@@ -0,0 +1,149 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.rocketmq.broker.loadbalance;
+
+import com.google.common.collect.Lists;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+import org.apache.rocketmq.broker.BrokerController;
+import org.apache.rocketmq.broker.out.BrokerOuterAPI;
+import org.apache.rocketmq.client.exception.MQBrokerException;
+import org.apache.rocketmq.client.impl.factory.MQClientInstance;
+import org.apache.rocketmq.common.MixAll;
+import org.apache.rocketmq.common.ThreadFactoryImpl;
+import org.apache.rocketmq.common.constant.LoggerName;
+import org.apache.rocketmq.common.message.MessageQueue;
+import org.apache.rocketmq.common.protocol.ResponseCode;
+import org.apache.rocketmq.common.protocol.route.TopicRouteData;
+import org.apache.rocketmq.common.topic.TopicValidator;
+import org.apache.rocketmq.logging.InternalLogger;
+import org.apache.rocketmq.logging.InternalLoggerFactory;
+
+
+public class AssignmentManager {
+    private static final InternalLogger log = 
InternalLoggerFactory.getLogger(LoggerName.BROKER_LOGGER_NAME);
+
+    private transient BrokerController brokerController;
+
+    private final static long LOCK_TIMEOUT_MILLIS = 3000;
+
+    private final Lock lockNamesrv = new ReentrantLock();
+
+    private final BrokerOuterAPI mQClientAPIImpl;
+
+    private final ConcurrentHashMap<String, Set<MessageQueue>> 
topicSubscribeInfoTable = new ConcurrentHashMap<String, Set<MessageQueue>>();
+
+    private ScheduledExecutorService scheduledExecutorService = Executors
+        .newSingleThreadScheduledExecutor(new 
ThreadFactoryImpl("LoadBalanceManagerScheduledThread"));
+
+    private static final List<String> IGNORE_ROUTE_TOPICS = Lists.newArrayList(
+        TopicValidator.SYSTEM_TOPIC_PREFIX,
+        MixAll.CID_RMQ_SYS_PREFIX,
+        MixAll.DEFAULT_CONSUMER_GROUP,
+        MixAll.TOOLS_CONSUMER_GROUP,
+        MixAll.FILTERSRV_CONSUMER_GROUP,
+        MixAll.MONITOR_CONSUMER_GROUP,
+        MixAll.ONS_HTTP_PROXY_GROUP,

Review comment:
       ONS?

##########
File path: 
broker/src/main/java/org/apache/rocketmq/broker/longpolling/NotifyMessageArrivingListener.java
##########
@@ -17,21 +17,24 @@
 
 package org.apache.rocketmq.broker.longpolling;
 
-import org.apache.rocketmq.store.MessageArrivingListener;
-
 import java.util.Map;
+import org.apache.rocketmq.broker.processor.PopMessageProcessor;
+import org.apache.rocketmq.store.MessageArrivingListener;
 
 public class NotifyMessageArrivingListener implements MessageArrivingListener {
     private final PullRequestHoldService pullRequestHoldService;
+    private final PopMessageProcessor popMessageProcessor;
 
-    public NotifyMessageArrivingListener(final PullRequestHoldService 
pullRequestHoldService) {
+    public NotifyMessageArrivingListener(final PullRequestHoldService 
pullRequestHoldService, final PopMessageProcessor popMessageProcessor) {

Review comment:
       what is pop semantic? Common Queue Operations do not include pop except 
the special dequeue. Such a name can be confusing. IMO, We should use some 
common names in the industry. such as poll/pull, peek, push, and so on.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to