TheR1sing3un commented on code in PR #6100: URL: https://github.com/apache/rocketmq/pull/6100#discussion_r1113846222
########## controller/src/main/java/org/apache/rocketmq/controller/impl/manager/BrokerReplicaInfo.java: ########## @@ -0,0 +1,103 @@ +/* + * 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.controller.impl.manager; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Set; +import java.util.concurrent.atomic.AtomicLong; +import org.apache.rocketmq.common.MixAll; +import org.apache.rocketmq.common.Pair; + +/** + * Broker replicas info, mapping from brokerAddress to {brokerId, brokerHaAddress}. + */ +public class BrokerReplicaInfo { + private final String clusterName; + + private final String brokerName; + + // Start from 1 + private final AtomicLong nextAssignBrokerId; + + private final HashMap<Long/*brokerId*/, Pair<String/*ipAddress*/, String/*registerCheckCode*/>> brokerIdInfo; + + public BrokerReplicaInfo(String clusterName, String brokerName) { + this.clusterName = clusterName; + this.brokerName = brokerName; + this.nextAssignBrokerId = new AtomicLong(MixAll.FIRST_SLAVE_ID); Review Comment: > 这里用FIRST_SLAVE_ID语义不是很好,这是brokerControlllerId编号,跟slaveId没什么关系 Yep! I rename it to `FIRST_BROKER_CONTROLLER_ID`! -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
