You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by xi...@apache.org on 2020/12/08 20:58:42 UTC

[incubator-pinot] branch fixing_bootstrap_table_tool created (now d1c31e1)

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

xiangfu pushed a change to branch fixing_bootstrap_table_tool
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git.


      at d1c31e1  fixing bugs in bootstrap table tool

This branch includes the following new commits:

     new d1c31e1  fixing bugs in bootstrap table tool

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: fixing bugs in bootstrap table tool

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

xiangfu pushed a commit to branch fixing_bootstrap_table_tool
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit d1c31e1c6c409ddbd3d7e1dac36abe87a27bd734
Author: Xiang Fu <fx...@gmail.com>
AuthorDate: Tue Dec 8 12:58:13 2020 -0800

    fixing bugs in bootstrap table tool
---
 .../src/main/java/org/apache/pinot/tools/BootstrapTableTool.java  | 3 +++
 .../apache/pinot/tools/admin/command/BootstrapTableCommand.java   | 8 ++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/pinot-tools/src/main/java/org/apache/pinot/tools/BootstrapTableTool.java b/pinot-tools/src/main/java/org/apache/pinot/tools/BootstrapTableTool.java
index e795390..0723b06 100644
--- a/pinot-tools/src/main/java/org/apache/pinot/tools/BootstrapTableTool.java
+++ b/pinot-tools/src/main/java/org/apache/pinot/tools/BootstrapTableTool.java
@@ -18,6 +18,7 @@
  */
 package org.apache.pinot.tools;
 
+import com.google.common.base.Preconditions;
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileReader;
@@ -40,6 +41,8 @@ public class BootstrapTableTool {
   private final String _tableDir;
 
   public BootstrapTableTool(String controllerHost, int controllerPort, String tableDir) {
+    Preconditions.checkNotNull(controllerHost);
+    Preconditions.checkNotNull(tableDir);
     _controllerHost = controllerHost;
     _controllerPort = controllerPort;
     _tableDir = tableDir;
diff --git a/pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/BootstrapTableCommand.java b/pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/BootstrapTableCommand.java
index 7d725fc..8396d20 100644
--- a/pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/BootstrapTableCommand.java
+++ b/pinot-tools/src/main/java/org/apache/pinot/tools/admin/command/BootstrapTableCommand.java
@@ -18,6 +18,7 @@
  */
 package org.apache.pinot.tools.admin.command;
 
+import org.apache.pinot.common.utils.NetUtil;
 import org.apache.pinot.spi.plugin.PluginManager;
 import org.apache.pinot.tools.Command;
 import org.apache.pinot.tools.BootstrapTableTool;
@@ -66,13 +67,13 @@ public class BootstrapTableCommand extends AbstractBaseAdminCommand implements C
   private String _controllerHost;
 
   @Option(name = "-controllerPort", required = false, metaVar = "<int>", usage = "http port for broker.")
-  private final String _controllerPort = DEFAULT_CONTROLLER_PORT;
+  private String _controllerPort = DEFAULT_CONTROLLER_PORT;
 
   @Option(name = "-dir", required = false, aliases = {"-d", "-directory"}, metaVar = "<String>", usage = "The directory contains all the configs and data to bootstrap a table")
   private String _dir;
 
   @Option(name = "-help", required = false, help = true, aliases = {"-h", "--h", "--help"}, usage = "Print this message.")
-  private final boolean _help = false;
+  private boolean _help = false;
 
   @Override
   public boolean getHelp() {
@@ -108,6 +109,9 @@ public class BootstrapTableCommand extends AbstractBaseAdminCommand implements C
   public boolean execute()
       throws Exception {
     PluginManager.get().init();
+    if (_controllerHost == null) {
+      _controllerHost = NetUtil.getHostAddress();
+    }
     return new BootstrapTableTool(_controllerHost, Integer.parseInt(_controllerPort), _dir).execute();
   }
 }


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