You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ap...@apache.org on 2021/02/01 19:12:15 UTC

[incubator-pinot] branch use-default-broker-controller-ports-when-undefined created (now 21fa2b1)

This is an automated email from the ASF dual-hosted git repository.

apucher pushed a change to branch use-default-broker-controller-ports-when-undefined
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git.


      at 21fa2b1  use default broker and controller ports if not defined

This branch includes the following new commits:

     new 21fa2b1  use default broker and controller ports if not defined

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


[incubator-pinot] 01/01: use default broker and controller ports if not defined

Posted by ap...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

apucher pushed a commit to branch use-default-broker-controller-ports-when-undefined
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit 21fa2b1cce700375871b9eb3004e2c8a9d1366c5
Author: Alexander Pucher <al...@alexpucher.com>
AuthorDate: Mon Feb 1 11:10:49 2021 -0800

    use default broker and controller ports if not defined
---
 .../org/apache/pinot/broker/broker/helix/HelixBrokerStarter.java     | 5 ++---
 .../src/main/java/org/apache/pinot/controller/ControllerConf.java    | 2 ++
 .../src/main/java/org/apache/pinot/controller/ControllerStarter.java | 5 ++---
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/pinot-broker/src/main/java/org/apache/pinot/broker/broker/helix/HelixBrokerStarter.java b/pinot-broker/src/main/java/org/apache/pinot/broker/broker/helix/HelixBrokerStarter.java
index 091860c..121bd4b 100644
--- a/pinot-broker/src/main/java/org/apache/pinot/broker/broker/helix/HelixBrokerStarter.java
+++ b/pinot-broker/src/main/java/org/apache/pinot/broker/broker/helix/HelixBrokerStarter.java
@@ -133,9 +133,8 @@ public class HelixBrokerStarter implements ServiceStartable {
 
   private int inferPort() {
     return Optional.ofNullable(_brokerConf.getProperty(Helix.KEY_OF_BROKER_QUERY_PORT)).map(Integer::parseInt)
-        .orElseGet(() -> _listenerConfigs.stream().findFirst().map(ListenerConfig::getPort).orElseThrow(() ->
-            new IllegalStateException(String.format("Requires at least one ingress config or '%s'",
-                Helix.KEY_OF_BROKER_QUERY_PORT))));
+        .orElseGet(() -> _listenerConfigs.stream().findFirst().map(ListenerConfig::getPort)
+            .orElse(Helix.DEFAULT_BROKER_QUERY_PORT));
   }
 
   private void setupHelixSystemProperties() {
diff --git a/pinot-controller/src/main/java/org/apache/pinot/controller/ControllerConf.java b/pinot-controller/src/main/java/org/apache/pinot/controller/ControllerConf.java
index 76ab5ec..05ccf4c 100644
--- a/pinot-controller/src/main/java/org/apache/pinot/controller/ControllerConf.java
+++ b/pinot-controller/src/main/java/org/apache/pinot/controller/ControllerConf.java
@@ -65,6 +65,8 @@ public class ControllerConf extends PinotConfiguration {
   public static final String CONTROLLER_MODE = "controller.mode";
   public static final String LEAD_CONTROLLER_RESOURCE_REBALANCE_STRATEGY = "controller.resource.rebalance.strategy";
 
+  public static final int DEFAULT_CONTROLLER_PORT = 9000;
+
   public enum ControllerMode {
     DUAL, PINOT_ONLY, HELIX_ONLY
   }
diff --git a/pinot-controller/src/main/java/org/apache/pinot/controller/ControllerStarter.java b/pinot-controller/src/main/java/org/apache/pinot/controller/ControllerStarter.java
index b7d15ed..76a3e99 100644
--- a/pinot-controller/src/main/java/org/apache/pinot/controller/ControllerStarter.java
+++ b/pinot-controller/src/main/java/org/apache/pinot/controller/ControllerStarter.java
@@ -195,9 +195,8 @@ public class ControllerStarter implements ServiceStartable {
 
   private int inferPort() {
     return Optional.ofNullable(_config.getControllerPort()).map(Integer::parseInt)
-        .orElseGet(() -> _listenerConfigs.stream().findFirst().map(ListenerConfig::getPort).orElseThrow(() ->
-            new IllegalStateException(String.format("Requires at least one ingress config or '%s'",
-                ControllerConf.CONTROLLER_PORT))));
+        .orElseGet(() -> _listenerConfigs.stream().findFirst().map(ListenerConfig::getPort)
+            .orElse(ControllerConf.DEFAULT_CONTROLLER_PORT));
   }
 
   private void setupHelixSystemProperties() {


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