mcvsubbu commented on a change in pull request #6418:
URL: https://github.com/apache/incubator-pinot/pull/6418#discussion_r562797116



##########
File path: 
pinot-broker/src/main/java/org/apache/pinot/broker/broker/helix/HelixBrokerStarter.java
##########
@@ -117,13 +124,18 @@ public HelixBrokerStarter(PinotConfiguration brokerConf, 
String clusterName, Str
       brokerHost = 
_brokerConf.getProperty(CommonConstants.Helix.SET_INSTANCE_ID_TO_HOSTNAME_KEY, 
false) ? NetUtil
           .getHostnameOrAddress() : NetUtil.getHostAddress();
     }
+
     _brokerId = _brokerConf.getProperty(Helix.Instance.INSTANCE_ID_KEY,
-        Helix.PREFIX_OF_BROKER_INSTANCE + brokerHost + "_" + _brokerConf
-            .getProperty(Helix.KEY_OF_BROKER_QUERY_PORT, 
Helix.DEFAULT_BROKER_QUERY_PORT));
+        Helix.PREFIX_OF_BROKER_INSTANCE + brokerHost + "_" + inferPort());
 
     _brokerConf.addProperty(Broker.CONFIG_OF_BROKER_ID, _brokerId);
   }
 
+  private int inferPort() {
+    return 
Optional.ofNullable(_brokerConf.getProperty(Helix.KEY_OF_BROKER_QUERY_PORT)).map(Integer::parseInt)

Review comment:
       Thanks, I think this exception is ok, since we are the same behavior as 
the controller. But it is useful to throw the right error message in the 
exception mentioning which configuration the users should provide.




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



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to