Skip to content

Commit

Permalink
SOLR-14673: Add bin/solr stream CLI (apache#2479)
Browse files Browse the repository at this point in the history
* Allows you to run a streaming expression on the Solr server, using the /stream end point.
* Allows you to run a streaming expression locally, by specifying --execution=local.
  • Loading branch information
epugh authored Nov 13, 2024
1 parent f6c5af9 commit 4b9e539
Show file tree
Hide file tree
Showing 12 changed files with 1,197 additions and 16 deletions.
2 changes: 2 additions & 0 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ New Features

* SOLR-17467: Solr CLI bin/solr start defaults to starting Solr in Cloud mode, use --user-managed switch for User Managed (aka Standalone) mode. (Eric Pugh)

* SOLR-14673: Solr CLI now has bin/solr stream tool that executates streaming expressions via command line, either locally or on solr cluster. (Eric Pugh)

Improvements
---------------------

Expand Down
4 changes: 2 additions & 2 deletions solr/bin/solr.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -1175,9 +1175,9 @@ for %%a in (%*) do (
) else (
set "option!option!=%%a"
if "!option!" equ "-s" set "SOLR_HOME=%%a"
if "!option!" equ "--solr-home" set "SOLR_HOME=%%a"
if "!option!" equ "--solr-home" set "SOLR_HOME=%%a"
if "!option!" equ "-d" set "SOLR_SERVER_DIR=%%a"
if "!option!" equ "--server-dir" set "SOLR_SERVER_DIR=%%a"
if "!option!" equ "--server-dir" set "SOLR_SERVER_DIR=%%a"
if not "!option!" equ "-s" if not "!option!" equ "--solr-home" if not "!option!" equ "-d" if not "!option!" equ "--server-dir" (
set "AUTH_PARAMS=!AUTH_PARAMS! !option! %%a"
)
Expand Down
4 changes: 2 additions & 2 deletions solr/core/src/java/org/apache/solr/cli/SolrCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ private static Tool newTool(String toolType) throws Exception {
else if ("post".equals(toolType)) return new PostTool();
else if ("postlogs".equals(toolType)) return new PostLogsTool();
else if ("version".equals(toolType)) return new VersionTool();
else if ("stream".equals(toolType)) return new StreamTool();
else if ("snapshot-create".equals(toolType)) return new SnapshotCreateTool();
else if ("snapshot-delete".equals(toolType)) return new SnapshotDeleteTool();
else if ("snapshot-list".equals(toolType)) return new SnapshotListTool();
Expand Down Expand Up @@ -511,8 +512,7 @@ private static void printHelp() {
print("Usage: solr COMMAND OPTIONS");
print(" where COMMAND is one of: start, stop, restart, status, ");
print(
" healthcheck, create, delete, auth, assert, config, export, api, package, post, ");

" healthcheck, create, delete, auth, assert, config, export, api, package, post, stream,");
print(
" zk ls, zk cp, zk rm , zk mv, zk mkroot, zk upconfig, zk downconfig,");
print(
Expand Down
Loading

0 comments on commit 4b9e539

Please sign in to comment.