diff --git a/README.md b/README.md index cf08fa329a5..24d419bd472 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Solr is the blazing-fast, open source, multi-modal search platform built on [Apa It powers full-text, vector, and geospatial search at many of the world's largest organizations. [![Build Status](https://ci-builds.apache.org/job/Solr/job/Solr-Artifacts-main/badge/icon?subject=Solr%20Artifacts)](https://ci-builds.apache.org/job/Solr/job/Solr-Artifacts-main/) -[![Build Status](https://ci-builds.apache.org/job/Solr/job/Solr-Check-main/badge/icon?subject=Solr%20Check)](https://ci-builds.apache.org/job/Solr/job/Solr-Check-main/) +[![Build Status](https://ci-builds.apache.org/job/Solr/job/Solr-Lint-main/badge/icon?subject=Solr%20Lint)](https://ci-builds.apache.org/job/Solr/job/Solr-Lint-main/) For a complete description of the Solr project, team composition, source code repositories, and other details, please see the Solr web site at diff --git a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java index f7e07eb164a..88d91028552 100644 --- a/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java +++ b/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java @@ -55,9 +55,9 @@ public static void main(String[] args) { public static void checkVersion() { int major = Runtime.getRuntime().version().feature(); - if (major < 11 || major > 21) { + if (major < 21 || major > 23) { throw new IllegalStateException( - "java version must be between 11 and 21, your version: " + major); + "java version must be between 21 and 23, your version: " + major); } } diff --git a/build-tools/scriptDepVersions.gradle b/build-tools/scriptDepVersions.gradle index 25413b6791a..329905331a9 100644 --- a/build-tools/scriptDepVersions.gradle +++ b/build-tools/scriptDepVersions.gradle @@ -25,7 +25,7 @@ ext { "min-solrj-java-version" : "17", "apache-rat": "0.15", "commons-codec": "1.16.0", - "ecj": "3.36.0", + "ecj": "3.39.0", "javacc": "7.0.12", "jgit": "6.7.0.202309050840-r", "flexmark": "0.64.8", diff --git a/crave.yaml b/crave.yaml deleted file mode 100644 index 91a7980e70f..00000000000 --- a/crave.yaml +++ /dev/null @@ -1,2 +0,0 @@ -Solr: - image: "accupara/openjdk:21" \ No newline at end of file diff --git a/dev-docs/asf-jenkins.adoc b/dev-docs/asf-jenkins.adoc index b4d01bb3964..b3c59b6fd9e 100644 --- a/dev-docs/asf-jenkins.adoc +++ b/dev-docs/asf-jenkins.adoc @@ -10,13 +10,14 @@ This file aims to document our [ASF Jenkins](https://ci-builds.apache.org/job/So We run a number of jobs on Jenkins, each validating an overlapping set of concerns: * `Solr-Artifacts-*` - daily jobs that run `./gradlew assemble` to ensure that build artifacts (except docker images) can be created successfully -* `Solr-check-*` - "hourly" jobs that run all project tests and static analysis (i.e. `test`, `integrationTest`, and `check`) +* `Solr-Lint-*` - daily jobs that run static analysis (i.e. `precommit` and `check -x test`) on a branch +* `Solr-Test-*` - "hourly" jobs that run all (non-integration) tests (i.e. `./gradlew test`) +* `Solr-TestIntegration-*` - daily jobs that run project integration tests (i.e. `./gradlew integrationTests`) * `Solr-Docker-Nightly-*` - daily jobs that `./gradlew testDocker dockerPush` to validate docker image packaging. Snapshot images are pushed to hub.docker.com -* `Solr-reference-guide-*` - hourly jobs that build the Solr reference guide via `./gradlew checkSite` and push the resulting artifact to the staging/preview site `nightlies.apache.org` +* `Solr-reference-guide-*` - daily jobs that build the Solr reference guide via `./gradlew checkSite` and push the resulting artifact to the staging/preview site `nightlies.apache.org` * `Solr-Smoketest-*` - daily jobs that produce a snapshot release (via the `assembleRelease` task) and run the release smoketester Most jobs that validate particular build artifacts are run "daily", which is sufficient to prevent any large breaks from creeping into the build. - On the other hand, jobs that run tests are triggered "hourly" in order to squeeze as many test runs as possible out of our Jenkins hardware. This is a necessary consequence of Solr's heavy use of randomization in its test-suite. "Hourly" scheduling ensures that a test run is either currently running or in the build queue at all times, and enables us to get the maximum data points from our hardware. diff --git a/gradle/documentation/render-javadoc.gradle b/gradle/documentation/render-javadoc.gradle index bd90ad35426..6c637e540df 100644 --- a/gradle/documentation/render-javadoc.gradle +++ b/gradle/documentation/render-javadoc.gradle @@ -32,7 +32,7 @@ allprojects { missingdoclet "org.apache.solr.tools:missing-doclet" } - ext { + project.ext { relativeDocPath = project.path.replaceFirst(/:\w+:/, "").replace(':', '/') } diff --git a/gradle/globals.gradle b/gradle/globals.gradle index 4f782ae38c5..d8a99de69c2 100644 --- a/gradle/globals.gradle +++ b/gradle/globals.gradle @@ -37,7 +37,7 @@ allprojects { // so :solr:core will have solr-core.jar, etc. project.archivesBaseName = project.path.replaceAll("^:", "").replace(':', '-') - ext { + project.ext { // Utility method to support passing overrides via -P or -D. propertyOrDefault = { propName, defValue -> def result diff --git a/gradle/node.gradle b/gradle/node.gradle index 3da3a51d40e..ff8404c2db2 100644 --- a/gradle/node.gradle +++ b/gradle/node.gradle @@ -34,7 +34,7 @@ configure([project(":solr:packaging"), project(":solr:solr-ref-guide"), project( } } - ext { + project.ext { rootNodeDir = "$rootDir/.gradle/node" nodeProjectDir = file("$rootNodeDir/$project.name") } diff --git a/gradle/solr/packaging.gradle b/gradle/solr/packaging.gradle index 11ffb560688..1b5325f908b 100644 --- a/gradle/solr/packaging.gradle +++ b/gradle/solr/packaging.gradle @@ -38,7 +38,7 @@ configure(allprojects.findAll {project -> project.path.startsWith(":solr:modules:") || project.path == ":solr:prometheus-exporter" || project.path == ":solr:cross-dc-manager" }) { plugins.withType(JavaPlugin) { - ext { + project.ext { packagingDir = file("${buildDir}/packaging") if (project.path.startsWith(":solr:prometheus-exporter") || project.path.startsWith(":solr:cross-dc-manager")) { deps = packagingDir diff --git a/gradle/testing/alternative-jdk-support.gradle b/gradle/testing/alternative-jdk-support.gradle index 72cdabdab4b..a1ff1b4b014 100644 --- a/gradle/testing/alternative-jdk-support.gradle +++ b/gradle/testing/alternative-jdk-support.gradle @@ -87,6 +87,6 @@ if (jvmGradle != jvmCurrent) { // Set up root project's properties. rootProject.ext.runtimeJavaHome = jvmCurrent.javaHome -rootProject.ext.runtimeJavaVersion = jvmDetector.getMetadata(new InstallationLocation(jvmCurrent.javaHome, "specific path")).getLanguageVersion() +rootProject.ext.runtimeJavaVersion = jvmDetector.getMetadata(InstallationLocation.userDefined(jvmCurrent.javaHome, "specific path")).getLanguageVersion() rootProject.ext.usesAltJvm = (jvmGradle != jvmCurrent); diff --git a/gradle/testing/beasting.gradle b/gradle/testing/beasting.gradle index 8934100ec10..67c20140ba8 100644 --- a/gradle/testing/beasting.gradle +++ b/gradle/testing/beasting.gradle @@ -27,7 +27,7 @@ def beastingMode = gradle.startParameter.taskNames.any{ name -> name == 'beast' allprojects { plugins.withType(JavaPlugin) { - ext { + project.ext { testOptions += [ [propName: 'tests.dups', value: 0, description: "Reiterate runs of entire test suites ('beast' task)."] ] diff --git a/gradle/testing/profiling.gradle b/gradle/testing/profiling.gradle index ce9e7d43e03..8b1e5147efc 100644 --- a/gradle/testing/profiling.gradle +++ b/gradle/testing/profiling.gradle @@ -19,7 +19,7 @@ def recordings = files() allprojects { plugins.withType(JavaPlugin) { - ext { + project.ext { testOptions += [ [propName: 'tests.profile', value: false, description: "Enable java flight recorder profiling."] ] diff --git a/gradle/testing/randomization.gradle b/gradle/testing/randomization.gradle index 2b617b99aa8..183943a39e7 100644 --- a/gradle/testing/randomization.gradle +++ b/gradle/testing/randomization.gradle @@ -79,7 +79,7 @@ allprojects { // Configure test property defaults and their descriptions. allprojects { plugins.withType(JavaPlugin) { - ext { + project.ext { testOptions += [ // seed, repetition and amplification. [propName: 'tests.seed', value: { -> rootSeed }, description: "Sets the master randomization seed."], @@ -124,7 +124,7 @@ allprojects { // Add Solr-specific test configs settings. configure(allprojects.findAll {project -> project.path.startsWith(":solr") }) { plugins.withType(JavaPlugin) { - ext { + project.ext { testOptions += [ [propName: 'tests.src.home', value: null, description: "See SOLR-14023."], [propName: 'solr.tests.use.numeric.points', value: null, description: "Point implementation to use (true=numerics, false=trie)."], @@ -137,14 +137,14 @@ configure(allprojects.findAll {project -> project.path.startsWith(":solr") }) { allprojects { plugins.withType(JavaPlugin) { afterEvaluate { - ext.testOptionsResolved = testOptions.findAll { opt -> + project.ext.testOptionsResolved = testOptions.findAll { opt -> propertyOrDefault(opt.propName, opt.value) != null }.collectEntries { opt -> [(opt.propName): Objects.toString(resolvedTestOption(opt.propName))] } // Compute the "reproduce with" string. - ext.testOptionsForReproduceLine = testOptions.findAll { opt -> + project.ext.testOptionsForReproduceLine = testOptions.findAll { opt -> if (opt["includeInReproLine"] == false) { return false } diff --git a/gradle/testing/randomization/policies/solr-tests.policy b/gradle/testing/randomization/policies/solr-tests.policy index 8183cf1e1e7..61df0871a35 100644 --- a/gradle/testing/randomization/policies/solr-tests.policy +++ b/gradle/testing/randomization/policies/solr-tests.policy @@ -50,6 +50,8 @@ grant { permission java.net.SocketPermission "127.0.0.1:4", "connect,resolve"; permission java.net.SocketPermission "127.0.0.1:6", "connect,resolve"; permission java.net.SocketPermission "127.0.0.1:8", "connect,resolve"; + // Used as an invalid ZK host + permission java.net.SocketPermission "----------:33332", "connect,resolve"; // Basic permissions needed for Lucene to work: permission java.util.PropertyPermission "*", "read,write"; diff --git a/gradle/testing/slowest-tests-at-end.gradle b/gradle/testing/slowest-tests-at-end.gradle index eaf9cd1a2f1..d24e523394d 100644 --- a/gradle/testing/slowest-tests-at-end.gradle +++ b/gradle/testing/slowest-tests-at-end.gradle @@ -22,7 +22,7 @@ def allSuites = [] allprojects { plugins.withType(JavaPlugin) { - ext { + project.ext { testOptions += [ [propName: 'tests.slowestTests', value: true, description: "Print the summary of the slowest tests."], [propName: 'tests.slowestSuites', value: true, description: "Print the summary of the slowest suites."] diff --git a/gradle/validation/check-environment.gradle b/gradle/validation/check-environment.gradle index 6fcaf761a19..6e5c01ef19c 100644 --- a/gradle/validation/check-environment.gradle +++ b/gradle/validation/check-environment.gradle @@ -22,7 +22,7 @@ import org.gradle.util.GradleVersion configure(rootProject) { ext { - expectedGradleVersion = '8.4' + expectedGradleVersion = '8.10' } wrapper { diff --git a/gradle/validation/ecj-lint/ecj.javadocs.prefs b/gradle/validation/ecj-lint/ecj.javadocs.prefs index 975707055ff..74278547699 100644 --- a/gradle/validation/ecj-lint/ecj.javadocs.prefs +++ b/gradle/validation/ecj-lint/ecj.javadocs.prefs @@ -5,8 +5,8 @@ org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annota org.eclipse.jdt.core.compiler.annotation.nonnullisdefault=disabled org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 -org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.compliance=17 org.eclipse.jdt.core.compiler.doc.comment.support=enabled org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error @@ -93,4 +93,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=ignore org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=error -org.eclipse.jdt.core.compiler.source=11 +org.eclipse.jdt.core.compiler.source=17 diff --git a/gradle/validation/jar-checks.gradle b/gradle/validation/jar-checks.gradle index 6c87c50f023..7547214299d 100644 --- a/gradle/validation/jar-checks.gradle +++ b/gradle/validation/jar-checks.gradle @@ -1,3 +1,5 @@ +import java.util.stream.Collectors + /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -74,14 +76,14 @@ subprojects { // Configure jarValidation configuration for all projects. Any dependency // declared on this configuration (or any configuration it extends from) will // be verified. - configurations { + project.configurations { jarValidation } // For Java projects, add all dependencies from the following configurations // to jar validation plugins.withType(JavaPlugin) { - configurations { + project.configurations { jarValidation { extendsFrom runtimeClasspath extendsFrom compileClasspath @@ -107,16 +109,24 @@ subprojects { } def excludeRules = configurations.jarValidation.excludeRules + List> excludeRuleMaps; + if (excludeRules && excludeRules.size() > 0) { + excludeRuleMaps = excludeRules.stream().map {rule -> + if (rule.module != null) { + Map.of("group", rule.group, "module", rule.module) + } else { + Map.of("group", rule.group) + } + }.collect(Collectors.toList()) + } ArrayDeque queue = new ArrayDeque<>() configurations.jarValidation.extendsFrom.each { conf -> - if (excludeRules) { + if (excludeRules && excludeRules.size() > 0) { conf = conf.copyRecursive() conf.canBeResolved = true conf.canBeConsumed = true - def newConfExcludeRules = new HashSet<>(conf.excludeRules) - newConfExcludeRules.addAll(excludeRules) - conf.excludeRules = newConfExcludeRules + excludeRuleMaps.forEach {conf.exclude(it)} } if (conf.canBeResolved) { queue.addAll(conf.resolvedConfiguration.firstLevelModuleDependencies) diff --git a/gradle/validation/spotless.gradle b/gradle/validation/spotless.gradle index 76fecdfad98..d4444a87671 100644 --- a/gradle/validation/spotless.gradle +++ b/gradle/validation/spotless.gradle @@ -24,7 +24,7 @@ configure(allprojects) { prj -> plugins.withType(JavaPlugin) { prj.apply plugin: 'com.diffplug.spotless' - ext { + project.ext { spotlessJavaSetup = (Action){ it.toggleOffOn() // obviously, only to be used sparingly. // TODO: Work out how to support multiple different header files (we have diff --git a/gradle/wrapper/gradle-wrapper.jar.sha256 b/gradle/wrapper/gradle-wrapper.jar.sha256 index f78f56fee75..67dead8f441 100644 --- a/gradle/wrapper/gradle-wrapper.jar.sha256 +++ b/gradle/wrapper/gradle-wrapper.jar.sha256 @@ -1 +1 @@ -0336f591bc0ec9aa0c9988929b93ecc916b3c1d52aed202c7381db144aa0ef15 +2db75c40782f5e8ba1fc278a5574bab070adccb2d21ca5a6e5ed840888448046 diff --git a/gradle/wrapper/gradle-wrapper.jar.version b/gradle/wrapper/gradle-wrapper.jar.version index a2f28f43be3..dd78a707858 100644 --- a/gradle/wrapper/gradle-wrapper.jar.version +++ b/gradle/wrapper/gradle-wrapper.jar.version @@ -1 +1 @@ -8.4.0 +8.10.2 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 744c64d1277..9355b415575 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip networkTimeout=10000 +validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 0aa671a76c2..c8ad2977471 100755 --- a/gradlew +++ b/gradlew @@ -15,6 +15,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # +# SPDX-License-Identifier: Apache-2.0 +# ############################################################################## # @@ -55,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -84,7 +86,8 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s +' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -161,7 +164,7 @@ if [ ! -e "$GRADLE_WRAPPER_JAR" ]; then "$JAVACMD" $JAVA_OPTS "$APP_HOME/build-tools/build-infra/src/main/java/org/apache/lucene/gradle/WrapperDownloader.java" "$GRADLE_WRAPPER_JAR" WRAPPER_STATUS=$? if [ "$WRAPPER_STATUS" -eq 1 ]; then - echo "ERROR: Something went wrong. Make sure you're using Java version between 11 and 21." + echo "ERROR: Something went wrong. Make sure you're using Java version between 21 and 23." exit $WRAPPER_STATUS elif [ "$WRAPPER_STATUS" -ne 0 ]; then exit $WRAPPER_STATUS diff --git a/gradlew.bat b/gradlew.bat index 938e3ce94ee..ff65d8f6012 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -13,6 +13,8 @@ @rem See the License for the specific language governing permissions and @rem limitations under the License. @rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem @if "%DEBUG%"=="" @echo off @rem ########################################################################## @@ -48,11 +50,11 @@ set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 if %ERRORLEVEL% equ 0 goto execute -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -62,11 +64,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe if exist "%JAVA_EXE%" goto execute -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 goto fail @@ -108,7 +110,7 @@ goto fail :failWithJvmMessage @rem https://github.com/apache/lucene/pull/819 -echo Error: Something went wrong. Make sure you're using Java version between 11 and 21. +echo Error: Something went wrong. Make sure you're using Java version between 21 and 23. :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of diff --git a/settings.gradle b/settings.gradle index a9dd4a99ba1..7035b75bfdf 100644 --- a/settings.gradle +++ b/settings.gradle @@ -25,7 +25,7 @@ pluginManagement { } plugins { - id 'com.gradle.develocity' version '3.17.6' + id 'com.gradle.develocity' version '3.18.1' id 'com.gradle.common-custom-user-data-gradle-plugin' version '2.0.2' } diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index 1ddf5f4be45..907827a6fd0 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -23,6 +23,11 @@ Improvements * SOLR-17077: When a shard rejoins leader election, leave previous election only once to save unneeded calls to Zookeeper. (Pierre Salagnac) +* SOLR-16116: Apache Curator is now used to manage all Solr Zookeeper interactions. This should provide more stability in the Solr-Zookeeper interactions. + The solrj-zookeeper module, now has a dependency on curator. (Houston Putman, Kevin Risden, Mike Drob, David Smiley) + +* SOLR-17544: Solr CLI will now stop when you combine mutually exclusive options. Combining -s and -z options is a common example. (Eric Pugh, Christos Malliaridis) + Optimizations --------------------- (No changes) @@ -75,6 +80,8 @@ Deprecation Removals * SOLR-17494: Remove language specific writer types (i.e wt= ruby, python, php, and phps). (Eric Pugh) +* SOLR-17352: Remove deprecated Solr CLI options. Run bin/solr yourcommand -h to see current options. (Eric Pugh, Christos Malliardis) + Dependency Upgrades --------------------- (No changes) @@ -135,11 +142,9 @@ Improvements which may help reduce distributed-search latency in collections with many shards, especially when PKI is used between nodes. (Jason Gerlowski) -* SOLR-17382: Deprecate -a and -addlopts in favour of --jvm-opts for passing options into the JVM in bin/solr. (Eric Pugh, Christos Malliaridis) - -* SOLR-17431: Deprecate -p parameter where it doesn't refer to a port in bin/solr. (Eric Pugh, Christos Malliaridis) - -* SOLR-17442: Resolve -v flag conflict (version, value, verbose) in bin/solr. (Eric Pugh, Christos Malliaridis) +* SOLR-17383: Resolved overlapping arguments in the Solr CLI. Removed duplicative but differing arguments, + consolidated use of short form arguments -v to not have differing meanings based on tool. Provide deprecation warning + in command line when deprecated arguments are used. (Eric Pugh, Christos Malliaridis) * SOLR-17256: Deprecate SolrRequest `setBasePath` and `getBasePath` methods. SolrJ users wishing to temporarily override an HTTP client's base URL may use `Http2SolrClient.requestWithBaseUrl` instead. (Jason Gerlowski, @@ -149,6 +154,10 @@ Improvements enqueuing with a risk of rejection. Solr will use less resources under stress but to get the most of your machine, you may want to increase the thread pool. (David Smiley) +* SOLR-17528: Introduce -y short option to bin/solr start --no-prompt option. Aligns with bin/solr package tool. (Eric Pugh) + +* SOLR-17390: EmbeddedSolrServer now considers the ResponseParser (David Smiley) + Optimizations --------------------- * SOLR-14985: Solrj CloudSolrClient with Solr URLs had serious performance regressions (since the @@ -172,6 +181,8 @@ Optimizations * SOLR-16503: Switched from HTTP1 to HTTP2 in SolrClientCloudManager by replacing CloudLegacySolrClient with CloudHttp2SolrClient. (Sanjay Dutt, David Smiley) +* SOLR-17453: Leverage waitForState() instead of busy waiting in CREATE, MIGRATE, REINDEXCOLLECTION, MOVEREPLICA commands, and in some tests. (Pierre Salagnac) + Bug Fixes --------------------- * SOLR-12429: Uploading a configset with a symbolic link produces a IOException. Now a error message to user generated instead. (Eric Pugh) @@ -189,6 +200,11 @@ Bug Fixes * SOLR-17413: Fixed UpdateLog replay bug that shared thread-unsafe SolrQueryRequest objects across threads (Jason Gerlowski, David Smiley, Houston Putman) +* SOLR-11191: Splitting shards now routes child-docs with their _root_ field when available so they maintain parent relationship. (Zack Kendall) + +* SOLR-16976: Remove log4j-jul jar and use slf4j bridge for JUL to prevent exception from being logged when remote JMX + is enabled (Shawn Heisey, Stephen Zhou, Eric Pugh, Christine Poerschke, David Smiley) + Dependency Upgrades --------------------- (No changes) @@ -207,6 +223,16 @@ led to the suppression of exceptions. (Andrey Bozhko) * SOLR-11318: Introduce unit testing for AssertTool. (Eric Pugh, Jason Gerlowski) +* SOLR-17534: Introduce ClusterState.getCollectionNames, a convenience method (David Smiley) + +* SOLR-17545: Upgrade to Gradle 8.10 (Houston Putman) + +================== 9.7.1 ================== +Bug Fixes +--------------------- +* SOLR-17530: Metrics: Thew new Prometheus response writer wasn't detecting TLOG or PULL replicas properly. + (Matthew Biscocho) + ================== 9.7.0 ================== New Features --------------------- diff --git a/solr/benchmark/src/java/org/apache/solr/bench/MiniClusterState.java b/solr/benchmark/src/java/org/apache/solr/bench/MiniClusterState.java index 88bfc05af1f..34a970b3392 100755 --- a/solr/benchmark/src/java/org/apache/solr/bench/MiniClusterState.java +++ b/solr/benchmark/src/java/org/apache/solr/bench/MiniClusterState.java @@ -37,7 +37,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -import org.apache.solr.client.solrj.SolrClient; import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.SolrServerException; import org.apache.solr.client.solrj.impl.Http2SolrClient; @@ -84,7 +83,7 @@ public static class MiniClusterBenchState { MiniSolrCloudCluster cluster; /** The Client. */ - public SolrClient client; + public Http2SolrClient client; /** The Run cnt. */ int runCnt = 0; @@ -288,7 +287,7 @@ public void startMiniCluster(int nodeCount) { } zkHost = cluster.getZkServer().getZkAddress(); - client = new Http2SolrClient.Builder().useHttp1_1(useHttp1).build(); + client = new Http2SolrClient.Builder(nodes.get(0)).useHttp1_1(useHttp1).build(); log("done starting mini cluster"); log(""); @@ -318,9 +317,8 @@ public void createCollection(String collection, int numShards, int numReplicas) CollectionAdminRequest.Create request = CollectionAdminRequest.createCollection(collection, "conf", numShards, numReplicas); - request.setBasePath(nodes.get(random.nextInt(cluster.getJettySolrRunners().size()))); - - client.request(request); + client.requestWithBaseUrl( + nodes.get(random.nextInt(cluster.getJettySolrRunners().size())), null, request); cluster.waitForActiveCollection( collection, 15, TimeUnit.SECONDS, numShards, numShards * numReplicas); @@ -368,18 +366,19 @@ public void index(String collection, Docs docs, int docCount, boolean parallel) log("committing data ..."); UpdateRequest commitRequest = new UpdateRequest(); - commitRequest.setBasePath(nodes.get(random.nextInt(cluster.getJettySolrRunners().size()))); + final var url = nodes.get(random.nextInt(cluster.getJettySolrRunners().size())); commitRequest.setAction(UpdateRequest.ACTION.COMMIT, false, true); - commitRequest.process(client, collection); + client.requestWithBaseUrl(url, collection, commitRequest); log("done committing data"); } else { cluster.waitForActiveCollection(collection, 15, TimeUnit.SECONDS); } QueryRequest queryRequest = new QueryRequest(new SolrQuery("q", "*:*", "rows", "1")); - queryRequest.setBasePath(nodes.get(random.nextInt(cluster.getJettySolrRunners().size()))); + final var url = nodes.get(random.nextInt(cluster.getJettySolrRunners().size())); + NamedList result = + client.requestWithBaseUrl(url, collection, queryRequest).getResponse(); - NamedList result = client.request(queryRequest, collection); log("sanity check of single row query result: " + result); log(""); @@ -417,15 +416,15 @@ private void indexParallel(String collection, Docs docs, int docCount) @Override public void run() { UpdateRequest updateRequest = new UpdateRequest(); - updateRequest.setBasePath( - nodes.get(threadRandom.nextInt(cluster.getJettySolrRunners().size()))); + final var url = + nodes.get(threadRandom.nextInt(cluster.getJettySolrRunners().size())); SolrInputDocument doc = docs.inputDocument(); // log("add doc " + doc); updateRequest.add(doc); meter.mark(); try { - client.request(updateRequest, collection); + client.requestWithBaseUrl(url, collection, updateRequest); } catch (Exception e) { throw new RuntimeException(e); } @@ -452,9 +451,8 @@ private void indexBatch(String collection, Docs docs, int docCount, int batchSiz batch.add(docs.inputDocument()); if (i % batchSize == 0) { UpdateRequest updateRequest = new UpdateRequest(); - updateRequest.setBasePath(nodes.get(0)); updateRequest.add(batch); - client.request(updateRequest, collection); + client.requestWithBaseUrl(nodes.get(0), collection, updateRequest); meter.mark(batch.size()); batch.clear(); log(meter.getCount() + " docs at " + (long) meter.getMeanRate() + " doc/s"); @@ -462,9 +460,8 @@ private void indexBatch(String collection, Docs docs, int docCount, int batchSiz } if (!batch.isEmpty()) { UpdateRequest updateRequest = new UpdateRequest(); - updateRequest.setBasePath(nodes.get(0)); updateRequest.add(batch); - client.request(updateRequest, collection); + client.requestWithBaseUrl(nodes.get(0), collection, updateRequest); meter.mark(batch.size()); batch = null; } @@ -500,10 +497,9 @@ public void forceMerge(String collection, int maxMergeSegments) throws Exception } UpdateRequest optimizeRequest = new UpdateRequest(); - optimizeRequest.setBasePath( - nodes.get(random.nextInt(cluster.getJettySolrRunners().size()))); + final var url = nodes.get(random.nextInt(cluster.getJettySolrRunners().size())); optimizeRequest.setAction(UpdateRequest.ACTION.OPTIMIZE, false, true, maxMergeSegments); - optimizeRequest.process(client, collection); + client.requestWithBaseUrl(url, collection, optimizeRequest); } } diff --git a/solr/benchmark/src/java/org/apache/solr/bench/index/CloudIndexing.java b/solr/benchmark/src/java/org/apache/solr/bench/index/CloudIndexing.java index 820f2130a60..0ee950e7231 100755 --- a/solr/benchmark/src/java/org/apache/solr/bench/index/CloudIndexing.java +++ b/solr/benchmark/src/java/org/apache/solr/bench/index/CloudIndexing.java @@ -127,9 +127,9 @@ public void doSetup(MiniClusterState.MiniClusterBenchState miniClusterState) thr public Object indexDoc(MiniClusterState.MiniClusterBenchState miniClusterState, BenchState state) throws Exception { UpdateRequest updateRequest = new UpdateRequest(); - updateRequest.setBasePath( - miniClusterState.nodes.get(miniClusterState.getRandom().nextInt(state.nodeCount))); updateRequest.add(state.getNextDoc()); - return miniClusterState.client.request(updateRequest, BenchState.COLLECTION); + final var url = + miniClusterState.nodes.get(miniClusterState.getRandom().nextInt(state.nodeCount)); + return miniClusterState.client.requestWithBaseUrl(url, BenchState.COLLECTION, updateRequest); } } diff --git a/solr/benchmark/src/java/org/apache/solr/bench/search/FilterCache.java b/solr/benchmark/src/java/org/apache/solr/bench/search/FilterCache.java index e518ff90865..6b7f6bf4a4f 100644 --- a/solr/benchmark/src/java/org/apache/solr/bench/search/FilterCache.java +++ b/solr/benchmark/src/java/org/apache/solr/bench/search/FilterCache.java @@ -68,6 +68,7 @@ public static class BenchState { QueryRequest q1 = new QueryRequest(new SolrQuery("q", "*:*", "fq", "Ea_b:true")); QueryRequest q2 = new QueryRequest(new SolrQuery("q", "*:*", "fq", "FB_b:true")); + String baseUrl; @Setup(Level.Trial) public void setupTrial(MiniClusterState.MiniClusterBenchState miniClusterState) @@ -100,9 +101,7 @@ public Boolean generate(SolrRandomnessSource in) { docs.field("FB_b", booleans); miniClusterState.index(COLLECTION, docs, 30 * 1000); - String base = miniClusterState.nodes.get(0); - q1.setBasePath(base); - q2.setBasePath(base); + baseUrl = miniClusterState.nodes.get(0); } @Setup(Level.Iteration) @@ -110,8 +109,7 @@ public void setupIteration(MiniClusterState.MiniClusterBenchState miniClusterSta throws SolrServerException, IOException { // Reload the collection/core to drop existing caches CollectionAdminRequest.Reload reload = CollectionAdminRequest.reloadCollection(COLLECTION); - reload.setBasePath(miniClusterState.nodes.get(0)); - miniClusterState.client.request(reload); + miniClusterState.client.requestWithBaseUrl(miniClusterState.nodes.get(0), null, reload); } @TearDown(Level.Iteration) @@ -139,14 +137,17 @@ public void dumpMetrics(MiniClusterState.MiniClusterBenchState miniClusterState) public Object filterCacheMultipleQueries( BenchState benchState, MiniClusterState.MiniClusterBenchState miniClusterState) throws SolrServerException, IOException { - return miniClusterState.client.request( - miniClusterState.getRandom().nextBoolean() ? benchState.q1 : benchState.q2, COLLECTION); + return miniClusterState.client.requestWithBaseUrl( + benchState.baseUrl, + COLLECTION, + miniClusterState.getRandom().nextBoolean() ? benchState.q1 : benchState.q2); } @Benchmark public Object filterCacheSingleQuery( BenchState benchState, MiniClusterState.MiniClusterBenchState miniClusterState) throws SolrServerException, IOException { - return miniClusterState.client.request(benchState.q1, COLLECTION); + return miniClusterState.client.requestWithBaseUrl( + benchState.baseUrl, COLLECTION, benchState.q1); } } diff --git a/solr/benchmark/src/java/org/apache/solr/bench/search/JsonFaceting.java b/solr/benchmark/src/java/org/apache/solr/bench/search/JsonFaceting.java index 498faed5814..1595de56d3b 100755 --- a/solr/benchmark/src/java/org/apache/solr/bench/search/JsonFaceting.java +++ b/solr/benchmark/src/java/org/apache/solr/bench/search/JsonFaceting.java @@ -180,11 +180,13 @@ public Object jsonFacet( BenchState state, BenchState.ThreadState threadState) throws Exception { + final var url = miniClusterState.nodes.get(threadState.random.nextInt(state.nodeCount)); QueryRequest queryRequest = new QueryRequest(state.params); - queryRequest.setBasePath( - miniClusterState.nodes.get(threadState.random.nextInt(state.nodeCount))); - - NamedList result = miniClusterState.client.request(queryRequest, state.collection); + NamedList result = + miniClusterState + .client + .requestWithBaseUrl(url, state.collection, queryRequest) + .getResponse(); // MiniClusterState.log("result: " + result); diff --git a/solr/benchmark/src/java/org/apache/solr/bench/search/NumericSearch.java b/solr/benchmark/src/java/org/apache/solr/bench/search/NumericSearch.java index 3c7a72385f9..4d662205230 100644 --- a/solr/benchmark/src/java/org/apache/solr/bench/search/NumericSearch.java +++ b/solr/benchmark/src/java/org/apache/solr/bench/search/NumericSearch.java @@ -101,8 +101,8 @@ public void setupTrial(MiniClusterState.MiniClusterBenchState miniClusterState) q.setParam("facet.field", "numbers_i_dv", "term_low_s", "term_high_s"); q.setParam("facet.limit", String.valueOf(maxCardinality)); QueryRequest req = new QueryRequest(q); - req.setBasePath(basePath); - QueryResponse response = req.process(miniClusterState.client, COLLECTION); + QueryResponse response = + miniClusterState.client.requestWithBaseUrl(basePath, COLLECTION, req); Set numbers = response.getFacetField("numbers_i_dv").getValues().stream() .map(FacetField.Count::getName) @@ -144,8 +144,7 @@ public void setupIteration(MiniClusterState.MiniClusterBenchState miniClusterSta throws SolrServerException, IOException { // Reload the collection/core to drop existing caches CollectionAdminRequest.Reload reload = CollectionAdminRequest.reloadCollection(COLLECTION); - reload.setBasePath(miniClusterState.nodes.get(0)); - miniClusterState.client.request(reload); + miniClusterState.client.requestWithBaseUrl(miniClusterState.nodes.get(0), null, reload); } public QueryRequest intSetQuery(boolean dvs) { @@ -172,7 +171,6 @@ QueryRequest setQuery(String field) { termQueryField + ":" + lowCardTerms.next(), "fq", "{!terms cache=false f='" + field + "'}" + queries.next())); - q.setBasePath(basePath); return q; } } diff --git a/solr/benchmark/src/java/org/apache/solr/bench/search/QueryResponseWriters.java b/solr/benchmark/src/java/org/apache/solr/bench/search/QueryResponseWriters.java index 3c3217cc085..111a1d6ac50 100644 --- a/solr/benchmark/src/java/org/apache/solr/bench/search/QueryResponseWriters.java +++ b/solr/benchmark/src/java/org/apache/solr/bench/search/QueryResponseWriters.java @@ -88,7 +88,6 @@ public void setup(MiniClusterBenchState miniClusterState) throws Exception { q = new QueryRequest(params); q.setResponseParser(new NoOpResponseParser(wt)); String base = miniClusterState.nodes.get(0); - q.setBasePath(base); } } diff --git a/solr/benchmark/src/java/org/apache/solr/bench/search/SimpleSearch.java b/solr/benchmark/src/java/org/apache/solr/bench/search/SimpleSearch.java index 165d68ecb3b..46982b33b89 100644 --- a/solr/benchmark/src/java/org/apache/solr/bench/search/SimpleSearch.java +++ b/solr/benchmark/src/java/org/apache/solr/bench/search/SimpleSearch.java @@ -65,8 +65,6 @@ public void setupTrial(MiniClusterState.MiniClusterBenchState miniClusterState) miniClusterState.setUseHttp1(useHttp1); miniClusterState.startMiniCluster(1); miniClusterState.createCollection(COLLECTION, 1, 1); - String base = miniClusterState.nodes.get(0); - q.setBasePath(base); } @Setup(Level.Iteration) @@ -74,7 +72,6 @@ public void setupIteration(MiniClusterState.MiniClusterBenchState miniClusterSta throws SolrServerException, IOException { // Reload the collection/core to drop existing caches CollectionAdminRequest.Reload reload = CollectionAdminRequest.reloadCollection(COLLECTION); - reload.setBasePath(miniClusterState.nodes.get(0)); miniClusterState.client.request(reload); total = new AtomicLong(); diff --git a/solr/benchmark/src/test/org/apache/solr/bench/MiniClusterBenchStateTest.java b/solr/benchmark/src/test/org/apache/solr/bench/MiniClusterBenchStateTest.java index e17ed29dcd8..af568e3bb98 100644 --- a/solr/benchmark/src/test/org/apache/solr/bench/MiniClusterBenchStateTest.java +++ b/solr/benchmark/src/test/org/apache/solr/bench/MiniClusterBenchStateTest.java @@ -118,10 +118,7 @@ public void testMiniClusterState() throws Exception { miniBenchState.forceMerge(collection, 15); ModifiableSolrParams params = MiniClusterState.params("q", "*:*"); - QueryRequest queryRequest = new QueryRequest(params); - queryRequest.setBasePath(miniBenchState.nodes.get(0)); - QueryResponse result = queryRequest.process(miniBenchState.client, collection); BaseBenchState.log("match all query result=" + result); diff --git a/solr/bin/solr b/solr/bin/solr index edf28bf81b6..f4b7e2c7060 100755 --- a/solr/bin/solr +++ b/solr/bin/solr @@ -369,7 +369,7 @@ function print_usage() { echo "" echo "Usage: solr $CMD [-f] [--user-managed] [--host host] [-p port] [--server-dir directory] [-z zkHost] [-m memory] [-e example] [--solr-home solr.solr.home] [--data-home solr.data.home] [--jvm-opts \"jvm-opts\"] [--verbose]" echo "" - echo " -f Start Solr in foreground; default starts Solr in the background" + echo " -f/--foreground Start Solr in foreground; default starts Solr in the background" echo " and sends stdout / stderr to solr-PORT-console.log" echo "" echo " --user-managed Start Solr in user managed aka standalone mode" @@ -403,7 +403,7 @@ function print_usage() { echo " --data-home Sets the solr.data.home system property, where Solr will store index data in /data subdirectories." echo " If not set, Solr uses solr.solr.home for config and data." echo "" - echo " -e Name of the example to run; available examples:" + echo " -e/--example Name of the example to run; available examples:" echo " cloud: SolrCloud example" echo " techproducts: Comprehensive example illustrating many of Solr's core capabilities" echo " schemaless: Schema-less example (schema is inferred from data during indexing)" @@ -419,7 +419,7 @@ function print_usage() { echo " you could pass: -j \"--include-jetty-dir=/etc/jetty/custom/server/\"" echo " In most cases, you should wrap the additional parameters in double quotes." echo "" - echo " --no-prompt Don't prompt for input; accept all defaults when running examples that accept user input" + echo " -y/--no-prompt Don't prompt for input; accept all defaults when running examples that accept user input" echo "" echo " --force If attempting to start Solr as the root user, the script will exit with a warning that running Solr as \"root\" can cause problems." echo " It is possible to override this warning with the '--force' parameter." @@ -574,7 +574,7 @@ function stop_solr() { if [ $# -eq 1 ]; then case $1 in - --help|-h|-help) + --help|-h) run_tool "" exit ;; @@ -694,7 +694,7 @@ if [ $# -gt 0 ]; then PASS_TO_RUN_EXAMPLE+=("--user-managed") shift ;; - -d|--dir|-dir|--server-dir) + --server-dir) if [[ -z "$2" || "${2:0:1}" == "-" ]]; then print_usage "$SCRIPT_CMD" "Server directory is required when using the $1 option!" exit 1 @@ -714,7 +714,7 @@ if [ $# -gt 0 ]; then SOLR_SERVER_DIR="$(cd "$SOLR_SERVER_DIR" || (echo "SOLR_SERVER_DIR not found" && exit 1); pwd)" shift 2 ;; - -s|--solr-home|-solr.home) + --solr-home) if [[ -z "$2" || "${2:0:1}" == "-" ]]; then print_usage "$SCRIPT_CMD" "Solr home directory is required when using the $1 option!" exit 1 @@ -723,11 +723,15 @@ if [ $# -gt 0 ]; then SOLR_HOME="$2" shift 2 ;; - -t|--data-home|-data.home) + --data-home) + if [[ -z "$2" || "${2:0:1}" == "-" ]]; then + print_usage "$SCRIPT_CMD" "Data home directory is required when using the $1 option!" + exit 1 + fi SOLR_DATA_HOME="$2" shift 2 ;; - -e|--example|-example) + -e|--example) if [[ -z "$2" || "${2:0:1}" == "-" ]]; then print_usage "$SCRIPT_CMD" "Example name is required when using the $1 option!" exit 1 @@ -735,11 +739,11 @@ if [ $# -gt 0 ]; then EXAMPLE="$2" shift 2 ;; - -f|--foreground|-foreground) + -f|--foreground) FG="true" shift ;; - --host|-host) + --host) if [[ -z "$2" || "${2:0:1}" == "-" ]]; then print_usage "$SCRIPT_CMD" "Hostname is required when using the $1 option!" exit 1 @@ -748,7 +752,7 @@ if [ $# -gt 0 ]; then PASS_TO_RUN_EXAMPLE+=("--host" "$SOLR_HOST") shift 2 ;; - -m|--memory|-memory) + -m|--memory) if [[ -z "$2" || "${2:0:1}" == "-" ]]; then print_usage "$SCRIPT_CMD" "Memory setting is required when using the $1 option!" exit 1 @@ -757,7 +761,7 @@ if [ $# -gt 0 ]; then PASS_TO_RUN_EXAMPLE+=("-m" "$SOLR_HEAP") shift 2 ;; - -p|--port|-port) + -p|--port) if [[ -z "$2" || "${2:0:1}" == "-" ]]; then print_usage "$SCRIPT_CMD" "Port number is required when using the $1 option!" exit 1 @@ -767,7 +771,7 @@ if [ $# -gt 0 ]; then PASS_TO_RUN_EXAMPLE+=("-p" "$SOLR_PORT") shift 2 ;; - -z|--zk-host|-zkHost|--zkHost) + -z|--zk-host) if [[ -z "$2" || "${2:0:1}" == "-" ]]; then print_usage "$SCRIPT_CMD" "Zookeeper connection string is required when using the $1 option!" exit 1 @@ -776,7 +780,7 @@ if [ $# -gt 0 ]; then PASS_TO_RUN_EXAMPLE+=("-z" "$ZK_HOST") shift 2 ;; - -a|--jvm-opts|-addlopts) + --jvm-opts) if [[ -z "$2" ]]; then print_usage "$SCRIPT_CMD" "JVM options are required when using the $1 option!" exit 1 @@ -785,16 +789,15 @@ if [ $# -gt 0 ]; then PASS_TO_RUN_EXAMPLE+=("--jvm-opts" "$ADDITIONAL_CMD_OPTS") shift 2 ;; - -j|--jettyconfig|-jettyconfig) + -j|--jettyconfig) if [[ -z "$2" || "${2:0:1}" == "-" ]]; then print_usage "$SCRIPT_CMD" "Jetty config is required when using the $1 option!" exit 1 fi ADDITIONAL_JETTY_CONFIG="$2" - PASS_TO_RUN_EXAMPLE+=("-j" "$ADDITIONAL_JETTY_CONFIG") shift 2 ;; - -k|--key|-key) + -k|--key) if [[ -z "$2" || "${2:0:1}" == "-" ]]; then print_usage "$SCRIPT_CMD" "Stop key is required when using the $1 option!" exit 1 @@ -802,15 +805,15 @@ if [ $# -gt 0 ]; then STOP_KEY="$2" shift 2 ;; - -h|--help|-help) + -h|--help) print_usage "$SCRIPT_CMD" exit 0 ;; - --noprompt|-noprompt|--no-prompt) + -y|--no-prompt) PASS_TO_RUN_EXAMPLE+=("--no-prompt") shift ;; - -V|--verbose|-verbose|-v) + --verbose) verbose=true SOLR_LOG_LEVEL=DEBUG PASS_TO_RUN_EXAMPLE+=("--verbose") @@ -820,11 +823,11 @@ if [ $# -gt 0 ]; then SOLR_LOG_LEVEL=WARN shift ;; - --all|-all) + --all) stop_all=true shift ;; - --force|-force) + --force) FORCE=true PASS_TO_RUN_EXAMPLE+=("--force") shift @@ -1030,8 +1033,7 @@ if [ "${SOLR_HOME:0:${#EXAMPLE_DIR}}" = "$EXAMPLE_DIR" ]; then SOLR_LOGS_DIR="$SOLR_HOME/../logs" fi -# Set the logging manager by default, so that Lucene JUL logs are included with Solr logs. -LOG4J_CONFIG=("-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager") +LOG4J_CONFIG=() if [ -n "${LOG4J_PROPS:-}" ]; then LOG4J_CONFIG+=("-Dlog4j.configurationFile=$LOG4J_PROPS") fi diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd index 7167b1e3e9c..0df856c2ac0 100755 --- a/solr/bin/solr.cmd +++ b/solr/bin/solr.cmd @@ -248,22 +248,16 @@ set FIRST_ARG=%1 IF [%1]==[] goto usage -REM -help is a special case to faciliate folks learning about how to use Solr. -IF "%1"=="-help" goto run_solrcli -IF "%1"=="-usage" goto run_solrcli IF "%1"=="-h" goto run_solrcli IF "%1"=="--help" goto run_solrcli -IF "%1"=="-help" goto run_solrcli -IF "%1"=="/?" goto run_solrcli IF "%1"=="status" goto run_solrcli IF "%1"=="version" goto run_solrcli IF "%1"=="-v" goto run_solrcli -IF "%1"=="-version" goto run_solrcli +IF "%1"=="--version" goto run_solrcli IF "%1"=="assert" goto run_solrcli IF "%1"=="zk" goto run_solrcli IF "%1"=="export" goto run_solrcli IF "%1"=="package" goto run_solrcli -IF "%1"=="auth" goto run_solrcli IF "%1"=="api" goto run_solrcli IF "%1"=="post" goto run_solrcli @@ -288,11 +282,8 @@ goto parse_args :usage IF NOT "%SCRIPT_ERROR%"=="" ECHO %SCRIPT_ERROR% IF [%FIRST_ARG%]==[] goto run_solrcli -IF "%FIRST_ARG%"=="-help" goto run_solrcli -IF "%FIRST_ARG%"=="-usage" goto run_solrcli IF "%FIRST_ARG%"=="-h" goto run_solrcli IF "%FIRST_ARG%"=="--help" goto run_solrcli -IF "%FIRST_ARG%"=="/?" goto run_solrcli IF "%SCRIPT_CMD%"=="start" goto start_usage IF "%SCRIPT_CMD%"=="restart" goto start_usage IF "%SCRIPT_CMD%"=="stop" goto stop_usage @@ -311,7 +302,7 @@ goto done @echo. @echo Usage: solr %SCRIPT_CMD% [-f] [--user-managed] [--host hostname] [-p port] [--server-dir directory] [-z zkHost] [-m memory] [-e example] [--solr-home solr.solr.home] [--data-home solr.data.home] [--jvm-opts "jvm-opts"] [--verbose] @echo. -@echo -f Start Solr in foreground; default starts Solr in the background +@echo -f/--foreground Start Solr in foreground; default starts Solr in the background @echo and sends stdout / stderr to solr-PORT-console.log @echo. @echo --user-managed Start Solr in user managed aka standalone mode" @@ -319,7 +310,7 @@ goto done @echo. @echo --host host Specify the hostname for this Solr instance @echo. -@echo -p port Specify the port to start the Solr HTTP listener on; default is 8983 +@echo -p/--port port Specify the port to start the Solr HTTP listener on; default is 8983 @echo The specified port (SOLR_PORT) will also be used to determine the stop port @echo STOP_PORT=(%%SOLR_PORT%%-1000) and JMX RMI listen port RMI_PORT=(%%SOLR_PORT%%+10000). @echo For instance, if you set -p 8985, then the STOP_PORT=7985 and RMI_PORT=18985 @@ -331,10 +322,10 @@ goto done @echo an embedded ZooKeeper instance will be launched. @echo Set the ZK_CREATE_CHROOT environment variable to true if your ZK host has a chroot path, and you want to create it automatically." @echo. -@echo -m memory Sets the min (-Xms) and max (-Xmx) heap size for the JVM, such as: -m 4g +@echo -m/--memory memory Sets the min (-Xms) and max (-Xmx) heap size for the JVM, such as: -m 4g @echo results in: -Xms4g -Xmx4g; by default, this script sets the heap size to 512m @echo. -@echo --solr.home dir Sets the solr.solr.home system property; Solr will create core directories under +@echo --solr-home dir Sets the solr.solr.home system property; Solr will create core directories under @echo this directory. This allows you to run multiple Solr instances on the same host @echo while reusing the same server directory set using the --server-dir parameter. If set, the @echo specified directory should contain a solr.xml file, unless solr.xml exists in Zookeeper. @@ -345,7 +336,7 @@ goto done @echo --data-home dir Sets the solr.data.home system property, where Solr will store index data in ^/data subdirectories. @echo If not set, Solr uses solr.solr.home for both config and data. @echo. -@echo -e example Name of the example to run; available examples: +@echo -e/--example name Name of the example to run; available examples: @echo cloud: SolrCloud example @echo techproducts: Comprehensive example illustrating many of Solr's core capabilities @echo schemaless: Schema-less example (schema is inferred from data during indexing) @@ -361,7 +352,7 @@ goto done @echo you could pass: -j "--include-jetty-dir=/etc/jetty/custom/server/" @echo In most cases, you should wrap the additional parameters in double quotes. @echo. -@echo --no-prompt Don't prompt for input; accept all defaults when running examples that accept user input +@echo -y/--no-prompt Don't prompt for input; accept all defaults when running examples that accept user input @echo. @echo --verbose and -q/--quiet Verbose or quiet logging. Sets default log level to DEBUG or WARN instead of INFO @echo. @@ -391,25 +382,16 @@ set "arg=%~1" set "firstTwo=%arg:~0,2%" IF "%SCRIPT_CMD%"=="" set SCRIPT_CMD=start IF [%1]==[] goto process_script_cmd -IF "%1"=="-help" goto usage +IF "%1"=="--help" goto usage IF "%1"=="-h" goto usage -IF "%1"=="-usage" goto usage -IF "%1"=="/?" goto usage IF "%1"=="-f" goto set_foreground_mode IF "%1"=="--foreground" goto set_foreground_mode -IF "%1"=="-V" goto set_verbose IF "%1"=="--verbose" goto set_verbose -IF "%1"=="-v" goto set_verbose IF "%1"=="-q" goto set_warn IF "%1"=="--quiet" goto set_warn IF "%1"=="--user-managed" goto set_user_managed_mode -IF "%1"=="-d" goto set_server_dir -IF "%1"=="--dir" goto set_server_dir IF "%1"=="--server-dir" goto set_server_dir -IF "%1"=="-s" goto set_solr_home_dir IF "%1"=="--solr-home" goto set_solr_home_dir -IF "%1"=="-t" goto set_solr_data_dir -IF "%1"=="--solr-data" goto set_solr_data_dir IF "%1"=="--data-home" goto set_solr_data_dir IF "%1"=="-e" goto set_example IF "%1"=="--example" goto set_example @@ -420,21 +402,16 @@ IF "%1"=="-p" goto set_port IF "%1"=="--port" goto set_port IF "%1"=="-z" goto set_zookeeper IF "%1"=="--zk-host" goto set_zookeeper -IF "%1"=="-zkHost" goto set_zookeeper -IF "%1"=="--zkHost" goto set_zookeeper IF "%1"=="-s" goto set_solr_url IF "%1"=="--solr-url" goto set_solr_url -IF "%1"=="-solrUrl" goto set_solr_url -IF "%1"=="-a" goto set_jvm_opts IF "%1"=="--jvm-opts" goto set_jvm_opts IF "%1"=="-j" goto set_addl_jetty_config IF "%1"=="--jettyconfig" goto set_addl_jetty_config -IF "%1"=="--noprompt" goto set_noprompt IF "%1"=="--no-prompt" goto set_noprompt +IF "%1"=="-y" goto set_noprompt IF "%1"=="-k" goto set_stop_key IF "%1"=="--key" goto set_stop_key IF "%1"=="--all" goto set_stop_all -IF "%1"=="-all" goto set_stop_all IF "%firstTwo%"=="-D" goto set_passthru IF NOT "%1"=="" goto invalid_cmd_line goto invalid_cmd_line @@ -1086,7 +1063,7 @@ IF "%SOLR_SSL_ENABLED%"=="true" ( set SOLR_LOGS_DIR_QUOTED="%SOLR_LOGS_DIR%" set SOLR_DATA_HOME_QUOTED="%SOLR_DATA_HOME%" -set "START_OPTS=%START_OPTS% -Dsolr.log.dir=%SOLR_LOGS_DIR_QUOTED% -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager" +set "START_OPTS=%START_OPTS% -Dsolr.log.dir=%SOLR_LOGS_DIR_QUOTED%" IF NOT "%SOLR_DATA_HOME%"=="" set "START_OPTS=%START_OPTS% -Dsolr.data.home=%SOLR_DATA_HOME_QUOTED%" IF NOT DEFINED LOG4J_CONFIG set "LOG4J_CONFIG=%SOLR_SERVER_DIR%\resources\log4j2.xml" @@ -1137,9 +1114,8 @@ IF "%FG%"=="1" ( -Djava.io.tmpdir="%SOLR_SERVER_DIR%\tmp" -jar start.jar %SOLR_JETTY_CONFIG% "%SOLR_JETTY_ADDL_CONFIG%" > "!SOLR_LOGS_DIR!\solr-%SOLR_PORT%-console.log" echo %SOLR_PORT%>"%SOLR_TIP%"\bin\solr-%SOLR_PORT%.port - REM default to 30 seconds for backwards compatibility. IF "!SOLR_START_WAIT!"=="" ( - set SOLR_START_WAIT=30 + set SOLR_START_WAIT=180 ) REM now wait to see Solr come online ... "%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% %SOLR_TOOL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" -Dsolr.default.confdir="%DEFAULT_CONFDIR%"^ @@ -1181,10 +1157,7 @@ goto done IF [%1]==[] goto run_config IF "%1"=="-z" goto set_config_zk IF "%1"=="--zk-host" goto set_config_zk -IF "%1"=="-zkHost" goto set_config_zk -IF "%1"=="--zkHost" goto set_config_zk -IF "%1"=="-s" goto set_config_url_scheme -IF "%1"=="-scheme" goto set_config_url_scheme +IF "%1"=="--scheme" goto set_config_url_scheme set "CONFIG_ARGS=!CONFIG_ARGS! %1" SHIFT goto parse_config_args @@ -1201,244 +1174,7 @@ SHIFT SHIFT goto parse_config_args -REM Clumsy to do the state machine thing for -d and -n, but that's required for back-compat -:parse_zk_args -IF "%1"=="-V" ( - goto set_zk_verbose -) ELSE IF "%1"=="upconfig" ( - goto set_zk_op -) ELSE IF "%1"=="downconfig" ( - goto set_zk_op -) ELSE IF "%1"=="cp" ( - goto set_zk_op -) ELSE IF "%1"=="mv" ( - goto set_zk_op -) ELSE IF "%1"=="rm" ( - goto set_zk_op -) ELSE IF "%1"=="ls" ( - goto set_zk_op -) ELSE IF "%1"=="mkroot" ( - goto set_zk_op -) ELSE IF "%1"=="linkconfig" ( - goto set_zk_op -) ELSE IF "%1"=="updateacls" ( - goto set_zk_op -) ELSE IF "%1"=="-n" ( - goto set_config_name -) ELSE IF "%1"=="-r" ( - goto set_zk_recursive -) ELSE IF "%1"=="-configname" ( - goto set_config_name -) ELSE IF "%1"=="-d" ( - goto set_configdir -) ELSE IF "%1"=="-confdir" ( - goto set_configdir -) ELSE IF "%1"=="--conf-dir" ( - goto set_configdir -) ELSE IF "%1"=="-c" ( - goto set_collection_zk -) ELSE IF "%1"=="-z" ( - goto set_config_zk -) ELSE IF "!ZK_SRC!"=="" ( - if not "%~1"=="" ( - goto set_zk_src - ) -) ELSE IF "!ZK_DST!"=="" ( - IF "%ZK_OP%"=="cp" ( - goto set_zk_dst - ) - IF "%ZK_OP%"=="mv" ( - goto set_zk_dst - ) - set ZK_DST="_" -) ELSE IF NOT "%1"=="" ( - set ERROR_MSG="Unrecognized or misplaced zk argument %1%" - goto zk_short_usage -) -goto run_zk - -:set_zk_op -set ZK_OP=%~1 -SHIFT -goto parse_zk_args - -:set_zk_verbose -set ZK_VERBOSE="--verbose" -SHIFT -goto parse_zk_args - -:set_config_name -set CONFIGSET_NAME=%~2 -SHIFT -SHIFT -goto parse_zk_args - -:set_configdir -set CONFIGSET_DIR=%~2 -SHIFT -SHIFT -goto parse_zk_args - -:set_collection_zk -set ZK_COLLECTION=%~2 -SHIFT -SHIFT -goto parse_zk_args - -:set_config_zk -set ZK_HOST=%~2 -SHIFT -SHIFT -goto parse_zk_args - -:set_zk_src -set ZK_SRC=%~1 -SHIFT -goto parse_zk_args - -:set_zk_dst -set ZK_DST=%~1 -SHIFT -goto parse_zk_args - -:set_zk_recursive -set ZK_RECURSIVE="true" -SHIFT -goto parse_zk_args - -:run_zk -IF "!ZK_OP!"=="" ( - set "ERROR_MSG=Invalid command specified for zk sub-command" - goto zk_short_usage -) - -set CONNECTION_PARAMS="" - -IF "!ZK_OP!"=="" ( - set CONNECTION_PARAMS="--solr-url !ZK_SOLR_URL!" -) -ELSE ( - set CONNECTION_PARAMS="--zk-host ZK_HOST!" -) - -IF "!ZK_OP!"=="upconfig" ( - IF "!CONFIGSET_NAME!"=="" ( - set ERROR_MSG="-n option must be set for upconfig" - goto zk_short_usage - ) - IF "!CONFIGSET_DIR!"=="" ( - set ERROR_MSG="The -d option must be set for upconfig." - goto zk_short_usage - ) - "%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% %SOLR_TOOL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" ^ - -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^ - -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^ - org.apache.solr.cli.SolrCLI !ZK_OP! --conf-name !CONFIGSET_NAME! --conf-dir !CONFIGSET_DIR! %CONNECTION_PARAMS% %ZK_VERBOSE%^ -) ELSE IF "!ZK_OP!"=="downconfig" ( - IF "!CONFIGSET_NAME!"=="" ( - set ERROR_MSG="-n option must be set for downconfig" - goto zk_short_usage - ) - IF "!CONFIGSET_DIR!"=="" ( - set ERROR_MSG="The -d option must be set for downconfig." - goto zk_short_usage - ) - "%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% %SOLR_TOOL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" ^ - -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^ - -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^ - org.apache.solr.cli.SolrCLI !ZK_OP! --conf-name !CONFIGSET_NAME! --conf-dir !CONFIGSET_DIR! -z !ZK_HOST! %ZK_VERBOSE% -) ELSE IF "!ZK_OP!"=="linkconfig" ( - IF "!CONFIGSET_NAME!"=="" ( - set ERROR_MSG="-n option must be set for linkconfig" - goto zk_short_usage - ) - IF "!ZK_COLLECTION!"=="" ( - set ERROR_MSG="The -c option must be set for linkconfig." - goto zk_short_usage - ) - "%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% %SOLR_TOOL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" ^ - -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^ - -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^ - org.apache.solr.cli.SolrCLI !ZK_OP! --conf-name !CONFIGSET_NAME! -c !ZK_COLLECTION! -z !ZK_HOST! %ZK_VERBOSE% -) ELSE IF "!ZK_OP!"=="updateacls" ( - IF "%ZK_SRC"=="" ( - set ERROR_MSG="Zookeeper path to remove must be specified when using the 'ls' command" - goto zk_short_usage - ) - "%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% %SOLR_TOOL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" ^ - -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^ - -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^ - org.apache.solr.cli.SolrCLI !ZK_OP! --path !ZK_SRC! -z !ZK_HOST! %ZK_VERBOSE% -) ELSE IF "!ZK_OP!"=="cp" ( - IF "%ZK_SRC%"=="" ( - set ERROR_MSG=" must be specified for 'cp' command" - goto zk_short_usage - ) - IF "%ZK_DST%"=="" ( - set ERROR_MSG= must be specified for 'cp' command" - goto zk_short_usage - ) - IF NOT "!ZK_SRC:~0,3!"=="zk:" ( - IF NOT "!%ZK_DST:~0,3!"=="zk:" ( - set ERROR_MSG="At least one of src or dst must be prefixed by 'zk:'" - goto zk_short_usage - ) - ) - "%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% %SOLR_TOOL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" ^ - -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^ - -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^ - org.apache.solr.cli.SolrCLI !ZK_OP! -z !ZK_HOST! --source !ZK_SRC! --destination !ZK_DST! --recursive !ZK_RECURSIVE! %ZK_VERBOSE% -) ELSE IF "!ZK_OP!"=="mv" ( - IF "%ZK_SRC%"=="" ( - set ERROR_MSG=" must be specified for 'mv' command" - goto zk_short_usage - ) - IF "%ZK_DST%"=="" ( - set ERROR_MSG=" must be specified for 'mv' command" - goto zk_short_usage - ) - "%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% %SOLR_TOOL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" ^ - -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^ - -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^ - org.apache.solr.cli.SolrCLI !ZK_OP! -z !ZK_HOST! --source !ZK_SRC! --destination !ZK_DST! %ZK_VERBOSE% -) ELSE IF "!ZK_OP!"=="rm" ( - IF "%ZK_SRC"=="" ( - set ERROR_MSG="Zookeeper path to remove must be specified when using the 'rm' command" - goto zk_short_usage - ) - "%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% %SOLR_TOOL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" ^ - -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^ - -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^ - org.apache.solr.cli.SolrCLI !ZK_OP! -z !ZK_HOST! --path !ZK_SRC! --recursive !ZK_RECURSIVE! %ZK_VERBOSE% -) ELSE IF "!ZK_OP!"=="ls" ( - IF "%ZK_SRC"=="" ( - set ERROR_MSG="Zookeeper path to remove must be specified when using the 'ls' command" - goto zk_short_usage - ) - "%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% %SOLR_TOOL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" ^ - -Dlog4j.configurationFile="file:///%DEFAULT_SERVER_DIR%\resources\log4j2-console.xml" ^ - -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^ - org.apache.solr.cli.SolrCLI !ZK_OP! -z !ZK_HOST! --path !ZK_SRC! --recursive !ZK_RECURSIVE! %ZK_VERBOSE% -) ELSE IF "!ZK_OP!"=="mkroot" ( - IF "%ZK_SRC"=="" ( - set ERROR_MSG="Zookeeper path to create must be specified when using the 'mkroot' command" - goto zk_short_usage - ) - "%JAVA%" %SOLR_SSL_OPTS% %AUTHC_OPTS% %SOLR_ZK_CREDS_AND_ACLS% %SOLR_TOOL_OPTS% -Dsolr.install.dir="%SOLR_TIP%" ^ - -Dlog4j.configurationFile="file:///%SOLR_SERVER_DIR%\resources\log4j2-console.xml" ^ - -classpath "%DEFAULT_SERVER_DIR%\solr-webapp\webapp\WEB-INF\lib\*;%DEFAULT_SERVER_DIR%\lib\ext\*" ^ - org.apache.solr.cli.SolrCLI !ZK_OP! -z !ZK_HOST! --path !ZK_SRC! %ZK_VERBOSE% -) ELSE ( - set ERROR_MSG="Unknown zk option !ZK_OP!" - goto zk_short_usage -) -goto done - - :run_auth -IF "%1"=="-help" goto usage -IF "%1"=="-usage" goto usage - REM Options parsing. REM Note: With the following technique of parsing, it is not possible REM to have an option without a value. @@ -1516,9 +1252,9 @@ IF "%FIRST_ARG%"=="start" ( ) ELSE IF "%FIRST_ARG%"=="create" ( goto run_solrcli ) ELSE IF "%FIRST_ARG%"=="zk" ( - goto zk_short_usage + goto run_solrcli ) ELSE IF "%FIRST_ARG%"=="auth" ( - goto auth_usage + goto run_solrcli ) ELSE IF "%FIRST_ARG%"=="status" ( goto run_solrcli ) diff --git a/solr/bin/solr.in.cmd b/solr/bin/solr.in.cmd index 0e48ca4834d..60a16216c44 100755 --- a/solr/bin/solr.in.cmd +++ b/solr/bin/solr.in.cmd @@ -89,7 +89,7 @@ REM set RMI_PORT=18983 REM Anything you add to the SOLR_OPTS variable will be included in the java REM start command line as-is, in ADDITION to other options. If you specify the -REM -a option on start script, those options will be appended as well. Examples: +REM --jvm-opts option on start script, those options will be appended as well. Examples: REM set SOLR_OPTS=%SOLR_OPTS% -Dsolr.autoSoftCommit.maxTime=3000 REM set SOLR_OPTS=%SOLR_OPTS% -Dsolr.autoCommit.maxTime=60000 @@ -254,4 +254,4 @@ REM set SOLR_MODULES=extraction,ltr REM Configure the default replica placement plugin to use if one is not configured in cluster properties REM See https://solr.apache.org/guide/solr/latest/configuration-guide/replica-placement-plugins.html for details -REM set SOLR_PLACEMENTPLUGIN_DEFAULT=simple \ No newline at end of file +REM set SOLR_PLACEMENTPLUGIN_DEFAULT=simple diff --git a/solr/core/build.gradle b/solr/core/build.gradle index b36843fa568..92bbfbe1120 100644 --- a/solr/core/build.gradle +++ b/solr/core/build.gradle @@ -49,7 +49,6 @@ dependencies { api project(':solr:solrj-zookeeper') api project(':solr:solrj-streaming') - api 'io.dropwizard.metrics:metrics-core' implementation ('io.dropwizard.metrics:metrics-graphite', { exclude group: "com.rabbitmq", module: "amqp-client" @@ -125,6 +124,16 @@ dependencies { implementation 'org.eclipse.jetty.toolchain:jetty-servlet-api' // ZooKeeper + + implementation('org.apache.curator:curator-framework', { + exclude group: 'org.apache.zookeeper', module: 'zookeeper' + }) + implementation('org.apache.curator:curator-client', { + exclude group: 'org.apache.zookeeper', module: 'zookeeper' + }) + testImplementation('org.apache.curator:curator-test', { + exclude group: 'org.apache.zookeeper', module: 'zookeeper' + }) implementation('org.apache.zookeeper:zookeeper', { exclude group: "org.apache.yetus", module: "audience-annotations" }) diff --git a/solr/core/src/java/org/apache/solr/cli/ApiTool.java b/solr/core/src/java/org/apache/solr/cli/ApiTool.java index 76c6aa6f60f..02f893b3753 100644 --- a/solr/core/src/java/org/apache/solr/cli/ApiTool.java +++ b/solr/core/src/java/org/apache/solr/cli/ApiTool.java @@ -19,10 +19,9 @@ import java.io.PrintStream; import java.net.URI; -import java.util.List; import org.apache.commons.cli.CommandLine; -import org.apache.commons.cli.DeprecatedAttributes; import org.apache.commons.cli.Option; +import org.apache.commons.cli.Options; import org.apache.solr.client.solrj.SolrRequest; import org.apache.solr.client.solrj.impl.JsonMapResponseParser; import org.apache.solr.client.solrj.request.GenericSolrRequest; @@ -37,6 +36,16 @@ *

Used to send an arbitrary HTTP request to a Solr API endpoint. */ public class ApiTool extends ToolBase { + + private static final Option SOLR_URL_OPTION = + Option.builder("s") + .longOpt("solr-url") + .hasArg() + .argName("URL") + .required() + .desc("Send a GET request to a Solr API endpoint.") + .build(); + public ApiTool() { this(CLIO.getOutStream()); } @@ -51,43 +60,19 @@ public String getName() { } @Override - public List