You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/05/07 01:48:54 UTC

[GitHub] [pulsar] zplinuxlover opened a new pull request #6903: Feature/pip 61

zplinuxlover opened a new pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903


   this code change is for 
   https://github.com/apache/pulsar/wiki/PIP-61%3A-Advertised-multiple-addresses


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-632959382


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-633413159


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-631956740


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-625050362


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-637296642


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-637429114


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-631825192


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on a change in pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on a change in pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#discussion_r427777175



##########
File path: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
##########
@@ -146,6 +146,14 @@
     )
     private String advertisedAddress;
 
+    //
+    @FieldContext(category=CATEGORY_SERVER, doc = "")

Review comment:
       I have add the configuration doc here

##########
File path: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
##########
@@ -146,6 +146,14 @@
     )
     private String advertisedAddress;
 
+    //

Review comment:
       I have remove the code for this line 

##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceEphemeralData.java
##########
@@ -63,9 +81,17 @@ public void setDisabled(boolean flag) {
         this.disabled = flag;
     }
 
+    @NotNull
+    public Map<String, AdvertisedListener> getAdvertisedListeners() {
+        if (this.advertisedListeners == null) {
+            return Collections.unmodifiableMap(Collections.EMPTY_MAP);

Review comment:
       I have fix the code

##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
##########
@@ -367,7 +387,22 @@ public boolean registerNamespace(String namespace, boolean ensureOwned) throws P
                     if (LOG.isDebugEnabled()) {
                         LOG.debug("Namespace bundle {} already owned by {} ", bundle, nsData);
                     }
-                    future.complete(Optional.of(new LookupResult(nsData.get())));
+                    // find the target
+                    if (StringUtils.isNotBlank(advertisedListenerName)) {
+                        AdvertisedListener listener = nsData.get().getAdvertisedListeners().get(advertisedListenerName);
+                        if (listener == null) {
+                            future.completeExceptionally(
+                                    new PulsarServerException("the broker do not have " + advertisedListenerName + " listener"));
+                            return;
+                        } else {
+                            future.complete(Optional.of(new LookupResult(
+                                    nsData.get().getHttpUrl(), nsData.get().getHttpUrlTls(), listener.getBrokerServiceUrl().toString(),

Review comment:
       currently we only concern pulsar protocol here, the HttpUrl and HttpUrlTls behavior as before

##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
##########
@@ -447,8 +488,23 @@ private void searchForCandidateBroker(NamespaceBundle bundle,
 
                         // Schedule the task to pre-load topics
                         pulsar.loadNamespaceTopics(bundle);
-
-                        lookupFuture.complete(Optional.of(new LookupResult(ownerInfo)));
+                        // find the target
+                        if (StringUtils.isNotBlank(advertisedListenerName)) {
+                            AdvertisedListener listener = ownerInfo.getAdvertisedListeners().get(advertisedListenerName);
+                            if (listener == null) {
+                                lookupFuture.completeExceptionally(
+                                        new PulsarServerException("the broker do not have " + advertisedListenerName + " listener"));
+                                return;
+                            } else {
+                                lookupFuture.complete(Optional.of(new LookupResult(
+                                        ownerInfo.getHttpUrl(), ownerInfo.getHttpUrlTls(), listener.getBrokerServiceUrl().toString(),

Review comment:
       currently we only concern pulsar protocol here, the HttpUrl and HttpUrlTls behavior as before.

##########
File path: pulsar-common/src/main/java/org/apache/pulsar/policies/data/loadbalancer/AdvertisedListener.java
##########
@@ -0,0 +1,47 @@
+/**
+ * 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.pulsar.policies.data.loadbalancer;
+
+import java.net.URI;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+/**
+ * The advertisedListener for broker with brokerServiceUrl and brokerServiceUrlTls.
+ */
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class AdvertisedListener {

Review comment:
       currently we only concern pulsar protocol here, the HttpUrl and HttpUrlTls behavior as before




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-632936619


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] sijie commented on a change in pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
sijie commented on a change in pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#discussion_r426917243



##########
File path: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
##########
@@ -146,6 +146,14 @@
     )
     private String advertisedAddress;
 
+    //

Review comment:
       nit: remove this line if it is not needed.

##########
File path: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/ServiceConfiguration.java
##########
@@ -146,6 +146,14 @@
     )
     private String advertisedAddress;
 
+    //
+    @FieldContext(category=CATEGORY_SERVER, doc = "")

Review comment:
       Can you add documentation for these two settings?
   
   Also, can you add these settings to `broker.conf` file?

##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceEphemeralData.java
##########
@@ -63,9 +81,17 @@ public void setDisabled(boolean flag) {
         this.disabled = flag;
     }
 
+    @NotNull
+    public Map<String, AdvertisedListener> getAdvertisedListeners() {
+        if (this.advertisedListeners == null) {
+            return Collections.unmodifiableMap(Collections.EMPTY_MAP);

Review comment:
       nit: I think `EMPTY_MAP` is already unmodifiable.

##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
##########
@@ -447,8 +488,23 @@ private void searchForCandidateBroker(NamespaceBundle bundle,
 
                         // Schedule the task to pre-load topics
                         pulsar.loadNamespaceTopics(bundle);
-
-                        lookupFuture.complete(Optional.of(new LookupResult(ownerInfo)));
+                        // find the target
+                        if (StringUtils.isNotBlank(advertisedListenerName)) {
+                            AdvertisedListener listener = ownerInfo.getAdvertisedListeners().get(advertisedListenerName);
+                            if (listener == null) {
+                                lookupFuture.completeExceptionally(
+                                        new PulsarServerException("the broker do not have " + advertisedListenerName + " listener"));
+                                return;
+                            } else {
+                                lookupFuture.complete(Optional.of(new LookupResult(
+                                        ownerInfo.getHttpUrl(), ownerInfo.getHttpUrlTls(), listener.getBrokerServiceUrl().toString(),

Review comment:
       same comment as above

##########
File path: pulsar-common/src/main/java/org/apache/pulsar/policies/data/loadbalancer/AdvertisedListener.java
##########
@@ -0,0 +1,47 @@
+/**
+ * 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.pulsar.policies.data.loadbalancer;
+
+import java.net.URI;
+
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+/**
+ * The advertisedListener for broker with brokerServiceUrl and brokerServiceUrlTls.
+ */
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class AdvertisedListener {

Review comment:
       Why do we only include `brokerServiceUrl` and `brokerServiceUrlTls` in AdvertisedListener?

##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/namespace/NamespaceService.java
##########
@@ -367,7 +387,22 @@ public boolean registerNamespace(String namespace, boolean ensureOwned) throws P
                     if (LOG.isDebugEnabled()) {
                         LOG.debug("Namespace bundle {} already owned by {} ", bundle, nsData);
                     }
-                    future.complete(Optional.of(new LookupResult(nsData.get())));
+                    // find the target
+                    if (StringUtils.isNotBlank(advertisedListenerName)) {
+                        AdvertisedListener listener = nsData.get().getAdvertisedListeners().get(advertisedListenerName);
+                        if (listener == null) {
+                            future.completeExceptionally(
+                                    new PulsarServerException("the broker do not have " + advertisedListenerName + " listener"));
+                            return;
+                        } else {
+                            future.complete(Optional.of(new LookupResult(
+                                    nsData.get().getHttpUrl(), nsData.get().getHttpUrlTls(), listener.getBrokerServiceUrl().toString(),

Review comment:
       Why do we get `HttpUrl` and `HttpUrlTls` from NamespaceBundle but get `brokerServiceUrl` and `brokerServiceUrlTls`?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui commented on a change in pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on a change in pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#discussion_r429707325



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
##########
@@ -36,11 +36,7 @@
 import java.lang.reflect.Method;
 import java.net.InetSocketAddress;
 import java.net.URI;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
+import java.util.*;

Review comment:
       Avoid use import .*

##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/lookup/TopicLookupBase.java
##########
@@ -156,6 +156,31 @@ protected String internalGetNamespaceBundle(TopicName topicName) {
      */
     public static CompletableFuture<ByteBuf> lookupTopicAsync(PulsarService pulsarService, TopicName topicName,
             boolean authoritative, String clientAppId, AuthenticationDataSource authenticationData, long requestId) {
+        return lookupTopicAsync(pulsarService, topicName, authoritative, clientAppId, authenticationData, requestId, null);
+    }
+
+    /**
+     *
+     * Lookup broker-service address for a given namespace-bundle which contains given topic.
+     *
+     * a. Returns broker-address if namespace-bundle is already owned by any broker b. If current-broker receives
+     * lookup-request and if it's not a leader then current broker redirects request to leader by returning
+     * leader-service address. c. If current-broker is leader then it finds out least-loaded broker to own namespace
+     * bundle and redirects request by returning least-loaded broker. d. If current-broker receives request to own the
+     * namespace-bundle then it owns a bundle and returns success(connect) response to client.

Review comment:
       It's better to use `owner` rather than `leader`.
   And, for easier reading. Please separate a b c d into different paragraphs.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-631297957


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-632947372


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-637927959


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui merged pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
codelipenghui merged pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-625050229






----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-631899841


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-632959266


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-637980744


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-632959128


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-631352928


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-632447178


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on a change in pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on a change in pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#discussion_r429967851



##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/lookup/TopicLookupBase.java
##########
@@ -156,6 +156,31 @@ protected String internalGetNamespaceBundle(TopicName topicName) {
      */
     public static CompletableFuture<ByteBuf> lookupTopicAsync(PulsarService pulsarService, TopicName topicName,
             boolean authoritative, String clientAppId, AuthenticationDataSource authenticationData, long requestId) {
+        return lookupTopicAsync(pulsarService, topicName, authoritative, clientAppId, authenticationData, requestId, null);
+    }
+
+    /**
+     *
+     * Lookup broker-service address for a given namespace-bundle which contains given topic.
+     *
+     * a. Returns broker-address if namespace-bundle is already owned by any broker b. If current-broker receives
+     * lookup-request and if it's not a leader then current broker redirects request to leader by returning
+     * leader-service address. c. If current-broker is leader then it finds out least-loaded broker to own namespace
+     * bundle and redirects request by returning least-loaded broker. d. If current-broker receives request to own the
+     * namespace-bundle then it owns a bundle and returns success(connect) response to client.

Review comment:
       I have format the comment

##########
File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/PulsarService.java
##########
@@ -36,11 +36,7 @@
 import java.lang.reflect.Method;
 import java.net.InetSocketAddress;
 import java.net.URI;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Optional;
+import java.util.*;

Review comment:
       resolve the problem




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-633487642


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-637901274


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-633433590


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-632696740


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] codelipenghui commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
codelipenghui commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-637238631


   ping @sijie please help review this PR again.


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-637357785


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: Feature/pip 61

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-624989345


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-631846330


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] zplinuxlover commented on pull request #6903: PIP-61: Advertise multiple addresses

Posted by GitBox <gi...@apache.org>.
zplinuxlover commented on pull request #6903:
URL: https://github.com/apache/pulsar/pull/6903#issuecomment-637901501


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org