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/23 07:31:18 UTC

[incubator-pinot] branch adding_version_option_in_pinot_admin created (now 23f7770)

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

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


      at 23f7770  Adding a version option to pinot admin to show all the component versions

This branch includes the following new commits:

     new 23f7770  Adding a version option to pinot admin to show all the component versions

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: Adding a version option to pinot admin to show all the component versions

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

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

commit 23f7770ffc795b917c83efd3e36fcb369177bf01
Author: Xiang Fu <fx...@gmail.com>
AuthorDate: Tue Dec 22 23:27:53 2020 -0800

    Adding a version option to pinot admin to show all the component versions
---
 .../apache/pinot/tools/admin/PinotAdministrator.java   | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 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 83c90da..d1fc6df 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
@@ -19,6 +19,8 @@
 package org.apache.pinot.tools.admin;
 
 import java.lang.reflect.Field;
+import java.util.Map;
+import org.apache.pinot.common.Utils;
 import org.apache.pinot.spi.plugin.PluginManager;
 import org.apache.pinot.tools.Command;
 import org.apache.pinot.tools.admin.command.AddSchemaCommand;
@@ -136,6 +138,9 @@ public class PinotAdministrator {
 
   @Option(name = "-help", required = false, help = true, aliases = {"-h", "--h", "--help"}, usage = "Print this message.")
   boolean _help = false;
+
+  @Option(name = "-version", required = false, help = true, aliases = {"-v", "--v", "--version"}, usage = "Print the version of Pinot package.")
+  boolean _version = false;
   boolean _status = false;
 
   private boolean getStatus() {
@@ -146,8 +151,9 @@ public class PinotAdministrator {
     try {
       CmdLineParser parser = new CmdLineParser(this);
       parser.parseArgument(args);
-
-      if ((_subCommand == null) || _help) {
+      if (_version) {
+        printVersion();
+      } else if ((_subCommand == null) || _help) {
         printUsage();
       } else if (_subCommand.getHelp()) {
         _subCommand.printUsage();
@@ -162,6 +168,14 @@ public class PinotAdministrator {
     }
   }
 
+  private void printVersion() {
+    LOGGER.info("List All Pinot Component Versions:");
+    Map<String, String> componentVersions = Utils.getComponentVersions();
+    for (Map.Entry<String, String> entry : componentVersions.entrySet()) {
+      LOGGER.info("Package: {}, Version: {}", entry.getKey(), entry.getValue());
+    }
+  }
+
   public static void main(String[] args) {
     PluginManager.get().init();
     PinotAdministrator pinotAdministrator = new PinotAdministrator();


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