You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by is...@apache.org on 2019/11/14 12:22:32 UTC

[lucene-solr] 02/03: SOLR-13662: Better help printing, changelog

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

ishan pushed a commit to branch jira/solr-13662-3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit e05e03ef565a330d2af890ce8b69443f4f5f34e8
Author: Ishan Chattopadhyaya <is...@apache.org>
AuthorDate: Thu Nov 14 17:39:21 2019 +0530

    SOLR-13662: Better help printing, changelog
---
 solr/CHANGES.txt                                     | 12 +++++++++---
 .../src/java/org/apache/solr/util/PackageTool.java   | 20 +++++++++++---------
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 8790ee5c..81462b0 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -108,9 +108,15 @@ New Features
 ---------------------
 * SOLR-13821: A Package store to store and load package artifacts (noble, Ishan Chattopadhyaya)
 
-* SOLR-13822: A Package management system with the following features. A packages.json in ZK to store
-  the configuration, APIs to read/edit them and isolated classloaders to load the classes from
-  hose packages if the 'class' attribute is prefixed with `<package-name>:` (noble, Ishan Chattopadhyaya)
+* SOLR-13822: A Package management system with the following features:
+  (a) A packages.json in ZK to store the configuration,
+  (b) APIs to read/edit them, and
+  (c) Isolated classloaders to load the classes from those packages when the 'class'
+      attribute is prefixed with '<package-name>:'
+  (noble, Ishan Chattopadhyaya)
+
+* SOLR-13662: A CLI based Package Manager ("bin/solr package help" for more details).
+  (Ishan Chattopadhyaya, noble, David Smiley, Jan Hoydahl)
 
 * SOLR-10786: Add DBSCAN clustering Streaming Evaluator (Joel Bernstein)
 
diff --git a/solr/core/src/java/org/apache/solr/util/PackageTool.java b/solr/core/src/java/org/apache/solr/util/PackageTool.java
index aae2903..ad71a20 100644
--- a/solr/core/src/java/org/apache/solr/util/PackageTool.java
+++ b/solr/core/src/java/org/apache/solr/util/PackageTool.java
@@ -17,6 +17,8 @@
 package org.apache.solr.util;
 
 import static org.apache.solr.packagemanager.PackageUtils.printGreen;
+import static org.apache.solr.packagemanager.PackageUtils.printRed;
+import static org.apache.solr.packagemanager.PackageUtils.print;
 
 import java.lang.invoke.MethodHandles;
 import java.util.Map;
@@ -44,7 +46,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 
-@SuppressForbidden(reason = "Need to use printGreen() instead of log4j/slf4j for cleaner output")
 public class PackageTool extends SolrCLI.ToolBase {
 
   private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
@@ -153,28 +154,29 @@ public class PackageTool extends SolrCLI.ToolBase {
               case "help":
               case "usage":
                 printGreen("./solr package add-repo <repository-name> <repository-url>");
-                printGreen("Add a repository to Solr.");
+                print(PackageUtils.YELLOW, "Add a repository to Solr.");
                 printGreen("");
                 printGreen("./solr package install <package-name>[:<version>] ");
-                printGreen("Install a package into Solr. This copies over the artifacts from the repository into Solr's internal package store and sets up classloader for this package to be used.");
+                print(PackageUtils.YELLOW, "Install a package into Solr. This copies over the artifacts from the repository into Solr's internal package store and sets up classloader for this package to be used.");
                 printGreen("");
                 printGreen("./solr package deploy <package-name>[:<version>] [-y] [--update] -collections <comma-separated-collections> [-p <param1>=<val1> -p <param2>=<val2> ...] ");
-                printGreen("Bootstraps a previously installed package into the specified collections. It the package accepts parameters for its setup commands, they can be specified (as per package documentation).");
+                print(PackageUtils.YELLOW, "Bootstraps a previously installed package into the specified collections. It the package accepts parameters for its setup commands, they can be specified (as per package documentation).");
                 printGreen("");
                 printGreen("./solr package list-installed");
-                printGreen("Print a list of packages installed in Solr.");
+                print(PackageUtils.YELLOW, "Print a list of packages installed in Solr.");
                 printGreen("");
                 printGreen("./solr package list-available");
-                printGreen("Print a list of packages available in the repositories.");
+                print(PackageUtils.YELLOW, "Print a list of packages available in the repositories.");
                 printGreen("");
                 printGreen("./solr package list-deployed -c <collection>");
-                printGreen("Print a list of packages deployed on a given collection.");
+                print(PackageUtils.YELLOW, "Print a list of packages deployed on a given collection.");
                 printGreen("");
                 printGreen("./solr package list-deployed <package-name>");
-                printGreen("Print a list of collections on which a given package has been deployed.");
+                print(PackageUtils.YELLOW, "Print a list of collections on which a given package has been deployed.");
                 printGreen("");
                 printGreen("./solr package undeploy <package-name> -collections <comma-separated-collections>");
-                printGreen("Undeploys a package from specified collection(s)");
+                print(PackageUtils.YELLOW, "Undeploys a package from specified collection(s)");
+                printRed("\n\nNote: Please add '-solrUrl http://host:port' parameter if needed (usually on Windows).");
                 break;
               default:
                 throw new RuntimeException("Unrecognized command: "+cmd);