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 2021/11/19 18:31:56 UTC

[pinot] branch master updated: Fixing Pinot Admin system exit logic (#7798)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new e44d2e4  Fixing Pinot Admin system exit logic (#7798)
e44d2e4 is described below

commit e44d2e46f2eaba5f75d789d92ce767fbee96feba
Author: Xiang Fu <xi...@gmail.com>
AuthorDate: Fri Nov 19 10:31:38 2021 -0800

    Fixing Pinot Admin system exit logic (#7798)
    
    * Pinot admin only exits when the flag `pinot.admin.system.exit` is set and the sub-command status is not 0.
    
    * address comments
---
 .../org/apache/pinot/tools/admin/PinotAdministrator.java | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/pinot-tools/src/main/java/org/apache/pinot/tools/admin/PinotAdministrator.java b/pinot-tools/src/main/java/org/apache/pinot/tools/admin/PinotAdministrator.java
index 59dd9a1..5b1d9ee 100644
--- a/pinot-tools/src/main/java/org/apache/pinot/tools/admin/PinotAdministrator.java
+++ b/pinot-tools/src/main/java/org/apache/pinot/tools/admin/PinotAdministrator.java
@@ -132,13 +132,13 @@ public class PinotAdministrator {
 
   @CommandLine.Option(names = {"-help", "-h", "--h", "--help"}, required = false,
       description = "Print this message.")
-  boolean _help = false;
+  private boolean _help = false;
 
   @CommandLine.Option(names = {"-version", "-v", "--v", "--version"}, required = false,
       description = "Print the version of Pinot package.")
-  boolean _version = false;
+  private boolean _version = false;
 
-  int _status = 0;
+  private int _status = 1;
 
   public void execute(String[] args) {
     try {
@@ -190,13 +190,9 @@ public class PinotAdministrator {
     PluginManager.get().init();
     PinotAdministrator pinotAdministrator = new PinotAdministrator();
     pinotAdministrator.execute(args);
-    // Ignore `pinot.admin.system.exit` property for Pinot quickstarts.
-    if ((args.length > 0) && ("quickstart".equalsIgnoreCase(args[0]))) {
-      return;
-    }
-    if (Boolean.parseBoolean(System.getProperties().getProperty("pinot.admin.system.exit"))) {
-      // If status is true, cmd was successfully, so return 0 from process.
-      System.exit(pinotAdministrator._status);
+    if ((pinotAdministrator._status != 0)
+        && Boolean.parseBoolean(System.getProperties().getProperty("pinot.admin.system.exit"))) {
+        System.exit(pinotAdministrator._status);
     }
   }
 }

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