You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ds...@apache.org on 2025/11/09 06:00:02 UTC
(solr) branch branch_10_0 updated (d097f4efbc1 -> de9c08d8b75)
This is an automated email from the ASF dual-hosted git repository.
dsmiley pushed a change to branch branch_10_0
in repository https://gitbox.apache.org/repos/asf/solr.git
from d097f4efbc1 DOAP changes for release 9.10.0
new 703e5e77c57 SOLR-17458: OTEL metrics: some renames (#3826)
new 7d78f48e7a7 SOLR-17069 SOLR-17503: Don't include jetty-jakarta-servlet-api JAR (EE9) (#3838)
new c10d3acec62 New gradle runDev alternative to "dev" (#3816)
new 64b8627a28c Remove unintentionally committed file
new de9c08d8b75 minor fix solr-jetty-context.xml defaultsDescriptor
The 5 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.
Summary of changes:
ExportTool.java.original | 738 ---------------------
dev-docs/gradle-help/workflow.txt | 11 +-
gradle/help.gradle | 2 +-
gradle/libs.versions.toml | 6 +-
solr/api/gradle.lockfile | 1 -
solr/benchmark/gradle.lockfile | 1 -
solr/core/build.gradle | 5 +-
solr/core/gradle.lockfile | 3 +-
.../solr/cluster/placement/impl/MetricImpl.java | 16 +-
.../cluster/placement/impl/NodeMetricImpl.java | 4 +-
.../cluster/placement/impl/ReplicaMetricImpl.java | 2 +-
.../java/org/apache/solr/core/CoreContainer.java | 16 +-
.../src/java/org/apache/solr/core/SolrCore.java | 51 +-
.../apache/solr/handler/ReplicationHandler.java | 35 +-
.../solr/handler/admin/CoreAdminHandler.java | 17 +-
.../handler/component/HttpShardHandlerFactory.java | 5 +-
.../apache/solr/metrics/SolrMetricsContext.java | 13 +
.../instruments/AttributedInstrumentFactory.java | 23 +-
.../org/apache/solr/search/SolrFieldCacheBean.java | 4 +-
.../org/apache/solr/search/SolrIndexSearcher.java | 26 +-
.../org/apache/solr/search/stats/StatsCache.java | 2 +-
.../org/apache/solr/update/SolrIndexWriter.java | 11 +-
.../org/apache/solr/update/UpdateShardHandler.java | 9 +-
.../org/apache/solr/util/stats/MetricUtils.java | 36 +-
.../stats/OtelInstrumentedExecutorService.java | 29 +-
.../cloud/CloudExitableDirectoryReaderTest.java | 4 +-
.../org/apache/solr/cloud/MigrateReplicasTest.java | 4 +-
.../org/apache/solr/cloud/ReplaceNodeTest.java | 4 +-
.../apache/solr/cloud/TestBaseStatsCacheCloud.java | 8 +-
.../impl/CollectionMetricsBuilderTest.java | 25 +-
.../solr/handler/RequestHandlerMetricsTest.java | 10 +-
.../solr/handler/admin/StatsReloadRaceTest.java | 2 +-
.../solr/metrics/SolrMetricsIntegrationTest.java | 4 +-
.../apache/solr/search/TestMainQueryCaching.java | 2 +-
.../apache/solr/search/TestSolrFieldCacheBean.java | 4 +-
.../apache/solr/servlet/HttpSolrCallCloudTest.java | 581 ++--------------
.../solr/servlet/TestRequestRateLimiter.java | 386 +----------
.../apache/solr/update/SolrIndexMetricsTest.java | 16 +-
.../stats/OtelInstrumentedExecutorServiceTest.java | 26 +-
solr/cross-dc-manager/gradle.lockfile | 1 -
.../jetty-jakarta-servlet-api-5.0.2.jar.sha1 | 1 -
solr/modules/analysis-extras/gradle.lockfile | 3 +-
solr/modules/clustering/gradle.lockfile | 3 +-
solr/modules/cross-dc/gradle.lockfile | 3 +-
solr/modules/cuvs/gradle.lockfile | 3 +-
solr/modules/extraction/gradle.lockfile | 3 +-
solr/modules/gcs-repository/gradle.lockfile | 3 +-
solr/modules/jwt-auth/build.gradle | 2 +-
solr/modules/jwt-auth/gradle.lockfile | 3 +-
solr/modules/langid/gradle.lockfile | 3 +-
solr/modules/llm/gradle.lockfile | 3 +-
solr/modules/ltr/gradle.lockfile | 3 +-
solr/modules/opentelemetry/gradle.lockfile | 3 +-
solr/modules/s3-repository/gradle.lockfile | 3 +-
solr/modules/scripting/gradle.lockfile | 3 +-
solr/modules/sql/gradle.lockfile | 3 +-
solr/packaging/build.gradle | 33 +
solr/server/build.gradle | 3 +-
solr/server/contexts/solr-jetty-context.xml | 2 +-
solr/server/gradle.lockfile | 3 +-
solr/solr-ref-guide/gradle.lockfile | 1 -
.../pages/major-changes-in-solr-10.adoc | 3 +-
solr/solrj-streaming/gradle.lockfile | 1 -
solr/solrj-zookeeper/gradle.lockfile | 1 -
.../solr/client/solrj/impl/NodeValueFetcher.java | 11 +-
solr/solrj/gradle.lockfile | 8 +-
.../client/solrj/impl/BasicHttpSolrClientTest.java | 1 +
solr/test-framework/gradle.lockfile | 1 -
.../apache/solr/cluster/placement/Builders.java | 2 +-
.../org/apache/solr/util/SolrMetricTestUtils.java | 9 +-
solr/webapp/gradle.lockfile | 3 +-
71 files changed, 345 insertions(+), 1925 deletions(-)
delete mode 100644 ExportTool.java.original
delete mode 100644 solr/licenses/jetty-jakarta-servlet-api-5.0.2.jar.sha1
(solr) 02/05: SOLR-17069 SOLR-17503: Don't include jetty-jakarta-servlet-api JAR (EE9) (#3838)
Posted by ds...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
dsmiley pushed a commit to branch branch_10_0
in repository https://gitbox.apache.org/repos/asf/solr.git
commit 7d78f48e7a798fefa1e94dbbdee0dcd194f9d247
Author: David Smiley <ds...@apache.org>
AuthorDate: Fri Nov 7 17:38:00 2025 -0500
SOLR-17069 SOLR-17503: Don't include jetty-jakarta-servlet-api JAR (EE9) (#3838)
We should not have this JAR org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api as it is for Jakarta EE 9, and it contains javax XSD definitions. It also contains servlet classes for v5 that compete with jakarta servlet-api v6 that we already depend on in some places.
* Use mocking instead of implementing the entire HttpServletRequest and response interfaces.
* toml: remove unused jetty lib references
* NOTICE: the servlet references were obsolete. The servlet JAR has it's own license file, and isn't CDDL either.
(cherry picked from commit 50808cdcdb9c2985aff5995f9ff3f5c8782f1be0)
---
gradle/libs.versions.toml | 6 +-
solr/api/gradle.lockfile | 1 -
solr/benchmark/gradle.lockfile | 1 -
solr/core/build.gradle | 5 +-
solr/core/gradle.lockfile | 3 +-
.../apache/solr/servlet/HttpSolrCallCloudTest.java | 581 ++-------------------
.../solr/servlet/TestRequestRateLimiter.java | 386 +-------------
solr/cross-dc-manager/gradle.lockfile | 1 -
.../jetty-jakarta-servlet-api-5.0.2.jar.sha1 | 1 -
solr/modules/analysis-extras/gradle.lockfile | 3 +-
solr/modules/clustering/gradle.lockfile | 3 +-
solr/modules/cross-dc/gradle.lockfile | 3 +-
solr/modules/cuvs/gradle.lockfile | 3 +-
solr/modules/extraction/gradle.lockfile | 3 +-
solr/modules/gcs-repository/gradle.lockfile | 3 +-
solr/modules/jwt-auth/build.gradle | 2 +-
solr/modules/jwt-auth/gradle.lockfile | 3 +-
solr/modules/langid/gradle.lockfile | 3 +-
solr/modules/llm/gradle.lockfile | 3 +-
solr/modules/ltr/gradle.lockfile | 3 +-
solr/modules/opentelemetry/gradle.lockfile | 3 +-
solr/modules/s3-repository/gradle.lockfile | 3 +-
solr/modules/scripting/gradle.lockfile | 3 +-
solr/modules/sql/gradle.lockfile | 3 +-
solr/server/build.gradle | 3 +-
solr/server/gradle.lockfile | 3 +-
solr/solr-ref-guide/gradle.lockfile | 1 -
.../pages/major-changes-in-solr-10.adoc | 3 +-
solr/solrj-streaming/gradle.lockfile | 1 -
solr/solrj-zookeeper/gradle.lockfile | 1 -
solr/solrj/gradle.lockfile | 1 -
.../client/solrj/impl/BasicHttpSolrClientTest.java | 1 +
solr/test-framework/gradle.lockfile | 1 -
solr/webapp/gradle.lockfile | 3 +-
34 files changed, 73 insertions(+), 974 deletions(-)
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 43bfc4bb5f0..86f6a33a61d 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -83,7 +83,6 @@ dockerfile-baseimage-java = "25"
dropwizard-metrics = "4.2.26"
eclipse-ecj = "3.39.0"
eclipse-jetty = "12.0.27"
-eclipse-jettytoolchain = "5.0.2"
# @keep jgit version used by git-status.gradle
eclipse-jgit = "7.3.0.202506031305-r"
essenty = "2.5.0"
@@ -122,6 +121,7 @@ hsqldb = "2.7.4"
ibm-icu = "77.1"
immutables-valueannotations = "2.10.1"
j256-simplemagic = "1.17"
+# Keep these Jakarta versions aligned with EE 10
jakarta-annotation = "2.1.1"
jakarta-inject = "2.0.1"
jakarta-servlet = "6.0.0"
@@ -332,7 +332,6 @@ eclipse-jetty-alpnjavaserver = { module = "org.eclipse.jetty:jetty-alpn-java-ser
eclipse-jetty-alpnserver = { module = "org.eclipse.jetty:jetty-alpn-server", version.ref = "eclipse-jetty" }
eclipse-jetty-client = { module = "org.eclipse.jetty:jetty-client", version.ref = "eclipse-jetty" }
eclipse-jetty-deploy = { module = "org.eclipse.jetty:jetty-deploy", version.ref = "eclipse-jetty" }
-eclipse-jetty-ee = { module = "org.eclipse.jetty:jetty-ee", version.ref = "eclipse-jetty" }
eclipse-jetty-ee10-servlet = { module = "org.eclipse.jetty.ee10:jetty-ee10-servlet", version.ref = "eclipse-jetty" }
eclipse-jetty-ee10-servlets = { module = "org.eclipse.jetty.ee10:jetty-ee10-servlets", version.ref = "eclipse-jetty" }
eclipse-jetty-ee10-webapp = { module = "org.eclipse.jetty.ee10:jetty-ee10-webapp", version.ref = "eclipse-jetty" }
@@ -344,14 +343,11 @@ eclipse-jetty-http2-httpclienttransport = { module = "org.eclipse.jetty.http2:je
eclipse-jetty-http2-server = { module = "org.eclipse.jetty.http2:jetty-http2-server", version.ref = "eclipse-jetty" }
eclipse-jetty-io = { module = "org.eclipse.jetty:jetty-io", version.ref = "eclipse-jetty" }
eclipse-jetty-jmx = { module = "org.eclipse.jetty:jetty-jmx", version.ref = "eclipse-jetty" }
-eclipse-jetty-jndi = { module = "org.eclipse.jetty:jetty-jndi", version.ref = "eclipse-jetty" }
-eclipse-jetty-plus = { module = "org.eclipse.jetty:jetty-plus", version.ref = "eclipse-jetty" }
eclipse-jetty-rewrite = { module = "org.eclipse.jetty:jetty-rewrite", version.ref = "eclipse-jetty" }
eclipse-jetty-security = { module = "org.eclipse.jetty:jetty-security", version.ref = "eclipse-jetty" }
eclipse-jetty-server = { module = "org.eclipse.jetty:jetty-server", version.ref = "eclipse-jetty" }
eclipse-jetty-session = { module = "org.eclipse.jetty:jetty-session", version.ref = "eclipse-jetty" }
eclipse-jetty-start = { module = "org.eclipse.jetty:jetty-start", version.ref = "eclipse-jetty" }
-eclipse-jetty-toolchain-servletapi = { module = "org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api", version.ref = "eclipse-jettytoolchain" }
eclipse-jetty-util = { module = "org.eclipse.jetty:jetty-util", version.ref = "eclipse-jetty" }
eclipse-jetty-xml = { module = "org.eclipse.jetty:jetty-xml", version.ref = "eclipse-jetty" }
eclipse-jgit-jgit = { module = "org.eclipse.jgit:org.eclipse.jgit", version.ref = "eclipse-jgit" }
diff --git a/solr/api/gradle.lockfile b/solr/api/gradle.lockfile
index f0f31acca93..80e1151820b 100644
--- a/solr/api/gradle.lockfile
+++ b/solr/api/gradle.lockfile
@@ -130,7 +130,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=jarValidation,testCompileClas
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=jarValidation,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=jarValidation,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=jarValidation,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=jarValidation,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=jarValidation,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,testRuntimeClasspath
diff --git a/solr/benchmark/gradle.lockfile b/solr/benchmark/gradle.lockfile
index bedee55d6b8..c69eb9ea37a 100644
--- a/solr/benchmark/gradle.lockfile
+++ b/solr/benchmark/gradle.lockfile
@@ -121,7 +121,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=compileClasspath,jarValidatio
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=compileClasspath,jarValidation,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=compileClasspath,jarValidation,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,runtimeClasspath,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=jarValidation,runtimeClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=compileClasspath,jarValidation,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=jarValidation,runtimeClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,runtimeClasspath,testRuntimeClasspath
diff --git a/solr/core/build.gradle b/solr/core/build.gradle
index bbe9b292141..1737714ab2f 100644
--- a/solr/core/build.gradle
+++ b/solr/core/build.gradle
@@ -67,11 +67,11 @@ dependencies {
implementation libs.jersey.core.common
implementation libs.jersey.core.server
implementation libs.hk2.api
+
implementation libs.jakarta.inject.api
implementation libs.jakarta.ws.rsapi
implementation libs.jakarta.annotation.api
-
- // Non-API below; although there are exceptions
+ implementation libs.jakarta.servlet.api
runtimeOnly libs.apache.lucene.analysis.kuromoji
runtimeOnly libs.apache.lucene.analysis.nori
@@ -116,7 +116,6 @@ dependencies {
implementation libs.eclipse.jetty.client
implementation libs.eclipse.jetty.http
implementation libs.eclipse.jetty.io
- implementation libs.eclipse.jetty.toolchain.servletapi
implementation libs.eclipse.jetty.util
// ZooKeeper
diff --git a/solr/core/gradle.lockfile b/solr/core/gradle.lockfile
index 453b1f64320..ccc40fb7f4f 100644
--- a/solr/core/gradle.lockfile
+++ b/solr/core/gradle.lockfile
@@ -78,7 +78,7 @@ io.swagger.core.v3:swagger-annotations-jakarta:2.2.22=apiHelper,compileClasspath
jakarta.activation:jakarta.activation-api:2.1.3=permitUnusedDeclared
jakarta.annotation:jakarta.annotation-api:2.1.1=compileClasspath,jarValidation,permitUnusedDeclared,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
jakarta.inject:jakarta.inject-api:2.0.1=compileClasspath,jarValidation,permitUnusedDeclared,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
-jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,testCompileClasspath,testRuntimeClasspath
+jakarta.servlet:jakarta.servlet-api:6.0.0=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
jakarta.validation:jakarta.validation-api:3.0.2=compileClasspath,jarValidation,permitUnusedDeclared,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
jakarta.ws.rs:jakarta.ws.rs-api:3.1.0=apiHelper,compileClasspath,jarValidation,permitUnusedDeclared,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
jakarta.xml.bind:jakarta.xml.bind-api:4.0.2=permitUnusedDeclared
@@ -140,7 +140,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=apiHelper,compileClasspath,ja
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,testRuntimeClasspath
diff --git a/solr/core/src/test/org/apache/solr/servlet/HttpSolrCallCloudTest.java b/solr/core/src/test/org/apache/solr/servlet/HttpSolrCallCloudTest.java
index 7e6fbf8bd07..447ce487506 100644
--- a/solr/core/src/test/org/apache/solr/servlet/HttpSolrCallCloudTest.java
+++ b/solr/core/src/test/org/apache/solr/servlet/HttpSolrCallCloudTest.java
@@ -17,45 +17,25 @@
package org.apache.solr.servlet;
-import jakarta.servlet.AsyncContext;
-import jakarta.servlet.DispatcherType;
-import jakarta.servlet.ReadListener;
-import jakarta.servlet.RequestDispatcher;
-import jakarta.servlet.ServletContext;
-import jakarta.servlet.ServletException;
-import jakarta.servlet.ServletInputStream;
-import jakarta.servlet.ServletOutputStream;
-import jakarta.servlet.ServletRequest;
-import jakarta.servlet.ServletResponse;
import jakarta.servlet.UnavailableException;
-import jakarta.servlet.WriteListener;
-import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
-import jakarta.servlet.http.HttpSession;
-import jakarta.servlet.http.HttpUpgradeHandler;
-import jakarta.servlet.http.Part;
-import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.URI;
-import java.security.Principal;
-import java.util.Collection;
-import java.util.Enumeration;
+import java.nio.charset.StandardCharsets;
import java.util.HashSet;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
import java.util.Set;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.client.solrj.request.CollectionAdminRequest;
import org.apache.solr.cloud.AbstractDistribZkTestBase;
import org.apache.solr.cloud.SolrCloudTestCase;
+import org.apache.solr.common.util.SuppressForbidden;
import org.apache.solr.embedded.JettySolrRunner;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.mockito.Mockito;
@SolrTestCaseJ4.SuppressSSL
public class HttpSolrCallCloudTest extends SolrCloudTestCase {
@@ -65,6 +45,7 @@ public class HttpSolrCallCloudTest extends SolrCloudTestCase {
@BeforeClass
public static void setupCluster() throws Exception {
+ SolrTestCaseJ4.assumeWorkingMockito();
configureCluster(1)
.addConfig(
"config", TEST_PATH().resolve("configsets").resolve("cloud-minimal").resolve("conf"))
@@ -78,9 +59,9 @@ public class HttpSolrCallCloudTest extends SolrCloudTestCase {
@Test
public void testCoreChosen() throws Exception {
- assertCoreChosen(NUM_SHARD, new TestRequest("/collection1/update"));
- assertCoreChosen(NUM_SHARD, new TestRequest("/collection1/update/json"));
- assertCoreChosen(NUM_SHARD * REPLICA_FACTOR, new TestRequest("/collection1/select"));
+ assertCoreChosen(NUM_SHARD, newRequest("/collection1/update"));
+ assertCoreChosen(NUM_SHARD, newRequest("/collection1/update/json"));
+ assertCoreChosen(NUM_SHARD * REPLICA_FACTOR, newRequest("/collection1/select"));
}
// https://issues.apache.org/jira/browse/SOLR-16019
@@ -94,7 +75,8 @@ public class HttpSolrCallCloudTest extends SolrCloudTestCase {
assertEquals(400, connection.getResponseCode());
}
- private void assertCoreChosen(int numCores, TestRequest testRequest) throws UnavailableException {
+ private void assertCoreChosen(int numCores, HttpServletRequest testRequest)
+ throws UnavailableException {
JettySolrRunner jettySolrRunner = cluster.getJettySolrRunner(0);
Set<String> coreNames = new HashSet<>();
SolrDispatchFilter dispatchFilter = jettySolrRunner.getSolrDispatchFilter();
@@ -102,7 +84,7 @@ public class HttpSolrCallCloudTest extends SolrCloudTestCase {
if (coreNames.size() == numCores) return;
HttpSolrCall httpSolrCall =
new HttpSolrCall(
- dispatchFilter, dispatchFilter.getCores(), testRequest, new TestResponse(), false);
+ dispatchFilter, dispatchFilter.getCores(), testRequest, newResponse(), false);
try {
httpSolrCall.init();
} catch (Exception e) {
@@ -114,523 +96,34 @@ public class HttpSolrCallCloudTest extends SolrCloudTestCase {
assertEquals(numCores, coreNames.size());
}
- public static class TestRequest implements HttpServletRequest {
- private final String path;
-
- public TestRequest(String path) {
- this.path = path;
- }
-
- @Override
- public String getAuthType() {
- return "";
- }
-
- @Override
- public Cookie[] getCookies() {
- return new Cookie[0];
- }
-
- @Override
- public long getDateHeader(String name) {
- return 0;
- }
-
- @Override
- public String getHeader(String name) {
- return "";
- }
-
- @Override
- public Enumeration<String> getHeaders(String name) {
- return null;
- }
-
- @Override
- public Enumeration<String> getHeaderNames() {
- return null;
- }
-
- @Override
- public int getIntHeader(String name) {
- return 0;
- }
-
- @Override
- public String getMethod() {
- return "";
- }
-
- @Override
- public String getPathInfo() {
- return "";
- }
-
- @Override
- public String getPathTranslated() {
- return "";
- }
-
- @Override
- public String getContextPath() {
- return "";
- }
-
- @Override
- public String getQueryString() {
- return "version=2";
- }
-
- @Override
- public String getRemoteUser() {
- return "";
- }
-
- @Override
- public boolean isUserInRole(String role) {
- return false;
- }
-
- @Override
- public Principal getUserPrincipal() {
- return null;
- }
-
- @Override
- public String getRequestedSessionId() {
- return "";
- }
-
- @Override
- public String getRequestURI() {
- return path;
- }
-
- @Override
- public StringBuffer getRequestURL() {
- return null;
- }
-
- @Override
- public String getServletPath() {
- return path;
- }
-
- @Override
- public HttpSession getSession(boolean create) {
- return null;
- }
-
- @Override
- public HttpSession getSession() {
- return null;
- }
-
- @Override
- public String changeSessionId() {
- return "";
- }
-
- @Override
- public boolean isRequestedSessionIdValid() {
- return false;
- }
-
- @Override
- public boolean isRequestedSessionIdFromCookie() {
- return false;
- }
-
- @Override
- public boolean isRequestedSessionIdFromURL() {
- return false;
- }
-
- @Override
- public boolean isRequestedSessionIdFromUrl() {
- return false;
- }
-
- @Override
- public boolean authenticate(HttpServletResponse response) throws IOException, ServletException {
- return false;
- }
-
- @Override
- public void login(String username, String password) throws ServletException {}
-
- @Override
- public void logout() throws ServletException {}
-
- @Override
- public Collection<Part> getParts() throws IOException, ServletException {
- return List.of();
- }
-
- @Override
- public Part getPart(String name) throws IOException, ServletException {
- return null;
- }
-
- @Override
- public <T extends HttpUpgradeHandler> T upgrade(Class<T> handlerClass)
- throws IOException, ServletException {
- return null;
- }
-
- @Override
- public Object getAttribute(String name) {
- return null;
- }
-
- @Override
- public Enumeration<String> getAttributeNames() {
- return null;
- }
-
- @Override
- public String getCharacterEncoding() {
- return "";
- }
-
- @Override
- public void setCharacterEncoding(String env) throws UnsupportedEncodingException {}
-
- @Override
- public int getContentLength() {
- return 0;
- }
-
- @Override
- public long getContentLengthLong() {
- return 0;
- }
-
- @Override
- public String getContentType() {
- return "application/json";
- }
-
- @Override
- public ServletInputStream getInputStream() throws IOException {
- return new ServletInputStream() {
- @Override
- public boolean isFinished() {
- return true;
- }
-
- @Override
- public boolean isReady() {
- return true;
- }
-
- @Override
- public void setReadListener(ReadListener readListener) {}
-
- @Override
- public int read() {
- return 0;
- }
- };
- }
-
- @Override
- public String getParameter(String name) {
- return "";
- }
-
- @Override
- public Enumeration<String> getParameterNames() {
- return null;
- }
-
- @Override
- public String[] getParameterValues(String name) {
- return new String[0];
- }
-
- @Override
- public Map<String, String[]> getParameterMap() {
- return Map.of();
- }
-
- @Override
- public String getProtocol() {
- return "";
- }
-
- @Override
- public String getScheme() {
- return "";
- }
-
- @Override
- public String getServerName() {
- return "";
- }
-
- @Override
- public int getServerPort() {
- return 0;
- }
-
- @Override
- public BufferedReader getReader() throws IOException {
- return null;
- }
-
- @Override
- public String getRemoteAddr() {
- return "";
- }
-
- @Override
- public String getRemoteHost() {
- return "";
- }
-
- @Override
- public void setAttribute(String name, Object o) {}
-
- @Override
- public void removeAttribute(String name) {}
-
- @Override
- public Locale getLocale() {
- return null;
- }
-
- @Override
- public Enumeration<Locale> getLocales() {
- return null;
- }
-
- @Override
- public boolean isSecure() {
- return false;
- }
-
- @Override
- public RequestDispatcher getRequestDispatcher(String path) {
- return null;
- }
-
- @Override
- public String getRealPath(String path) {
- return "";
- }
-
- @Override
- public int getRemotePort() {
- return 0;
- }
-
- @Override
- public String getLocalName() {
- return "";
- }
-
- @Override
- public String getLocalAddr() {
- return "";
- }
-
- @Override
- public int getLocalPort() {
- return 0;
- }
-
- @Override
- public ServletContext getServletContext() {
- return null;
- }
-
- @Override
- public AsyncContext startAsync() throws IllegalStateException {
- return null;
- }
-
- @Override
- public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse)
- throws IllegalStateException {
- return null;
- }
-
- @Override
- public boolean isAsyncStarted() {
- return false;
- }
-
- @Override
- public boolean isAsyncSupported() {
- return false;
- }
-
- @Override
- public AsyncContext getAsyncContext() {
- return null;
- }
-
- @Override
- public DispatcherType getDispatcherType() {
- return null;
- }
+ private static HttpServletRequest newRequest(String path) {
+ HttpServletRequest req = Mockito.mock(HttpServletRequest.class);
+ Mockito.when(req.getMethod()).thenReturn("GET");
+ Mockito.when(req.getRequestURI()).thenReturn(path);
+ Mockito.when(req.getServletPath()).thenReturn(path);
+ Mockito.when(req.getQueryString()).thenReturn("version=2");
+ Mockito.when(req.getContentType()).thenReturn("application/json");
+ Mockito.when(req.getHeader("Content-Type")).thenReturn("application/json");
+ try {
+ Mockito.when(req.getInputStream())
+ .thenReturn(ServletUtils.ClosedServletInputStream.CLOSED_SERVLET_INPUT_STREAM);
+ } catch (IOException e) { // impossible; only required because we mock methods that throw
+ throw new RuntimeException(e);
+ }
+ return req;
}
- public static class TestResponse implements HttpServletResponse {
-
- @Override
- public void addCookie(Cookie cookie) {}
-
- @Override
- public boolean containsHeader(String name) {
- return false;
- }
-
- @Override
- public String encodeURL(String url) {
- return "";
- }
-
- @Override
- public String encodeRedirectURL(String url) {
- return "";
- }
-
- @Override
- public String encodeUrl(String url) {
- return "";
- }
-
- @Override
- public String encodeRedirectUrl(String url) {
- return "";
- }
-
- @Override
- public void sendError(int sc, String msg) throws IOException {}
-
- @Override
- public void sendError(int sc) throws IOException {}
-
- @Override
- public void sendRedirect(String location) throws IOException {}
-
- @Override
- public void setDateHeader(String name, long date) {}
-
- @Override
- public void addDateHeader(String name, long date) {}
-
- @Override
- public void setHeader(String name, String value) {}
-
- @Override
- public void addHeader(String name, String value) {}
-
- @Override
- public void setIntHeader(String name, int value) {}
-
- @Override
- public void addIntHeader(String name, int value) {}
-
- @Override
- public void setStatus(int sc) {}
-
- @Override
- public void setStatus(int sc, String sm) {}
-
- @Override
- public int getStatus() {
- return 0;
- }
-
- @Override
- public String getHeader(String name) {
- return "";
- }
-
- @Override
- public Collection<String> getHeaders(String name) {
- return List.of();
- }
-
- @Override
- public Collection<String> getHeaderNames() {
- return List.of();
- }
-
- @Override
- public String getCharacterEncoding() {
- return "";
- }
-
- @Override
- public String getContentType() {
- return "";
- }
-
- @Override
- public ServletOutputStream getOutputStream() throws IOException {
- return new ServletOutputStream() {
- @Override
- public boolean isReady() {
- return true;
- }
-
- @Override
- public void setWriteListener(WriteListener writeListener) {}
-
- @Override
- public void write(int b) {}
- };
- }
-
- @Override
- public PrintWriter getWriter() throws IOException {
- return null;
- }
-
- @Override
- public void setCharacterEncoding(String charset) {}
-
- @Override
- public void setContentLength(int len) {}
-
- @Override
- public void setContentLengthLong(long len) {}
-
- @Override
- public void setContentType(String type) {}
-
- @Override
- public void setBufferSize(int size) {}
-
- @Override
- public int getBufferSize() {
- return 0;
- }
-
- @Override
- public void flushBuffer() throws IOException {}
-
- @Override
- public void resetBuffer() {}
-
- @Override
- public boolean isCommitted() {
- return true;
- }
-
- @Override
- public void reset() {}
-
- @Override
- public void setLocale(Locale loc) {}
-
- @Override
- public Locale getLocale() {
- return null;
- }
+ @SuppressForbidden(reason = "tests needn't comply")
+ private static HttpServletResponse newResponse() {
+ HttpServletResponse resp = Mockito.mock(HttpServletResponse.class);
+ try {
+ Mockito.when(resp.getOutputStream())
+ .thenReturn(ServletUtils.ClosedServletOutputStream.CLOSED_SERVLET_OUTPUT_STREAM);
+ Mockito.when(resp.getWriter())
+ .thenReturn(new PrintWriter(System.out, false, StandardCharsets.UTF_8));
+ } catch (IOException e) { // impossible; only required because we mock methods that throw
+ throw new RuntimeException(e);
+ }
+ return resp;
}
}
diff --git a/solr/core/src/test/org/apache/solr/servlet/TestRequestRateLimiter.java b/solr/core/src/test/org/apache/solr/servlet/TestRequestRateLimiter.java
index 53a65ad7f40..f563de91ebd 100644
--- a/solr/core/src/test/org/apache/solr/servlet/TestRequestRateLimiter.java
+++ b/solr/core/src/test/org/apache/solr/servlet/TestRequestRateLimiter.java
@@ -23,31 +23,11 @@ import static org.apache.solr.servlet.RateLimitManager.DEFAULT_SLOT_ACQUISITION_
import static org.hamcrest.CoreMatchers.containsString;
import static org.hamcrest.CoreMatchers.instanceOf;
-import jakarta.servlet.AsyncContext;
-import jakarta.servlet.DispatcherType;
-import jakarta.servlet.RequestDispatcher;
-import jakarta.servlet.ServletContext;
-import jakarta.servlet.ServletException;
-import jakarta.servlet.ServletInputStream;
-import jakarta.servlet.ServletRequest;
-import jakarta.servlet.ServletResponse;
-import jakarta.servlet.http.Cookie;
import jakarta.servlet.http.HttpServletRequest;
-import jakarta.servlet.http.HttpServletResponse;
-import jakarta.servlet.http.HttpSession;
-import jakarta.servlet.http.HttpUpgradeHandler;
-import jakarta.servlet.http.Part;
-import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.security.Principal;
import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Enumeration;
import java.util.List;
-import java.util.Locale;
-import java.util.Map;
import java.util.Random;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
@@ -58,6 +38,7 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.LongAdder;
+import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.SolrQuery;
import org.apache.solr.client.solrj.SolrRequest;
@@ -72,6 +53,7 @@ import org.apache.solr.common.util.ExecutorUtil;
import org.apache.solr.core.RateLimiterConfig;
import org.junit.BeforeClass;
import org.junit.Test;
+import org.mockito.Mockito;
public class TestRequestRateLimiter extends SolrCloudTestCase {
private static final String FIRST_COLLECTION = "c1";
@@ -79,6 +61,7 @@ public class TestRequestRateLimiter extends SolrCloudTestCase {
@BeforeClass
public static void setupCluster() throws Exception {
+ SolrTestCaseJ4.assumeWorkingMockito();
configureCluster(1).addConfig(FIRST_COLLECTION, configset("cloud-minimal")).configure();
}
@@ -293,363 +276,16 @@ public class TestRequestRateLimiter extends SolrCloudTestCase {
assertTrue(mgr.getRequestRateLimiter(SolrRequest.SolrRequestType.UPDATE).isEmpty());
}
- private static final HttpServletRequest QUERY_REQ = new DummyRequest(null, "QUERY");
- private static final HttpServletRequest UPDATE_REQ = new DummyRequest(null, "UPDATE");
-
- private static class DummyRequest implements HttpServletRequest {
- private final String ctx;
- private final String type;
-
- public DummyRequest(String ctx, String type) {
- this.ctx = ctx;
- this.type = type;
- }
-
- @Override
- public String getAuthType() {
- return "";
- }
-
- @Override
- public Cookie[] getCookies() {
- return new Cookie[0];
- }
-
- @Override
- public long getDateHeader(String name) {
- return 0;
- }
-
- @Override
- public String getHeader(String name) {
- switch (name) {
- case SOLR_REQUEST_CONTEXT_PARAM:
- return ctx;
- case SOLR_REQUEST_TYPE_PARAM:
- return type;
- default:
- throw new IllegalArgumentException();
- }
- }
-
- @Override
- public Enumeration<String> getHeaders(String name) {
- return null;
- }
-
- @Override
- public Enumeration<String> getHeaderNames() {
- return null;
- }
-
- @Override
- public int getIntHeader(String name) {
- return 0;
- }
-
- @Override
- public String getMethod() {
- return "";
- }
-
- @Override
- public String getPathInfo() {
- return "";
- }
-
- @Override
- public String getPathTranslated() {
- return "";
- }
-
- @Override
- public String getContextPath() {
- return "";
- }
-
- @Override
- public String getQueryString() {
- return "";
- }
-
- @Override
- public String getRemoteUser() {
- return "";
- }
-
- @Override
- public boolean isUserInRole(String role) {
- return false;
- }
-
- @Override
- public Principal getUserPrincipal() {
- return null;
- }
-
- @Override
- public String getRequestedSessionId() {
- return "";
- }
-
- @Override
- public String getRequestURI() {
- return "";
- }
-
- @Override
- public StringBuffer getRequestURL() {
- return null;
- }
-
- @Override
- public String getServletPath() {
- return "";
- }
-
- @Override
- public HttpSession getSession(boolean create) {
- return null;
- }
-
- @Override
- public HttpSession getSession() {
- return null;
- }
-
- @Override
- public String changeSessionId() {
- return "";
- }
-
- @Override
- public boolean isRequestedSessionIdValid() {
- return false;
- }
-
- @Override
- public boolean isRequestedSessionIdFromCookie() {
- return false;
- }
-
- @Override
- public boolean isRequestedSessionIdFromURL() {
- return false;
- }
-
- @Override
- public boolean isRequestedSessionIdFromUrl() {
- return false;
- }
-
- @Override
- public boolean authenticate(HttpServletResponse response) throws IOException, ServletException {
- return false;
- }
-
- @Override
- public void login(String username, String password) throws ServletException {}
-
- @Override
- public void logout() throws ServletException {}
-
- @Override
- public Collection<Part> getParts() throws IOException, ServletException {
- return List.of();
- }
-
- @Override
- public Part getPart(String name) throws IOException, ServletException {
- return null;
- }
-
- @Override
- public <T extends HttpUpgradeHandler> T upgrade(Class<T> handlerClass)
- throws IOException, ServletException {
- return null;
- }
-
- @Override
- public Object getAttribute(String name) {
- return null;
- }
-
- @Override
- public Enumeration<String> getAttributeNames() {
- return null;
- }
-
- @Override
- public String getCharacterEncoding() {
- return "";
- }
-
- @Override
- public void setCharacterEncoding(String env) throws UnsupportedEncodingException {}
-
- @Override
- public int getContentLength() {
- return 0;
- }
-
- @Override
- public long getContentLengthLong() {
- return 0;
- }
-
- @Override
- public String getContentType() {
- return "";
- }
-
- @Override
- public ServletInputStream getInputStream() throws IOException {
- return null;
- }
-
- @Override
- public String getParameter(String name) {
- return "";
- }
-
- @Override
- public Enumeration<String> getParameterNames() {
- return null;
- }
-
- @Override
- public String[] getParameterValues(String name) {
- return new String[0];
- }
-
- @Override
- public Map<String, String[]> getParameterMap() {
- return Map.of();
- }
-
- @Override
- public String getProtocol() {
- return "";
- }
-
- @Override
- public String getScheme() {
- return "";
- }
-
- @Override
- public String getServerName() {
- return "";
- }
-
- @Override
- public int getServerPort() {
- return 0;
- }
-
- @Override
- public BufferedReader getReader() throws IOException {
- return null;
- }
-
- @Override
- public String getRemoteAddr() {
- return "";
- }
-
- @Override
- public String getRemoteHost() {
- return "";
- }
-
- @Override
- public void setAttribute(String name, Object o) {}
-
- @Override
- public void removeAttribute(String name) {}
-
- @Override
- public Locale getLocale() {
- return null;
- }
-
- @Override
- public Enumeration<Locale> getLocales() {
- return null;
- }
-
- @Override
- public boolean isSecure() {
- return false;
- }
-
- @Override
- public RequestDispatcher getRequestDispatcher(String path) {
- return null;
- }
-
- @Override
- public String getRealPath(String path) {
- return "";
- }
-
- @Override
- public int getRemotePort() {
- return 0;
- }
-
- @Override
- public String getLocalName() {
- return "";
- }
-
- @Override
- public String getLocalAddr() {
- return "";
- }
-
- @Override
- public int getLocalPort() {
- return 0;
- }
-
- @Override
- public ServletContext getServletContext() {
- return null;
- }
-
- @Override
- public AsyncContext startAsync() throws IllegalStateException {
- return null;
- }
-
- @Override
- public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse)
- throws IllegalStateException {
- return null;
- }
-
- @Override
- public boolean isAsyncStarted() {
- return false;
- }
-
- @Override
- public boolean isAsyncSupported() {
- return false;
- }
-
- @Override
- public AsyncContext getAsyncContext() {
- return null;
- }
-
- @Override
- public DispatcherType getDispatcherType() {
- return null;
- }
+ private static HttpServletRequest newRequest(String type, String ctx) {
+ HttpServletRequest req = Mockito.mock(HttpServletRequest.class);
+ Mockito.when(req.getHeader(SOLR_REQUEST_TYPE_PARAM)).thenReturn(type);
+ Mockito.when(req.getHeader(SOLR_REQUEST_CONTEXT_PARAM)).thenReturn(ctx);
+ return req;
}
+ private static final HttpServletRequest QUERY_REQ = newRequest("QUERY", null);
+ private static final HttpServletRequest UPDATE_REQ = newRequest("UPDATE", null);
+
@Nightly
public void testSlotBorrowing() throws Exception {
try (CloudSolrClient client =
diff --git a/solr/cross-dc-manager/gradle.lockfile b/solr/cross-dc-manager/gradle.lockfile
index 89f6c3c7584..c5725676656 100644
--- a/solr/cross-dc-manager/gradle.lockfile
+++ b/solr/cross-dc-manager/gradle.lockfile
@@ -161,7 +161,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=compileClasspath,jarValidatio
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,solrPlatformLibs,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,solrPlatformLibs,testRuntimeClasspath
diff --git a/solr/licenses/jetty-jakarta-servlet-api-5.0.2.jar.sha1 b/solr/licenses/jetty-jakarta-servlet-api-5.0.2.jar.sha1
deleted file mode 100644
index 24ce91c7556..00000000000
--- a/solr/licenses/jetty-jakarta-servlet-api-5.0.2.jar.sha1
+++ /dev/null
@@ -1 +0,0 @@
-027fce6d666a203526236d33d00e202a4136230f
diff --git a/solr/modules/analysis-extras/gradle.lockfile b/solr/modules/analysis-extras/gradle.lockfile
index 0755383e6c4..3e404fed263 100644
--- a/solr/modules/analysis-extras/gradle.lockfile
+++ b/solr/modules/analysis-extras/gradle.lockfile
@@ -72,7 +72,7 @@ io.sgr:s2-geometry-library-java:1.0.0=apiHelper,jarValidation,runtimeClasspath,r
io.swagger.core.v3:swagger-annotations-jakarta:2.2.22=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.annotation:jakarta.annotation-api:2.1.1=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.inject:jakarta.inject-api:2.0.1=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
-jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,testCompileClasspath,testRuntimeClasspath
+jakarta.servlet:jakarta.servlet-api:6.0.0=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.validation:jakarta.validation-api:3.0.2=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.ws.rs:jakarta.ws.rs-api:3.1.0=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
javax.inject:javax.inject:1=annotationProcessor,errorprone,testAnnotationProcessor
@@ -136,7 +136,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=apiHelper,compileClasspath,ja
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,testRuntimeClasspath
diff --git a/solr/modules/clustering/gradle.lockfile b/solr/modules/clustering/gradle.lockfile
index 3956d4fc49a..7f1c903c5f0 100644
--- a/solr/modules/clustering/gradle.lockfile
+++ b/solr/modules/clustering/gradle.lockfile
@@ -70,7 +70,7 @@ io.sgr:s2-geometry-library-java:1.0.0=jarValidation,runtimeClasspath,runtimeLibs
io.swagger.core.v3:swagger-annotations-jakarta:2.2.22=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.annotation:jakarta.annotation-api:2.1.1=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.inject:jakarta.inject-api:2.0.1=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
-jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,testCompileClasspath,testRuntimeClasspath
+jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.validation:jakarta.validation-api:3.0.2=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.ws.rs:jakarta.ws.rs-api:3.1.0=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
javax.inject:javax.inject:1=annotationProcessor,errorprone,testAnnotationProcessor
@@ -124,7 +124,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=compileClasspath,jarValidatio
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,testRuntimeClasspath
diff --git a/solr/modules/cross-dc/gradle.lockfile b/solr/modules/cross-dc/gradle.lockfile
index 691dd1cb522..88655f6183f 100644
--- a/solr/modules/cross-dc/gradle.lockfile
+++ b/solr/modules/cross-dc/gradle.lockfile
@@ -71,7 +71,7 @@ io.sgr:s2-geometry-library-java:1.0.0=apiHelper,jarValidation,runtimeClasspath,r
io.swagger.core.v3:swagger-annotations-jakarta:2.2.22=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.annotation:jakarta.annotation-api:2.1.1=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.inject:jakarta.inject-api:2.0.1=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
-jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,testCompileClasspath,testRuntimeClasspath
+jakarta.servlet:jakarta.servlet-api:6.0.0=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.validation:jakarta.validation-api:3.0.2=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.ws.rs:jakarta.ws.rs-api:3.1.0=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
javax.inject:javax.inject:1=annotationProcessor,errorprone,testAnnotationProcessor
@@ -127,7 +127,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=apiHelper,compileClasspath,ja
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,testRuntimeClasspath
diff --git a/solr/modules/cuvs/gradle.lockfile b/solr/modules/cuvs/gradle.lockfile
index 50bfde70279..07131084b65 100644
--- a/solr/modules/cuvs/gradle.lockfile
+++ b/solr/modules/cuvs/gradle.lockfile
@@ -72,7 +72,7 @@ io.sgr:s2-geometry-library-java:1.0.0=jarValidation,runtimeClasspath,runtimeLibs
io.swagger.core.v3:swagger-annotations-jakarta:2.2.22=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.annotation:jakarta.annotation-api:2.1.1=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.inject:jakarta.inject-api:2.0.1=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
-jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,testCompileClasspath,testRuntimeClasspath
+jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.validation:jakarta.validation-api:3.0.2=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.ws.rs:jakarta.ws.rs-api:3.1.0=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
javax.inject:javax.inject:1=annotationProcessor,errorprone,testAnnotationProcessor
@@ -125,7 +125,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=compileClasspath,jarValidatio
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,testRuntimeClasspath
diff --git a/solr/modules/extraction/gradle.lockfile b/solr/modules/extraction/gradle.lockfile
index 0ff229b9282..a8c49ad423c 100644
--- a/solr/modules/extraction/gradle.lockfile
+++ b/solr/modules/extraction/gradle.lockfile
@@ -73,7 +73,7 @@ io.sgr:s2-geometry-library-java:1.0.0=jarValidation,runtimeClasspath,runtimeLibs
io.swagger.core.v3:swagger-annotations-jakarta:2.2.22=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.annotation:jakarta.annotation-api:2.1.1=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.inject:jakarta.inject-api:2.0.1=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
-jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,testCompileClasspath,testRuntimeClasspath
+jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.validation:jakarta.validation-api:3.0.2=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.ws.rs:jakarta.ws.rs-api:3.1.0=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
javax.inject:javax.inject:1=annotationProcessor,errorprone,testAnnotationProcessor
@@ -129,7 +129,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=compileClasspath,jarValidatio
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,testRuntimeClasspath
diff --git a/solr/modules/gcs-repository/gradle.lockfile b/solr/modules/gcs-repository/gradle.lockfile
index 5c9b3c36d4b..5b039ec1577 100644
--- a/solr/modules/gcs-repository/gradle.lockfile
+++ b/solr/modules/gcs-repository/gradle.lockfile
@@ -121,7 +121,7 @@ io.sgr:s2-geometry-library-java:1.0.0=apiHelper,jarValidation,runtimeClasspath,r
io.swagger.core.v3:swagger-annotations-jakarta:2.2.22=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.annotation:jakarta.annotation-api:2.1.1=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.inject:jakarta.inject-api:2.0.1=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
-jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,testCompileClasspath,testRuntimeClasspath
+jakarta.servlet:jakarta.servlet-api:6.0.0=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.validation:jakarta.validation-api:3.0.2=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.ws.rs:jakarta.ws.rs-api:3.1.0=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
javax.inject:javax.inject:1=annotationProcessor,errorprone,jarValidation,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath
@@ -176,7 +176,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=apiHelper,compileClasspath,ja
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,testRuntimeClasspath
diff --git a/solr/modules/jwt-auth/build.gradle b/solr/modules/jwt-auth/build.gradle
index 8cb1d237bc0..7cc4afb007e 100644
--- a/solr/modules/jwt-auth/build.gradle
+++ b/solr/modules/jwt-auth/build.gradle
@@ -38,9 +38,9 @@ dependencies {
implementation libs.eclipse.jetty.client
implementation libs.eclipse.jetty.http
- implementation libs.eclipse.jetty.toolchain.servletapi
implementation libs.google.guava
implementation libs.slf4j.api
+ implementation libs.jakarta.servlet.api
testImplementation project(':solr:test-framework')
testImplementation libs.apache.lucene.testframework
diff --git a/solr/modules/jwt-auth/gradle.lockfile b/solr/modules/jwt-auth/gradle.lockfile
index 53ce9aa43ca..1cb162af3de 100644
--- a/solr/modules/jwt-auth/gradle.lockfile
+++ b/solr/modules/jwt-auth/gradle.lockfile
@@ -84,7 +84,7 @@ io.sgr:s2-geometry-library-java:1.0.0=jarValidation,runtimeClasspath,runtimeLibs
io.swagger.core.v3:swagger-annotations-jakarta:2.2.22=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.annotation:jakarta.annotation-api:2.1.1=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.inject:jakarta.inject-api:2.0.1=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
-jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,testCompileClasspath,testRuntimeClasspath
+jakarta.servlet:jakarta.servlet-api:6.0.0=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.validation:jakarta.validation-api:3.0.2=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.ws.rs:jakarta.ws.rs-api:3.1.0=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
javax.inject:javax.inject:1=annotationProcessor,errorprone,testAnnotationProcessor
@@ -148,7 +148,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=compileClasspath,jarValidatio
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,testRuntimeClasspath
diff --git a/solr/modules/langid/gradle.lockfile b/solr/modules/langid/gradle.lockfile
index bef5adb997e..f0f9e63cbe9 100644
--- a/solr/modules/langid/gradle.lockfile
+++ b/solr/modules/langid/gradle.lockfile
@@ -71,7 +71,7 @@ io.sgr:s2-geometry-library-java:1.0.0=jarValidation,runtimeClasspath,runtimeLibs
io.swagger.core.v3:swagger-annotations-jakarta:2.2.22=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.annotation:jakarta.annotation-api:2.1.1=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.inject:jakarta.inject-api:2.0.1=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
-jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,testCompileClasspath,testRuntimeClasspath
+jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.validation:jakarta.validation-api:3.0.2=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.ws.rs:jakarta.ws.rs-api:3.1.0=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
javax.inject:javax.inject:1=annotationProcessor,errorprone,testAnnotationProcessor
@@ -126,7 +126,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=compileClasspath,jarValidatio
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,testRuntimeClasspath
diff --git a/solr/modules/llm/gradle.lockfile b/solr/modules/llm/gradle.lockfile
index febb1155d26..9e0f104cb20 100644
--- a/solr/modules/llm/gradle.lockfile
+++ b/solr/modules/llm/gradle.lockfile
@@ -85,7 +85,7 @@ io.sgr:s2-geometry-library-java:1.0.0=jarValidation,runtimeClasspath,runtimeLibs
io.swagger.core.v3:swagger-annotations-jakarta:2.2.22=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.annotation:jakarta.annotation-api:2.1.1=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.inject:jakarta.inject-api:2.0.1=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
-jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,testCompileClasspath,testRuntimeClasspath
+jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.validation:jakarta.validation-api:3.0.2=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.ws.rs:jakarta.ws.rs-api:3.1.0=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
javax.inject:javax.inject:1=annotationProcessor,errorprone,testAnnotationProcessor
@@ -138,7 +138,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=compileClasspath,jarValidatio
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,testRuntimeClasspath
diff --git a/solr/modules/ltr/gradle.lockfile b/solr/modules/ltr/gradle.lockfile
index 44debb42806..c3ae6edc2b3 100644
--- a/solr/modules/ltr/gradle.lockfile
+++ b/solr/modules/ltr/gradle.lockfile
@@ -70,7 +70,7 @@ io.sgr:s2-geometry-library-java:1.0.0=jarValidation,runtimeClasspath,runtimeLibs
io.swagger.core.v3:swagger-annotations-jakarta:2.2.22=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.annotation:jakarta.annotation-api:2.1.1=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.inject:jakarta.inject-api:2.0.1=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
-jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,testCompileClasspath,testRuntimeClasspath
+jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.validation:jakarta.validation-api:3.0.2=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.ws.rs:jakarta.ws.rs-api:3.1.0=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
javax.inject:javax.inject:1=annotationProcessor,errorprone,testAnnotationProcessor
@@ -124,7 +124,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=compileClasspath,jarValidatio
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,testRuntimeClasspath
diff --git a/solr/modules/opentelemetry/gradle.lockfile b/solr/modules/opentelemetry/gradle.lockfile
index f794d05b31c..e2134951102 100644
--- a/solr/modules/opentelemetry/gradle.lockfile
+++ b/solr/modules/opentelemetry/gradle.lockfile
@@ -102,7 +102,7 @@ io.sgr:s2-geometry-library-java:1.0.0=jarValidation,runtimeClasspath,runtimeLibs
io.swagger.core.v3:swagger-annotations-jakarta:2.2.22=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.annotation:jakarta.annotation-api:2.1.1=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.inject:jakarta.inject-api:2.0.1=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
-jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,testCompileClasspath,testRuntimeClasspath
+jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.validation:jakarta.validation-api:3.0.2=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.ws.rs:jakarta.ws.rs-api:3.1.0=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
javax.inject:javax.inject:1=annotationProcessor,errorprone,testAnnotationProcessor
@@ -156,7 +156,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=compileClasspath,jarValidatio
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,testRuntimeClasspath
diff --git a/solr/modules/s3-repository/gradle.lockfile b/solr/modules/s3-repository/gradle.lockfile
index 3d1b670cedc..0e5a2d0e222 100644
--- a/solr/modules/s3-repository/gradle.lockfile
+++ b/solr/modules/s3-repository/gradle.lockfile
@@ -91,7 +91,7 @@ jakarta.enterprise:jakarta.enterprise.cdi-api:4.0.1=jarValidation,testCompileCla
jakarta.enterprise:jakarta.enterprise.lang-model:4.0.1=jarValidation,testCompileClasspath,testRuntimeClasspath
jakarta.inject:jakarta.inject-api:2.0.1=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.interceptor:jakarta.interceptor-api:2.1.0=jarValidation,testCompileClasspath,testRuntimeClasspath
-jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,testCompileClasspath,testRuntimeClasspath
+jakarta.servlet:jakarta.servlet-api:6.0.0=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.transaction:jakarta.transaction-api:2.0.1=jarValidation,testCompileClasspath,testRuntimeClasspath
jakarta.validation:jakarta.validation-api:3.0.2=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.websocket:jakarta.websocket-api:2.1.1=jarValidation,testCompileClasspath,testRuntimeClasspath
@@ -161,7 +161,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=apiHelper,compileClasspath,ja
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=apiHelper,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty.websocket:jetty-websocket-core-client:12.0.12=jarValidation,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.websocket:jetty-websocket-core-common:12.0.12=jarValidation,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.websocket:jetty-websocket-core-server:12.0.12=jarValidation,testCompileClasspath,testRuntimeClasspath
diff --git a/solr/modules/scripting/gradle.lockfile b/solr/modules/scripting/gradle.lockfile
index 5c53df53d4f..aee3663cffc 100644
--- a/solr/modules/scripting/gradle.lockfile
+++ b/solr/modules/scripting/gradle.lockfile
@@ -70,7 +70,7 @@ io.sgr:s2-geometry-library-java:1.0.0=jarValidation,runtimeClasspath,runtimeLibs
io.swagger.core.v3:swagger-annotations-jakarta:2.2.22=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.annotation:jakarta.annotation-api:2.1.1=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.inject:jakarta.inject-api:2.0.1=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
-jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,testCompileClasspath,testRuntimeClasspath
+jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.validation:jakarta.validation-api:3.0.2=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.ws.rs:jakarta.ws.rs-api:3.1.0=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
javax.inject:javax.inject:1=annotationProcessor,errorprone,testAnnotationProcessor
@@ -123,7 +123,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=compileClasspath,jarValidatio
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,testRuntimeClasspath
diff --git a/solr/modules/sql/gradle.lockfile b/solr/modules/sql/gradle.lockfile
index 890237bbc88..e4e28c6495f 100644
--- a/solr/modules/sql/gradle.lockfile
+++ b/solr/modules/sql/gradle.lockfile
@@ -73,7 +73,7 @@ io.sgr:s2-geometry-library-java:1.0.0=jarValidation,runtimeClasspath,runtimeLibs
io.swagger.core.v3:swagger-annotations-jakarta:2.2.22=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.annotation:jakarta.annotation-api:2.1.1=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.inject:jakarta.inject-api:2.0.1=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
-jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,testCompileClasspath,testRuntimeClasspath
+jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
jakarta.validation:jakarta.validation-api:3.0.2=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
jakarta.ws.rs:jakarta.ws.rs-api:3.1.0=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
javax.inject:javax.inject:1=annotationProcessor,errorprone,testAnnotationProcessor
@@ -147,7 +147,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=compileClasspath,jarValidatio
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=jarValidation,runtimeClasspath,runtimeLibs,solrPlatformLibs,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,testRuntimeClasspath
diff --git a/solr/server/build.gradle b/solr/server/build.gradle
index 5c4025543a8..132f92ec0f8 100644
--- a/solr/server/build.gradle
+++ b/solr/server/build.gradle
@@ -60,8 +60,7 @@ dependencies {
serverLib libs.eclipse.jetty.http2.server
serverLib libs.eclipse.jetty.http2.common
serverLib libs.eclipse.jetty.http2.hpack
-
- serverLib libs.eclipse.jetty.toolchain.servletapi
+ serverLib libs.jakarta.servlet.api
libExt libs.lmax.disruptor
libExt libs.slf4j.jcloverslf4j
diff --git a/solr/server/gradle.lockfile b/solr/server/gradle.lockfile
index 64790086950..beebf53ddef 100644
--- a/solr/server/gradle.lockfile
+++ b/solr/server/gradle.lockfile
@@ -66,7 +66,7 @@ io.sgr:s2-geometry-library-java:1.0.0=jarValidation,runtimeClasspath,solrCore
io.swagger.core.v3:swagger-annotations-jakarta:2.2.22=jarValidation,runtimeClasspath,solrCore
jakarta.annotation:jakarta.annotation-api:2.1.1=jarValidation,runtimeClasspath,solrCore
jakarta.inject:jakarta.inject-api:2.0.1=jarValidation,runtimeClasspath,solrCore
-jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,runtimeClasspath,serverLib
+jakarta.servlet:jakarta.servlet-api:6.0.0=jarValidation,runtimeClasspath,serverLib,solrCore
jakarta.validation:jakarta.validation-api:3.0.2=jarValidation,runtimeClasspath,solrCore
jakarta.ws.rs:jakarta.ws.rs-api:3.1.0=jarValidation,runtimeClasspath,solrCore
javax.inject:javax.inject:1=annotationProcessor,errorprone,testAnnotationProcessor
@@ -114,7 +114,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=jarValidation,runtimeClasspat
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=jarValidation,runtimeClasspath,serverLib,solrCore
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=jarValidation,runtimeClasspath,serverLib,solrCore
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,runtimeClasspath,serverLib
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=jarValidation,runtimeClasspath,serverLib,solrCore
org.eclipse.jetty:jetty-alpn-client:12.0.27=jarValidation,runtimeClasspath,solrCore
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=jarValidation,runtimeClasspath,solrCore
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,runtimeClasspath,serverLib
diff --git a/solr/solr-ref-guide/gradle.lockfile b/solr/solr-ref-guide/gradle.lockfile
index 4d08f6c81a0..872894e8834 100644
--- a/solr/solr-ref-guide/gradle.lockfile
+++ b/solr/solr-ref-guide/gradle.lockfile
@@ -120,7 +120,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=testCompileClasspath,testRunt
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=testRuntimeClasspath
diff --git a/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-10.adoc b/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-10.adoc
index 9fb7c15b653..c283d0c03b6 100644
--- a/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-10.adoc
+++ b/solr/solr-ref-guide/modules/upgrade-notes/pages/major-changes-in-solr-10.adoc
@@ -196,9 +196,10 @@ Nowadays, the HTTP request is available via internal APIs: `SolrQueryRequest.get
* There is no longer a distinction between trusted and untrusted configSets; all configSets are now considered trusted. To ensure security, Solr should be properly protected using authentication and authorization mechanisms, allowing only authorized users with administrative privileges to publish them.
-=== Upgrade to Jetty 12.x
+=== Upgrade to Jetty 12.x and Jakarta namespace
Solr upgraded to Jetty 12.x from 10.x as Jetty 10 and 11 have reached end-of-life support. Jetty 12.x requires Java 17 or newer and is fully compatible with Solr's new minimum requirement of Java 21. This upgrade brings support for modern HTTP protocols and adopts the Jakarta EE 10 namespace. For more details, see https://webtide.com/jetty-12-has-arrived/.
+This migration marks the point at which Solr no longer includes _any_ JAR with "javax" in it -- the Jakarta migration is complete.
=== OpenTelemetry
diff --git a/solr/solrj-streaming/gradle.lockfile b/solr/solrj-streaming/gradle.lockfile
index c304adabf04..443095a4cdc 100644
--- a/solr/solrj-streaming/gradle.lockfile
+++ b/solr/solrj-streaming/gradle.lockfile
@@ -142,7 +142,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=compileClasspath,jarValidatio
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=compileClasspath,jarValidation,permitTestUsedUndeclared,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=compileClasspath,jarValidation,permitTestUsedUndeclared,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=jarValidation,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=compileClasspath,jarValidation,permitTestUsedUndeclared,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=jarValidation,permitTestUsedUndeclared,runtimeClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,testRuntimeClasspath
diff --git a/solr/solrj-zookeeper/gradle.lockfile b/solr/solrj-zookeeper/gradle.lockfile
index 82db56eafe3..97ba198f165 100644
--- a/solr/solrj-zookeeper/gradle.lockfile
+++ b/solr/solrj-zookeeper/gradle.lockfile
@@ -136,7 +136,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=compileClasspath,jarValidatio
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=compileClasspath,jarValidation,permitTestUsedUndeclared,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=compileClasspath,jarValidation,permitTestUsedUndeclared,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=jarValidation,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=compileClasspath,jarValidation,permitTestUsedUndeclared,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=jarValidation,permitTestUsedUndeclared,runtimeClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,testRuntimeClasspath
diff --git a/solr/solrj/gradle.lockfile b/solr/solrj/gradle.lockfile
index 876ad1344d1..996f16b3edc 100644
--- a/solr/solrj/gradle.lockfile
+++ b/solr/solrj/gradle.lockfile
@@ -140,7 +140,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=apiHelper,compileClasspath,ja
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=apiHelper,compileClasspath,jarValidation,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=apiHelper,compileClasspath,jarValidation,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=jarValidation,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=jarValidation,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=apiHelper,compileClasspath,jarValidation,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=compileClasspath,jarValidation,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,testRuntimeClasspath
diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrClientTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrClientTest.java
index 676c91e0bda..601c2442c10 100644
--- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrClientTest.java
+++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/BasicHttpSolrClientTest.java
@@ -110,6 +110,7 @@ public class BasicHttpSolrClientTest extends SolrJettyTestBase {
public static final int PACKET_MS = 500;
@Override
+ @SuppressForbidden(reason = "don't forbid in tests")
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
String countStr = req.getParameter("count");
IntStream.range(0, countStr == null ? 10 : Integer.parseInt(countStr))
diff --git a/solr/test-framework/gradle.lockfile b/solr/test-framework/gradle.lockfile
index 450ac982fe6..9a2211b4c56 100644
--- a/solr/test-framework/gradle.lockfile
+++ b/solr/test-framework/gradle.lockfile
@@ -122,7 +122,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=apiHelper,compileClasspath,ja
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=apiHelper,compileClasspath,jarValidation,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=apiHelper,compileClasspath,jarValidation,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=compileClasspath,jarValidation,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=apiHelper,jarValidation,runtimeClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-client:12.0.27=apiHelper,compileClasspath,jarValidation,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=apiHelper,jarValidation,runtimeClasspath,testRuntimeClasspath
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=jarValidation,runtimeClasspath,testRuntimeClasspath
diff --git a/solr/webapp/gradle.lockfile b/solr/webapp/gradle.lockfile
index a1ee4d70349..5f98e420353 100644
--- a/solr/webapp/gradle.lockfile
+++ b/solr/webapp/gradle.lockfile
@@ -66,7 +66,7 @@ io.sgr:s2-geometry-library-java:1.0.0=permitUnusedDeclared,solrCore
io.swagger.core.v3:swagger-annotations-jakarta:2.2.22=permitUnusedDeclared,solrCore
jakarta.annotation:jakarta.annotation-api:2.1.1=permitUnusedDeclared,solrCore
jakarta.inject:jakarta.inject-api:2.0.1=permitUnusedDeclared,solrCore
-jakarta.servlet:jakarta.servlet-api:6.0.0=serverLib
+jakarta.servlet:jakarta.servlet-api:6.0.0=permitUnusedDeclared,serverLib,solrCore
jakarta.validation:jakarta.validation-api:3.0.2=permitUnusedDeclared,solrCore
jakarta.ws.rs:jakarta.ws.rs-api:3.1.0=permitUnusedDeclared,solrCore
javax.inject:javax.inject:1=annotationProcessor,errorprone,testAnnotationProcessor
@@ -114,7 +114,6 @@ org.eclipse.jetty.http2:jetty-http2-client:12.0.27=permitUnusedDeclared,solrCore
org.eclipse.jetty.http2:jetty-http2-common:12.0.27=permitUnusedDeclared,serverLib,solrCore
org.eclipse.jetty.http2:jetty-http2-hpack:12.0.27=permitUnusedDeclared,serverLib,solrCore
org.eclipse.jetty.http2:jetty-http2-server:12.0.27=serverLib
-org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=permitUnusedDeclared,serverLib,solrCore
org.eclipse.jetty:jetty-alpn-client:12.0.27=permitUnusedDeclared,solrCore
org.eclipse.jetty:jetty-alpn-java-client:12.0.27=permitUnusedDeclared,solrCore
org.eclipse.jetty:jetty-alpn-java-server:12.0.27=serverLib
(solr) 01/05: SOLR-17458: OTEL metrics: some renames (#3826)
Posted by ds...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
dsmiley pushed a commit to branch branch_10_0
in repository https://gitbox.apache.org/repos/asf/solr.git
commit 703e5e77c5785cf10a452634563c90f470e6f70b
Author: David Smiley <ds...@apache.org>
AuthorDate: Fri Nov 7 17:30:12 2025 -0500
SOLR-17458: OTEL metrics: some renames (#3826)
Units: index & disk size metric units changes from bytes (long) to megabytes (double).
Affects: solr_disk_space, solr_core_disk_space, solr_core_index_size, solr_core_replication_index_size, solr_core_indexsearcher_index_commit_size
Renames:
* solr_executor to solr_core_executor or solr_node_executor
* solr_replication to solr_core_replication
* solr_field_cache to solr_core_field_cache
* solr_searcher to solr_core_indexsearcher
* solr_indexwriter to solr_core_indexwriter
* solr_searcher_timer to solr_core_indexsearcher_open_time and solr_core_indexsearcher_open_warmup_time
* attribute executor_name to name
When aggregating core metrics to the node level:
* don't strip off these attributes: internal, replica_type
* keep solr_core prefix, even when aggregated to node, since they relate to cores
Moved instrumentedExecutorService() to SolrMetricsContext
(cherry picked from commit 4d8057abbe4da68d19de6a847eba204f13b9734a)
---
.../solr/cluster/placement/impl/MetricImpl.java | 16 +++----
.../cluster/placement/impl/NodeMetricImpl.java | 4 +-
.../cluster/placement/impl/ReplicaMetricImpl.java | 2 +-
.../java/org/apache/solr/core/CoreContainer.java | 16 +++----
.../src/java/org/apache/solr/core/SolrCore.java | 51 ++++++++++++----------
.../apache/solr/handler/ReplicationHandler.java | 35 +++++++++------
.../solr/handler/admin/CoreAdminHandler.java | 17 ++++----
.../handler/component/HttpShardHandlerFactory.java | 5 +--
.../apache/solr/metrics/SolrMetricsContext.java | 13 ++++++
.../instruments/AttributedInstrumentFactory.java | 23 +++++-----
.../org/apache/solr/search/SolrFieldCacheBean.java | 4 +-
.../org/apache/solr/search/SolrIndexSearcher.java | 26 ++++++-----
.../org/apache/solr/search/stats/StatsCache.java | 2 +-
.../org/apache/solr/update/SolrIndexWriter.java | 11 ++---
.../org/apache/solr/update/UpdateShardHandler.java | 9 ++--
.../org/apache/solr/util/stats/MetricUtils.java | 36 ++++-----------
.../stats/OtelInstrumentedExecutorService.java | 29 ++++++------
.../cloud/CloudExitableDirectoryReaderTest.java | 4 +-
.../org/apache/solr/cloud/MigrateReplicasTest.java | 4 +-
.../org/apache/solr/cloud/ReplaceNodeTest.java | 4 +-
.../apache/solr/cloud/TestBaseStatsCacheCloud.java | 8 ++--
.../impl/CollectionMetricsBuilderTest.java | 25 +++++------
.../solr/handler/RequestHandlerMetricsTest.java | 10 +++--
.../solr/handler/admin/StatsReloadRaceTest.java | 2 +-
.../solr/metrics/SolrMetricsIntegrationTest.java | 4 +-
.../apache/solr/search/TestMainQueryCaching.java | 2 +-
.../apache/solr/search/TestSolrFieldCacheBean.java | 4 +-
.../apache/solr/update/SolrIndexMetricsTest.java | 16 +++----
.../stats/OtelInstrumentedExecutorServiceTest.java | 26 ++++++-----
.../solr/client/solrj/impl/NodeValueFetcher.java | 11 +++--
solr/solrj/gradle.lockfile | 7 +++
.../apache/solr/cluster/placement/Builders.java | 2 +-
.../org/apache/solr/util/SolrMetricTestUtils.java | 9 +++-
33 files changed, 230 insertions(+), 207 deletions(-)
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/impl/MetricImpl.java b/solr/core/src/java/org/apache/solr/cluster/placement/impl/MetricImpl.java
index 7cc5d7eb347..b3c5782bd13 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/impl/MetricImpl.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/impl/MetricImpl.java
@@ -23,8 +23,6 @@ import org.apache.solr.cluster.placement.Metric;
/** Base class for {@link Metric} implementations. */
public abstract class MetricImpl<T> implements Metric<T> {
- public static final double GB = 1024 * 1024 * 1024;
-
/**
* Identity converter. It returns the raw value unchanged IFF the value's type can be cast to the
* generic type of this attribute, otherwise it returns null.
@@ -40,25 +38,25 @@ public abstract class MetricImpl<T> implements Metric<T> {
};
/**
- * Bytes to gigabytes converter. Supports converting number or string representations of raw
- * values expressed in bytes.
+ * Megabytes to gigabytes converter. Supports converting number or string representations of raw
+ * values expressed in megabytes.
*/
- public static final Function<Object, Double> BYTES_TO_GB_CONVERTER =
+ public static final Function<Object, Double> MB_TO_GB_CONVERTER =
v -> {
- double sizeInBytes;
+ double sizeInMB;
if (!(v instanceof Number)) {
if (v == null) {
return null;
}
try {
- sizeInBytes = Double.parseDouble(String.valueOf(v));
+ sizeInMB = Double.parseDouble(String.valueOf(v));
} catch (Exception nfe) {
return null;
}
} else {
- sizeInBytes = ((Number) v).doubleValue();
+ sizeInMB = ((Number) v).doubleValue();
}
- return sizeInBytes / GB;
+ return sizeInMB / 1024.0;
};
protected final String name;
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/impl/NodeMetricImpl.java b/solr/core/src/java/org/apache/solr/cluster/placement/impl/NodeMetricImpl.java
index 2e62ffab60c..75fac2406d0 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/impl/NodeMetricImpl.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/impl/NodeMetricImpl.java
@@ -26,11 +26,11 @@ public class NodeMetricImpl<T> extends MetricImpl<T> implements NodeMetric<T> {
/** Total disk space in GB. */
public static final NodeMetricImpl<Double> TOTAL_DISK_GB =
- new NodeMetricImpl<>("totaldisk", BYTES_TO_GB_CONVERTER);
+ new NodeMetricImpl<>("totaldisk", MB_TO_GB_CONVERTER);
/** Free (usable) disk space in GB. */
public static final NodeMetricImpl<Double> FREE_DISK_GB =
- new NodeMetricImpl<>("freedisk", BYTES_TO_GB_CONVERTER);
+ new NodeMetricImpl<>("freedisk", MB_TO_GB_CONVERTER);
/** Number of all cores. */
public static final NodeMetricImpl<Integer> NUM_CORES =
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/impl/ReplicaMetricImpl.java b/solr/core/src/java/org/apache/solr/cluster/placement/impl/ReplicaMetricImpl.java
index a7b98e0daf8..2cb0b785809 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/impl/ReplicaMetricImpl.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/impl/ReplicaMetricImpl.java
@@ -26,7 +26,7 @@ import org.apache.solr.cluster.placement.ReplicaMetric;
public class ReplicaMetricImpl<T> extends MetricImpl<T> implements ReplicaMetric<T> {
/** Replica index size in GB. */
public static final ReplicaMetricImpl<Double> INDEX_SIZE_GB =
- new ReplicaMetricImpl<>("sizeGB", "solr_core_index_size_bytes", BYTES_TO_GB_CONVERTER);
+ new ReplicaMetricImpl<>("sizeGB", "solr_core_index_size_megabytes", MB_TO_GB_CONVERTER);
public ReplicaMetricImpl(String name, String internalName) {
super(name, internalName);
diff --git a/solr/core/src/java/org/apache/solr/core/CoreContainer.java b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
index a5b6b1ce69c..f9c88031ab6 100644
--- a/solr/core/src/java/org/apache/solr/core/CoreContainer.java
+++ b/solr/core/src/java/org/apache/solr/core/CoreContainer.java
@@ -913,17 +913,17 @@ public class CoreContainer {
Path dataHome =
cfg.getSolrDataHome() != null ? cfg.getSolrDataHome() : cfg.getCoreRootDirectory();
- solrMetricsContext.observableLongGauge(
+ solrMetricsContext.observableDoubleGauge(
"solr_disk_space",
"Disk metrics for Solr's data home directory (" + dataHome + ")",
measurement -> {
try {
var fileStore = Files.getFileStore(dataHome);
measurement.record(
- fileStore.getTotalSpace(),
+ MetricUtils.bytesToMegabytes(fileStore.getTotalSpace()),
containerAttrs.toBuilder().put(TYPE_ATTR, "total_space").build());
measurement.record(
- fileStore.getUsableSpace(),
+ MetricUtils.bytesToMegabytes(fileStore.getUsableSpace()),
containerAttrs.toBuilder().put(TYPE_ATTR, "usable_space").build());
} catch (IOException e) {
throw new SolrException(
@@ -932,7 +932,7 @@ public class CoreContainer {
e);
}
},
- OtelUnit.BYTES);
+ OtelUnit.MEGABYTES);
SolrFieldCacheBean fieldCacheBean = new SolrFieldCacheBean();
fieldCacheBean.initializeMetrics(
@@ -940,13 +940,13 @@ public class CoreContainer {
// setup executor to load cores in parallel
coreLoadExecutor =
- MetricUtils.instrumentedExecutorService(
+ solrMetricsContext.instrumentedExecutorService(
ExecutorUtil.newMDCAwareFixedThreadPool(
cfg.getCoreLoadThreadCount(isZooKeeperAware()),
new SolrNamedThreadFactory("coreLoadExecutor")),
- solrMetricsContext,
- SolrInfoBean.Category.CONTAINER,
- "coreLoadExecutor");
+ "solr_node_executor",
+ "coreLoadExecutor",
+ SolrInfoBean.Category.CONTAINER);
coreSorter =
loader.newInstance(
diff --git a/solr/core/src/java/org/apache/solr/core/SolrCore.java b/solr/core/src/java/org/apache/solr/core/SolrCore.java
index 5beca634fe3..5c719e26745 100644
--- a/solr/core/src/java/org/apache/solr/core/SolrCore.java
+++ b/solr/core/src/java/org/apache/solr/core/SolrCore.java
@@ -181,6 +181,7 @@ import org.apache.solr.util.circuitbreaker.CircuitBreakerRegistry;
import org.apache.solr.util.plugin.NamedListInitializedPlugin;
import org.apache.solr.util.plugin.PluginInfoInitialized;
import org.apache.solr.util.plugin.SolrCoreAware;
+import org.apache.solr.util.stats.MetricUtils;
import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.data.Stat;
import org.eclipse.jetty.io.RuntimeIOException;
@@ -489,7 +490,7 @@ public class SolrCore implements SolrInfoBean, Closeable {
}
/**
- * Recalculates the index size.
+ * Calculates the index size.
*
* <p>Should only be called from {@code getIndexSize}.
*
@@ -515,6 +516,7 @@ public class SolrCore implements SolrInfoBean, Closeable {
return size;
}
+ /** The index size in bytes, of the index that the current searcher is pointed to. */
public long getIndexSize() {
SolrRequestInfo requestInfo = SolrRequestInfo.getRequestInfo();
if (requestInfo != null) {
@@ -1345,10 +1347,6 @@ public class SolrCore implements SolrInfoBean, Closeable {
.put(CATEGORY_ATTR, Category.CORE.toString())
.build();
- var baseSearcherTimerMetric =
- parentContext.longHistogram(
- "solr_searcher_timer", "Timer for opening new searchers", OtelUnit.MILLISECONDS);
-
newSearcherCounter =
new AttributedLongCounter(
parentContext.longCounter(
@@ -1370,13 +1368,19 @@ public class SolrCore implements SolrInfoBean, Closeable {
newSearcherTimer =
new AttributedLongTimer(
- baseSearcherTimerMetric,
- Attributes.builder().putAll(baseSearcherAttributes).put(TYPE_ATTR, "new").build());
+ parentContext.longHistogram(
+ "solr_core_indexsearcher_open_time",
+ "Time to open new searchers",
+ OtelUnit.MILLISECONDS),
+ baseSearcherAttributes);
newSearcherWarmupTimer =
new AttributedLongTimer(
- baseSearcherTimerMetric,
- Attributes.builder().putAll(baseSearcherAttributes).put(TYPE_ATTR, "warmup").build());
+ parentContext.longHistogram(
+ "solr_core_indexsearcher_open_warmup_time",
+ "Time to warmup new searchers",
+ OtelUnit.MILLISECONDS),
+ baseSearcherAttributes);
observables.add(
parentContext.observableLongGauge(
@@ -1387,10 +1391,10 @@ public class SolrCore implements SolrInfoBean, Closeable {
})));
observables.add(
- parentContext.observableLongGauge(
+ parentContext.observableDoubleGauge(
"solr_core_disk_space",
"Solr core disk space metrics",
- (observableLongMeasurement -> {
+ (observableDoubleMeasurement -> {
// initialize disk total / free metrics
Path dataDirPath = Path.of(dataDir);
@@ -1405,29 +1409,32 @@ public class SolrCore implements SolrInfoBean, Closeable {
.put(TYPE_ATTR, "usable_space")
.build();
try {
- observableLongMeasurement.record(
- Files.getFileStore(dataDirPath).getTotalSpace(), totalSpaceAttributes);
+ observableDoubleMeasurement.record(
+ MetricUtils.bytesToMegabytes(Files.getFileStore(dataDirPath).getTotalSpace()),
+ totalSpaceAttributes);
} catch (IOException e) {
- observableLongMeasurement.record(0L, totalSpaceAttributes);
+ observableDoubleMeasurement.record(0.0, totalSpaceAttributes);
}
try {
- observableLongMeasurement.record(
- Files.getFileStore(dataDirPath).getUsableSpace(), usableSpaceAttributes);
+ observableDoubleMeasurement.record(
+ MetricUtils.bytesToMegabytes(Files.getFileStore(dataDirPath).getUsableSpace()),
+ usableSpaceAttributes);
} catch (IOException e) {
- observableLongMeasurement.record(0L, usableSpaceAttributes);
+ observableDoubleMeasurement.record(0.0, usableSpaceAttributes);
}
}),
- OtelUnit.BYTES));
+ OtelUnit.MEGABYTES));
observables.add(
- parentContext.observableLongGauge(
+ parentContext.observableDoubleGauge(
"solr_core_index_size",
"Index size for a Solr core",
- (observableLongMeasurement -> {
+ (observableDoubleMeasurement -> {
if (!isClosed())
- observableLongMeasurement.record(getIndexSize(), baseGaugeCoreAttributes);
+ observableDoubleMeasurement.record(
+ MetricUtils.bytesToMegabytes(getIndexSize()), baseGaugeCoreAttributes);
}),
- OtelUnit.BYTES));
+ OtelUnit.MEGABYTES));
parentContext.observableLongGauge(
"solr_core_segments",
diff --git a/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java b/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java
index a1781fddddd..888e371426a 100644
--- a/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java
@@ -32,6 +32,7 @@ import static org.apache.solr.handler.admin.api.ReplicationAPIBase.TLOG_FILE;
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.metrics.BatchCallback;
+import io.opentelemetry.api.metrics.ObservableDoubleMeasurement;
import io.opentelemetry.api.metrics.ObservableLongMeasurement;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -114,6 +115,7 @@ import org.apache.solr.util.NumberUtils;
import org.apache.solr.util.PropertiesInputStream;
import org.apache.solr.util.RefCounted;
import org.apache.solr.util.plugin.SolrCoreAware;
+import org.apache.solr.util.stats.MetricUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
@@ -850,59 +852,64 @@ public class ReplicationHandler extends RequestHandlerBase
.build();
super.initializeMetrics(parentContext, replicationAttributes);
- ObservableLongMeasurement indexSizeMetric =
- solrMetricsContext.longGaugeMeasurement(
- "solr_replication_index_size", "Size of the index in bytes", OtelUnit.BYTES);
+ ObservableDoubleMeasurement indexSizeMetric =
+ solrMetricsContext.doubleGaugeMeasurement(
+ "solr_core_replication_index_size",
+ "Size of the index in megabytes",
+ OtelUnit.MEGABYTES);
ObservableLongMeasurement indexVersionMetric =
solrMetricsContext.longGaugeMeasurement(
- "solr_replication_index_version", "Current index version");
+ "solr_core_replication_index_version", "Current index version");
ObservableLongMeasurement indexGenerationMetric =
solrMetricsContext.longGaugeMeasurement(
- "solr_replication_index_generation", "Current index generation");
+ "solr_core_replication_index_generation", "Current index generation");
ObservableLongMeasurement isLeaderMetric =
solrMetricsContext.longGaugeMeasurement(
- "solr_replication_is_leader", "Whether this node is a leader (1) or not (0)");
+ "solr_core_replication_is_leader", "Whether this node is a leader (1) or not (0)");
ObservableLongMeasurement isFollowerMetric =
solrMetricsContext.longGaugeMeasurement(
- "solr_replication_is_follower", "Whether this node is a follower (1) or not (0)");
+ "solr_core_replication_is_follower", "Whether this node is a follower (1) or not (0)");
ObservableLongMeasurement replicationEnabledMetric =
solrMetricsContext.longGaugeMeasurement(
- "solr_replication_is_enabled", "Whether replication is enabled (1) or not (0)");
+ "solr_core_replication_is_enabled", "Whether replication is enabled (1) or not (0)");
ObservableLongMeasurement isPollingDisabledMetric =
solrMetricsContext.longGaugeMeasurement(
- "solr_replication_is_polling_disabled", "Whether polling is disabled (1) or not (0)");
+ "solr_core_replication_is_polling_disabled",
+ "Whether polling is disabled (1) or not (0)");
ObservableLongMeasurement isReplicatingMetric =
solrMetricsContext.longGaugeMeasurement(
- "solr_replication_is_replicating", "Whether replication is in progress (1) or not (0)");
+ "solr_core_replication_is_replicating",
+ "Whether replication is in progress (1) or not (0)");
ObservableLongMeasurement timeElapsedMetric =
solrMetricsContext.longGaugeMeasurement(
- "solr_replication_time_elapsed",
+ "solr_core_replication_time_elapsed",
"Time elapsed during replication in seconds",
OtelUnit.SECONDS);
ObservableLongMeasurement bytesDownloadedMetric =
solrMetricsContext.longGaugeMeasurement(
- "solr_replication_downloaded_size",
+ "solr_core_replication_downloaded_size",
"Total bytes downloaded during replication",
OtelUnit.BYTES);
ObservableLongMeasurement downloadSpeedMetric =
solrMetricsContext.longGaugeMeasurement(
- "solr_replication_download_speed", "Download speed in bytes per second");
+ "solr_core_replication_download_speed", "Download speed in bytes per second");
metricsCallback =
solrMetricsContext.batchCallback(
() -> {
if (core != null && !core.isClosed()) {
- indexSizeMetric.record(core.getIndexSize(), replicationAttributes);
+ indexSizeMetric.record(
+ MetricUtils.bytesToMegabytes(core.getIndexSize()), replicationAttributes);
CommitVersionInfo vInfo = getIndexVersion();
if (vInfo != null) {
diff --git a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java
index cf31a418e80..c6d9474e0de 100644
--- a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java
@@ -79,7 +79,6 @@ import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.response.SolrQueryResponse;
import org.apache.solr.security.AuthorizationContext;
import org.apache.solr.security.PermissionNameProvider;
-import org.apache.solr.util.stats.MetricUtils;
import org.apache.solr.util.tracing.TraceUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -131,18 +130,18 @@ public class CoreAdminHandler extends RequestHandlerBase implements PermissionNa
public void initializeMetrics(SolrMetricsContext parentContext, Attributes attributes) {
super.initializeMetrics(parentContext, attributes);
coreAdminAsyncTracker.standardExecutor =
- MetricUtils.instrumentedExecutorService(
+ solrMetricsContext.instrumentedExecutorService(
coreAdminAsyncTracker.standardExecutor,
- solrMetricsContext,
- getCategory(),
- "parallelCoreAdminExecutor");
+ "solr_node_executor",
+ "asyncCoreAdminExecutor",
+ getCategory());
coreAdminAsyncTracker.expensiveExecutor =
- MetricUtils.instrumentedExecutorService(
+ solrMetricsContext.instrumentedExecutorService(
coreAdminAsyncTracker.expensiveExecutor,
- solrMetricsContext,
- getCategory(),
- "parallelCoreExpensiveAdminExecutor");
+ "solr_node_executor",
+ "asyncCoreExpensiveAdminExecutor",
+ getCategory());
}
@Override
diff --git a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java
index 07e57fe3cb7..0a78e179019 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/HttpShardHandlerFactory.java
@@ -61,7 +61,6 @@ import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.security.HttpClientBuilderPlugin;
import org.apache.solr.update.UpdateShardHandlerConfig;
import org.apache.solr.util.stats.InstrumentedHttpListenerFactory;
-import org.apache.solr.util.stats.MetricUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -436,7 +435,7 @@ public class HttpShardHandlerFactory extends ShardHandlerFactory
solrMetricsContext = parentContext.getChildContext(this);
httpListenerFactory.initializeMetrics(solrMetricsContext, Attributes.empty());
commExecutor =
- MetricUtils.instrumentedExecutorService(
- commExecutor, solrMetricsContext, SolrInfoBean.Category.QUERY, "httpShardExecutor");
+ solrMetricsContext.instrumentedExecutorService(
+ commExecutor, "solr_core_executor", "httpShardExecutor", SolrInfoBean.Category.QUERY);
}
}
diff --git a/solr/core/src/java/org/apache/solr/metrics/SolrMetricsContext.java b/solr/core/src/java/org/apache/solr/metrics/SolrMetricsContext.java
index ddd069bdfeb..db338da6b37 100644
--- a/solr/core/src/java/org/apache/solr/metrics/SolrMetricsContext.java
+++ b/solr/core/src/java/org/apache/solr/metrics/SolrMetricsContext.java
@@ -35,9 +35,12 @@ import io.opentelemetry.api.metrics.ObservableLongMeasurement;
import io.opentelemetry.api.metrics.ObservableMeasurement;
import java.util.ArrayList;
import java.util.List;
+import java.util.concurrent.ExecutorService;
import java.util.function.Consumer;
import org.apache.solr.common.util.IOUtils;
+import org.apache.solr.core.SolrInfoBean;
import org.apache.solr.metrics.otel.OtelUnit;
+import org.apache.solr.util.stats.OtelInstrumentedExecutorService;
/**
* This class represents a metrics context that ties together components with the same life-cycle
@@ -253,6 +256,16 @@ public class SolrMetricsContext {
return batchCallback;
}
+ /** Returns an instrumented wrapper over the given executor service. */
+ public ExecutorService instrumentedExecutorService(
+ ExecutorService delegate,
+ String metricNamePrefix,
+ String executorName,
+ SolrInfoBean.Category category) {
+ return new OtelInstrumentedExecutorService(
+ delegate, this, metricNamePrefix, executorName, category);
+ }
+
public void unregister() {
IOUtils.closeQuietly(closeables);
closeables.clear();
diff --git a/solr/core/src/java/org/apache/solr/metrics/otel/instruments/AttributedInstrumentFactory.java b/solr/core/src/java/org/apache/solr/metrics/otel/instruments/AttributedInstrumentFactory.java
index 189672bcb0f..b4cd5cd514f 100644
--- a/solr/core/src/java/org/apache/solr/metrics/otel/instruments/AttributedInstrumentFactory.java
+++ b/solr/core/src/java/org/apache/solr/metrics/otel/instruments/AttributedInstrumentFactory.java
@@ -16,10 +16,8 @@
*/
package org.apache.solr.metrics.otel.instruments;
-import static org.apache.solr.handler.component.SearchHandler.INTERNAL_ATTR;
import static org.apache.solr.metrics.SolrCoreMetricManager.COLLECTION_ATTR;
import static org.apache.solr.metrics.SolrCoreMetricManager.CORE_ATTR;
-import static org.apache.solr.metrics.SolrCoreMetricManager.REPLICA_TYPE_ATTR;
import static org.apache.solr.metrics.SolrCoreMetricManager.SHARD_ATTR;
import io.opentelemetry.api.common.AttributeKey;
@@ -36,16 +34,19 @@ import org.apache.solr.metrics.otel.OtelUnit;
* Factory for creating metrics instruments that can write to either single or dual registries (core
* and node).
*/
+// TODO consider making this a base abstraction with a simple impl and another "Dual" one.
public class AttributedInstrumentFactory {
+ // These attributes are on a core but don't want to aggregate them.
private static final Set<AttributeKey<?>> FILTER_ATTRS_SET =
- Set.of(COLLECTION_ATTR, CORE_ATTR, SHARD_ATTR, REPLICA_TYPE_ATTR, INTERNAL_ATTR);
+ Set.of(COLLECTION_ATTR, CORE_ATTR, SHARD_ATTR);
+
private final SolrMetricsContext primaryMetricsContext;
private final Attributes primaryAttributes;
private final boolean aggregateToNodeRegistry;
private final boolean primaryIsNodeRegistry;
- private SolrMetricsContext nodeMetricsContext = null;
- private Attributes nodeAttributes = null;
+ private final SolrMetricsContext nodeMetricsContext;
+ private final Attributes nodeAttributes;
public AttributedInstrumentFactory(
SolrMetricsContext primaryMetricsContext,
@@ -66,6 +67,9 @@ public class AttributedInstrumentFactory {
new SolrMetricsContext(
primaryMetricsContext.getMetricManager(), SolrMetricManager.NODE_REGISTRY);
this.nodeAttributes = createNodeAttributes(primaryAttributes);
+ } else {
+ this.nodeMetricsContext = null;
+ this.nodeAttributes = null;
}
}
@@ -77,8 +81,7 @@ public class AttributedInstrumentFactory {
Attributes finalNodeAttrs = appendAttributes(nodeAttributes, additionalAttributes);
LongCounter primaryCounter = primaryMetricsContext.longCounter(metricName, description);
- LongCounter nodeCounter =
- nodeMetricsContext.longCounter(toNodeMetricName(metricName), description);
+ LongCounter nodeCounter = nodeMetricsContext.longCounter(metricName, description);
return new DualRegistryAttributedLongCounter(
primaryCounter, finalPrimaryAttrs, nodeCounter, finalNodeAttrs);
} else {
@@ -97,8 +100,7 @@ public class AttributedInstrumentFactory {
LongUpDownCounter primaryCounter =
primaryMetricsContext.longUpDownCounter(metricName, description);
- LongUpDownCounter nodeCounter =
- nodeMetricsContext.longUpDownCounter(toNodeMetricName(metricName), description);
+ LongUpDownCounter nodeCounter = nodeMetricsContext.longUpDownCounter(metricName, description);
return new DualRegistryAttributedLongUpDownCounter(
primaryCounter, finalPrimaryAttrs, nodeCounter, finalNodeAttrs);
} else {
@@ -117,8 +119,7 @@ public class AttributedInstrumentFactory {
Attributes finalNodeAttrs = appendAttributes(nodeAttributes, additionalAttributes);
LongHistogram primaryHistogram =
primaryMetricsContext.longHistogram(metricName, description, unit);
- LongHistogram nodeHistogram =
- nodeMetricsContext.longHistogram(toNodeMetricName(metricName), description, unit);
+ LongHistogram nodeHistogram = nodeMetricsContext.longHistogram(metricName, description, unit);
return new DualRegistryAttributedLongTimer(
primaryHistogram, finalPrimaryAttrs, nodeHistogram, finalNodeAttrs);
} else {
diff --git a/solr/core/src/java/org/apache/solr/search/SolrFieldCacheBean.java b/solr/core/src/java/org/apache/solr/search/SolrFieldCacheBean.java
index 883dcaf66a0..fb8d92120a2 100644
--- a/solr/core/src/java/org/apache/solr/search/SolrFieldCacheBean.java
+++ b/solr/core/src/java/org/apache/solr/search/SolrFieldCacheBean.java
@@ -60,10 +60,10 @@ public class SolrFieldCacheBean implements SolrInfoBean {
this.solrMetricsContext = parentContext;
var solrCacheStats =
solrMetricsContext.longGaugeMeasurement(
- "solr_field_cache_entries", "Number of field cache entries");
+ "solr_core_field_cache_entries", "Number of field cache entries");
var solrCacheSize =
solrMetricsContext.longGaugeMeasurement(
- "solr_field_cache_size", "Size of field cache in bytes", OtelUnit.BYTES);
+ "solr_core_field_cache_size", "Size of field cache in bytes", OtelUnit.BYTES);
this.toClose =
solrMetricsContext.batchCallback(
() -> {
diff --git a/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java b/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
index 15cf7ecc431..3604f84d0fc 100644
--- a/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
+++ b/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
@@ -120,6 +120,7 @@ import org.apache.solr.update.IndexFingerprint;
import org.apache.solr.update.SolrIndexConfig;
import org.apache.solr.util.IOFunction;
import org.apache.solr.util.ThreadCpuTimer;
+import org.apache.solr.util.stats.MetricUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -611,7 +612,7 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
caffeineCache.initializeMetrics(
solrMetricsContext,
core.getCoreAttributes().toBuilder().put(NAME_ATTR, cache.name()).build(),
- "solr_searcher_cache");
+ "solr_core_indexsearcher_cache");
}
}
initializeMetrics(solrMetricsContext, core.getCoreAttributes());
@@ -2626,12 +2627,14 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
warmupTimer =
new AttributedLongTimer(
solrMetricsContext.longHistogram(
- "solr_searcher_warmup_time", "Searcher warmup time (ms)", OtelUnit.MILLISECONDS),
+ "solr_core_indexsearcher_warmup_time",
+ "Searcher warmup time (ms)",
+ OtelUnit.MILLISECONDS),
baseAttributes);
toClose.add(
solrMetricsContext.observableLongCounter(
- "solr_searcher_live_docs_cache",
+ "solr_core_indexsearcher_live_docs_cache",
"LiveDocs cache metrics",
obs -> {
obs.record(
@@ -2647,7 +2650,7 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
// reader stats (numeric)
toClose.add(
solrMetricsContext.observableLongGauge(
- "solr_searcher_index_num_docs",
+ "solr_core_indexsearcher_index_num_docs",
"Number of live docs in the index",
obs -> {
try {
@@ -2659,7 +2662,7 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
toClose.add(
solrMetricsContext.observableLongGauge(
- "solr_searcher_index_docs",
+ "solr_core_indexsearcher_index_docs",
"Total number of docs in the index (including deletions)",
obs -> {
try {
@@ -2670,7 +2673,7 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
// indexVersion (numeric)
toClose.add(
solrMetricsContext.observableLongGauge(
- "solr_searcher_index_version",
+ "solr_core_indexsearcher_index_version",
"Lucene index version",
obs -> {
try {
@@ -2680,20 +2683,21 @@ public class SolrIndexSearcher extends IndexSearcher implements Closeable, SolrI
}));
// size of the currently opened commit
toClose.add(
- solrMetricsContext.observableLongGauge(
- "solr_searcher_index_commit_size_bytes",
- "Size of the current index commit (bytes)",
+ solrMetricsContext.observableDoubleGauge(
+ "solr_core_indexsearcher_index_commit_size",
+ "Size of the current index commit (megabytes)",
obs -> {
try {
long total = 0L;
for (String file : reader.getIndexCommit().getFileNames()) {
total += DirectoryFactory.sizeOf(reader.directory(), file);
}
- obs.record(total, baseAttributes);
+ obs.record(MetricUtils.bytesToMegabytes(total), baseAttributes);
} catch (Exception e) {
// skip recording if unavailable (no nullNumber in OTel)
}
- }));
+ },
+ OtelUnit.MEGABYTES));
}
public long getWarmupTime() {
diff --git a/solr/core/src/java/org/apache/solr/search/stats/StatsCache.java b/solr/core/src/java/org/apache/solr/search/stats/StatsCache.java
index 5f163e842af..e79051449de 100644
--- a/solr/core/src/java/org/apache/solr/search/stats/StatsCache.java
+++ b/solr/core/src/java/org/apache/solr/search/stats/StatsCache.java
@@ -336,7 +336,7 @@ public abstract class StatsCache implements PluginInfoInitialized, SolrInfoBean
.build();
this.toClose =
solrMetricsContext.observableLongGauge(
- "solr_searcher_termstats_cache",
+ "solr_core_indexsearcher_termstats_cache",
"Operation counts for the searcher term statistics cache, reported per operation type",
obs -> {
var cacheMetrics = getCacheMetrics();
diff --git a/solr/core/src/java/org/apache/solr/update/SolrIndexWriter.java b/solr/core/src/java/org/apache/solr/update/SolrIndexWriter.java
index b17c5ecd74e..2f028f08587 100644
--- a/solr/core/src/java/org/apache/solr/update/SolrIndexWriter.java
+++ b/solr/core/src/java/org/apache/solr/update/SolrIndexWriter.java
@@ -258,21 +258,22 @@ public class SolrIndexWriter extends IndexWriter {
mergesCounter =
solrMetricsContext.longCounter(
- "solr_indexwriter_merges", "Number of total merge operations, " + descSuffix);
+ "solr_core_indexwriter_merges", "Number of total merge operations, " + descSuffix);
mergeDocsCounter =
solrMetricsContext.longCounter(
- "solr_indexwriter_merge_docs", "Number of documents involved in merge, " + descSuffix);
+ "solr_core_indexwriter_merge_docs",
+ "Number of documents involved in merge, " + descSuffix);
mergeSegmentsCounter =
solrMetricsContext.longCounter(
- "solr_indexwriter_merge_segments",
+ "solr_core_indexwriter_merge_segments",
"Number of segments involved in merge, " + descSuffix);
flushesCounter =
solrMetricsContext.longCounter(
- "solr_indexwriter_flushes", "Number of flush to disk operations triggered");
+ "solr_core_indexwriter_flushes", "Number of flush to disk operations triggered");
var mergesTimerBase =
solrMetricsContext.longHistogram(
- "solr_indexwriter_merge_time",
+ "solr_core_indexwriter_merge_time",
"Time spent merging segments, " + descSuffix,
OtelUnit.MILLISECONDS);
majorMergeTimer =
diff --git a/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java b/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java
index 3eab808565f..8410de18ffa 100644
--- a/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java
+++ b/solr/core/src/java/org/apache/solr/update/UpdateShardHandler.java
@@ -37,7 +37,6 @@ import org.apache.solr.security.HttpClientBuilderPlugin;
import org.apache.solr.update.processor.DistributedUpdateProcessor;
import org.apache.solr.update.processor.DistributingUpdateProcessorFactory;
import org.apache.solr.util.stats.InstrumentedHttpListenerFactory;
-import org.apache.solr.util.stats.MetricUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -167,11 +166,11 @@ public class UpdateShardHandler implements SolrInfoBean {
solrMetricsContext = parentContext.getChildContext(this);
trackHttpSolrMetrics.initializeMetrics(solrMetricsContext, Attributes.empty());
updateExecutor =
- MetricUtils.instrumentedExecutorService(
- updateExecutor, solrMetricsContext, getCategory(), "updateOnlyExecutor");
+ solrMetricsContext.instrumentedExecutorService(
+ updateExecutor, "solr_core_executor", "updateOnlyExecutor", getCategory());
recoveryExecutor =
- MetricUtils.instrumentedExecutorService(
- recoveryExecutor, solrMetricsContext, getCategory(), "recoveryExecutor");
+ solrMetricsContext.instrumentedExecutorService(
+ recoveryExecutor, "solr_core_executor", "recoveryExecutor", getCategory());
}
@Override
diff --git a/solr/core/src/java/org/apache/solr/util/stats/MetricUtils.java b/solr/core/src/java/org/apache/solr/util/stats/MetricUtils.java
index 23e6ca33ff2..5c878ab6476 100644
--- a/solr/core/src/java/org/apache/solr/util/stats/MetricUtils.java
+++ b/solr/core/src/java/org/apache/solr/util/stats/MetricUtils.java
@@ -18,24 +18,14 @@ package org.apache.solr.util.stats;
import com.codahale.metrics.Snapshot;
import com.codahale.metrics.Timer;
-import java.lang.invoke.MethodHandles;
import java.lang.management.OperatingSystemMXBean;
-import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
-import java.util.function.Predicate;
import org.apache.solr.common.util.NamedList;
-import org.apache.solr.core.SolrInfoBean;
-import org.apache.solr.metrics.SolrMetricsContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/** Metrics specific utility functions. */
public class MetricUtils {
- private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
- public static final String METRIC_NAME = "metric";
public static final String VALUE = "value";
- public static final String VALUES = "values";
private static final String MS = "_ms";
@@ -59,8 +49,6 @@ public class MetricUtils {
private static final String P999 = "p999";
private static final String P999_MS = P999 + MS;
- public static final Predicate<CharSequence> ALL_PROPERTIES = (name) -> true;
-
/**
* Adds metrics from a Timer to a NamedList, using well-known back-compat names.
*
@@ -90,13 +78,14 @@ public class MetricUtils {
return ns / TimeUnit.MILLISECONDS.toNanos(1);
}
- // optionally convert ns to ms
- static double nsToMs(boolean convert, double value) {
- if (convert) {
- return nsToMs(value);
- } else {
- return value;
- }
+ /**
+ * Converts bytes to megabytes.
+ *
+ * @param bytes the number of bytes
+ * @return the number of megabytes
+ */
+ public static double bytesToMegabytes(long bytes) {
+ return bytes / (1024.0 * 1024.0);
}
/**
@@ -110,13 +99,4 @@ public class MetricUtils {
"com.sun.management.UnixOperatingSystemMXBean",
"com.ibm.lang.management.OperatingSystemMXBean"
};
-
- /** Returns an instrumented wrapper over the given executor service. */
- public static ExecutorService instrumentedExecutorService(
- ExecutorService delegate,
- SolrMetricsContext ctx,
- SolrInfoBean.Category category,
- String name) {
- return new OtelInstrumentedExecutorService(delegate, ctx, category, name);
- }
}
diff --git a/solr/core/src/java/org/apache/solr/util/stats/OtelInstrumentedExecutorService.java b/solr/core/src/java/org/apache/solr/util/stats/OtelInstrumentedExecutorService.java
index b0d76fcc43c..aaad15d6bbf 100644
--- a/solr/core/src/java/org/apache/solr/util/stats/OtelInstrumentedExecutorService.java
+++ b/solr/core/src/java/org/apache/solr/util/stats/OtelInstrumentedExecutorService.java
@@ -17,9 +17,9 @@
package org.apache.solr.util.stats;
import static org.apache.solr.metrics.SolrMetricProducer.CATEGORY_ATTR;
+import static org.apache.solr.metrics.SolrMetricProducer.NAME_ATTR;
import static org.apache.solr.metrics.SolrMetricProducer.TYPE_ATTR;
-import io.opentelemetry.api.common.AttributeKey;
import io.opentelemetry.api.common.Attributes;
import java.util.ArrayList;
import java.util.Collection;
@@ -47,8 +47,6 @@ import org.apache.solr.metrics.otel.instruments.AttributedLongUpDownCounter;
* com.codahale.metrics.InstrumentedExecutorService.
*/
public class OtelInstrumentedExecutorService implements ExecutorService {
- public static final AttributeKey<String> EXECUTOR_NAME_ATTR =
- AttributeKey.stringKey("executor_name");
private final ExecutorService delegate;
private final String executorName;
@@ -62,8 +60,9 @@ public class OtelInstrumentedExecutorService implements ExecutorService {
public OtelInstrumentedExecutorService(
ExecutorService delegate,
SolrMetricsContext ctx,
- SolrInfoBean.Category category,
- String executorName) {
+ String metricPrefix,
+ String executorName,
+ SolrInfoBean.Category category) {
this.delegate = delegate;
this.executorName = executorName;
this.observableMetrics = new ArrayList<>();
@@ -71,12 +70,12 @@ public class OtelInstrumentedExecutorService implements ExecutorService {
Attributes attrs =
Attributes.builder()
.put(CATEGORY_ATTR, category.toString())
- .put(EXECUTOR_NAME_ATTR, executorName)
+ .put(NAME_ATTR, executorName)
.build();
// Each metric type needs a separate name to avoid obscuring other types
var executorTaskCounter =
- ctx.longCounter("solr_executor_tasks", "Number of ExecutorService tasks");
+ ctx.longCounter(metricPrefix + "_tasks", "Number of ExecutorService tasks");
this.submitted =
new AttributedLongCounter(
executorTaskCounter, attrs.toBuilder().put(TYPE_ATTR, "submitted").build());
@@ -86,11 +85,11 @@ public class OtelInstrumentedExecutorService implements ExecutorService {
this.running =
new AttributedLongUpDownCounter(
ctx.longUpDownCounter(
- "solr_executor_tasks_running", "Number of running ExecutorService tasks"),
+ metricPrefix + "_tasks_running", "Number of running ExecutorService tasks"),
attrs);
var executorTaskTimer =
ctx.longHistogram(
- "solr_executor_task_times", "Timing of ExecutorService tasks", OtelUnit.MILLISECONDS);
+ metricPrefix + "_task_times", "Timing of ExecutorService tasks", OtelUnit.MILLISECONDS);
this.idle =
new AttributedLongTimer(
executorTaskTimer, attrs.toBuilder().put(TYPE_ATTR, "idle").build());
@@ -102,7 +101,7 @@ public class OtelInstrumentedExecutorService implements ExecutorService {
ThreadPoolExecutor threadPool = (ThreadPoolExecutor) delegate;
observableMetrics.add(
ctx.observableLongGauge(
- "solr_executor_thread_pool_size",
+ metricPrefix + "_thread_pool_size",
"Thread pool size",
measurement -> {
measurement.record(
@@ -117,7 +116,7 @@ public class OtelInstrumentedExecutorService implements ExecutorService {
final BlockingQueue<Runnable> taskQueue = threadPool.getQueue();
observableMetrics.add(
ctx.observableLongGauge(
- "solr_executor_thread_pool_tasks",
+ metricPrefix + "_thread_pool_tasks",
"Thread pool task counts",
measurement -> {
measurement.record(
@@ -136,7 +135,7 @@ public class OtelInstrumentedExecutorService implements ExecutorService {
ForkJoinPool forkJoinPool = (ForkJoinPool) delegate;
observableMetrics.add(
ctx.observableLongGauge(
- "solr_executor_fork_join_pool_tasks",
+ metricPrefix + "_fork_join_pool_tasks",
"Fork join pool task counts",
measurement -> {
measurement.record(
@@ -148,7 +147,7 @@ public class OtelInstrumentedExecutorService implements ExecutorService {
}));
observableMetrics.add(
ctx.observableLongGauge(
- "solr_executor_fork_join_pool_threads",
+ metricPrefix + "_fork_join_pool_threads",
"Fork join pool thread counts",
measurement -> {
measurement.record(
@@ -217,13 +216,13 @@ public class OtelInstrumentedExecutorService implements ExecutorService {
@Override
public void shutdown() {
delegate.shutdown();
- observableMetrics.stream().forEach(IOUtils::closeQuietly);
+ IOUtils.closeQuietly(observableMetrics);
}
@Override
public List<Runnable> shutdownNow() {
List<Runnable> tasks = delegate.shutdownNow();
- observableMetrics.stream().forEach(IOUtils::closeQuietly);
+ IOUtils.closeQuietly(observableMetrics);
return tasks;
}
diff --git a/solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderTest.java b/solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderTest.java
index 8eb6daf2ceb..041ab757eb8 100644
--- a/solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/CloudExitableDirectoryReaderTest.java
@@ -101,7 +101,7 @@ public class CloudExitableDirectoryReaderTest extends SolrCloudTestCase {
var reader =
jetty.getCoreContainer().getMetricManager().getPrometheusMetricReader("solr.node");
- var errorsSnapshots = reader.collect((name) -> name.equals("solr_node_requests_errors"));
+ var errorsSnapshots = reader.collect("solr_node_requests_errors"::equals);
long errorCount = 0L;
if (errorsSnapshots.size() > 0) {
@@ -118,7 +118,7 @@ public class CloudExitableDirectoryReaderTest extends SolrCloudTestCase {
Long old = fiveHundredsByNode.put(jetty.getNodeName(), errorCount);
assertNull("expecting uniq nodenames", old);
- var requestsSnapshots = reader.collect((name) -> name.equals("solr_node_requests"));
+ var requestsSnapshots = reader.collect("solr_node_requests"::equals);
if (requestsSnapshots.size() > 0) {
var requestsSnapshot =
diff --git a/solr/core/src/test/org/apache/solr/cloud/MigrateReplicasTest.java b/solr/core/src/test/org/apache/solr/cloud/MigrateReplicasTest.java
index 46e2fb41a99..80a8377e791 100644
--- a/solr/core/src/test/org/apache/solr/cloud/MigrateReplicasTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/MigrateReplicasTest.java
@@ -211,7 +211,7 @@ public class MigrateReplicasTest extends SolrCloudTestCase {
var dp =
SolrMetricTestUtils.getGaugeDatapoint(
core,
- "solr_replication_is_replicating",
+ "solr_core_replication_is_replicating",
SolrMetricTestUtils.newCloudLabelsBuilder(core)
.label("category", SolrInfoBean.Category.REPLICATION.toString())
.label("handler", "/replication")
@@ -220,7 +220,7 @@ public class MigrateReplicasTest extends SolrCloudTestCase {
double isReplicating = dp.getValue();
assertTrue(
- "solr_replication_is_replicating should be 0 or 1, got: " + isReplicating,
+ "solr_core_replication_is_replicating should be 0 or 1, got: " + isReplicating,
isReplicating == 0.0 || isReplicating == 1.0);
}
}
diff --git a/solr/core/src/test/org/apache/solr/cloud/ReplaceNodeTest.java b/solr/core/src/test/org/apache/solr/cloud/ReplaceNodeTest.java
index d031196754b..e34d8bf6fda 100644
--- a/solr/core/src/test/org/apache/solr/cloud/ReplaceNodeTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/ReplaceNodeTest.java
@@ -189,7 +189,7 @@ public class ReplaceNodeTest extends SolrCloudTestCase {
var dp =
SolrMetricTestUtils.getGaugeDatapoint(
core,
- "solr_replication_is_replicating",
+ "solr_core_replication_is_replicating",
SolrMetricTestUtils.newCloudLabelsBuilder(core)
.label("category", SolrInfoBean.Category.REPLICATION.toString())
.label("handler", "/replication")
@@ -198,7 +198,7 @@ public class ReplaceNodeTest extends SolrCloudTestCase {
double isReplicating = dp.getValue();
assertTrue(
- "solr_replication_is_replicating should be 0 or 1, got: " + isReplicating,
+ "solr_core_replication_is_replicating should be 0 or 1, got: " + isReplicating,
isReplicating == 0.0 || isReplicating == 1.0);
}
}
diff --git a/solr/core/src/test/org/apache/solr/cloud/TestBaseStatsCacheCloud.java b/solr/core/src/test/org/apache/solr/cloud/TestBaseStatsCacheCloud.java
index a42e4bfb7e0..17844bc68cc 100644
--- a/solr/core/src/test/org/apache/solr/cloud/TestBaseStatsCacheCloud.java
+++ b/solr/core/src/test/org/apache/solr/cloud/TestBaseStatsCacheCloud.java
@@ -153,7 +153,7 @@ public abstract class TestBaseStatsCacheCloud extends SolrCloudTestCase {
String output = new String(in.readAllBytes(), StandardCharsets.UTF_8);
for (String line : output.lines().toList()) {
- if (line.startsWith("solr_searcher_termstats_cache")) {
+ if (line.startsWith("solr_core_indexsearcher_termstats_cache")) {
String type = extractTypeAttribute(line);
long value = extractMetricValue(line);
switch (type) {
@@ -242,7 +242,7 @@ public abstract class TestBaseStatsCacheCloud extends SolrCloudTestCase {
/**
* Extract type label value from Prometheus format line
- * "solr_searcher_stats_cache{...type="lookups",...}" -> "lookups"
+ * "solr_core_indexsearcher_termstats_cache{...type="lookups",...}" -> "lookups"
*/
private String extractTypeAttribute(String line) {
java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("\\btype=\"([^\"]+)\"");
@@ -254,8 +254,8 @@ public abstract class TestBaseStatsCacheCloud extends SolrCloudTestCase {
}
/**
- * Extract numeric value from Prometheus format line. "solr_searcher_stats_cache{...} 123.0" ->
- * 123
+ * Extract numeric value from Prometheus format line.
+ * "solr_core_indexsearcher_termstats_cache{...} 123.0" -> 123
*/
private long extractMetricValue(String line) {
String valueStr = line.substring(line.lastIndexOf(' ') + 1);
diff --git a/solr/core/src/test/org/apache/solr/cluster/placement/impl/CollectionMetricsBuilderTest.java b/solr/core/src/test/org/apache/solr/cluster/placement/impl/CollectionMetricsBuilderTest.java
index 48ca86f0151..a17032d2d09 100644
--- a/solr/core/src/test/org/apache/solr/cluster/placement/impl/CollectionMetricsBuilderTest.java
+++ b/solr/core/src/test/org/apache/solr/cluster/placement/impl/CollectionMetricsBuilderTest.java
@@ -17,23 +17,24 @@
package org.apache.solr.cluster.placement.impl;
import java.util.Arrays;
-import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.SolrTestCase;
import org.apache.solr.cluster.placement.CollectionMetrics;
import org.apache.solr.cluster.placement.ReplicaMetric;
import org.apache.solr.cluster.placement.ReplicaMetrics;
import org.apache.solr.cluster.placement.ShardMetrics;
import org.junit.Test;
-public class CollectionMetricsBuilderTest extends SolrTestCaseJ4 {
+public class CollectionMetricsBuilderTest extends SolrTestCase {
+
+ // Some arbitrary/bogus metric; doesn't matter in this unit test
+ private static final ReplicaMetric<Double> METRIC = new ReplicaMetricImpl<>("aMetric", "aMetric");
@Test
public void testMultipleShardLeaders() {
CollectionMetricsBuilder.ReplicaMetricsBuilder r1 =
- createReplicaMetricsBuilder(
- "r1", ReplicaMetricImpl.INDEX_SIZE_GB, 1.5 * MetricImpl.GB, true);
+ createReplicaMetricsBuilder("r1", METRIC, 1.5, true);
CollectionMetricsBuilder.ReplicaMetricsBuilder r2 =
- createReplicaMetricsBuilder(
- "r2", ReplicaMetricImpl.INDEX_SIZE_GB, 2.5 * MetricImpl.GB, true);
+ createReplicaMetricsBuilder("r2", METRIC, 2.5, true);
CollectionMetrics metrics = collectionMetricsFromShardReplicaBuilders("shard1", r1, r2);
ShardMetrics shardMetrics = metrics.getShardMetrics("shard1").get();
@@ -45,20 +46,18 @@ public class CollectionMetricsBuilderTest extends SolrTestCaseJ4 {
// Both replicas claimed to be shard leader, so either metric value is acceptable, and an
// exception should not be raised
- Double indexSize = leaderMetrics.getReplicaMetric(ReplicaMetricImpl.INDEX_SIZE_GB).get();
+ Double metricVal = leaderMetrics.getReplicaMetric(METRIC).get();
assertTrue(
- "Metric value " + indexSize + " should have matched one of the replica's values",
- indexSize.equals(1.5) || indexSize.equals(2.5));
+ "Metric value " + metricVal + " should have matched one of the replica's values",
+ metricVal.equals(1.5) || metricVal.equals(2.5));
}
@Test
public void testNoShardLeader() {
CollectionMetricsBuilder.ReplicaMetricsBuilder r1 =
- createReplicaMetricsBuilder(
- "r1", ReplicaMetricImpl.INDEX_SIZE_GB, 1.5 * MetricImpl.GB, false);
+ createReplicaMetricsBuilder("r1", METRIC, 1.5, false);
CollectionMetricsBuilder.ReplicaMetricsBuilder r2 =
- createReplicaMetricsBuilder(
- "r2", ReplicaMetricImpl.INDEX_SIZE_GB, 2.5 * MetricImpl.GB, false);
+ createReplicaMetricsBuilder("r2", METRIC, 2.5, false);
CollectionMetrics metrics = collectionMetricsFromShardReplicaBuilders("shard1", r1, r2);
assertTrue("Shard metrics not found", metrics.getShardMetrics("shard1").isPresent());
diff --git a/solr/core/src/test/org/apache/solr/handler/RequestHandlerMetricsTest.java b/solr/core/src/test/org/apache/solr/handler/RequestHandlerMetricsTest.java
index e338939b30c..4c7685692b1 100644
--- a/solr/core/src/test/org/apache/solr/handler/RequestHandlerMetricsTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/RequestHandlerMetricsTest.java
@@ -121,30 +121,34 @@ public class RequestHandlerMetricsTest extends SolrCloudTestCase {
(CounterSnapshot.CounterDataPointSnapshot)
SolrMetricTestUtils.getDataPointSnapshot(
nodeReader,
- "solr_node_requests",
+ "solr_core_requests",
Labels.builder()
.label("category", "QUERY")
.label("handler", "/select")
+ .label("internal", "false")
+ .label("replica_type", "NRT")
.label("otel_scope_name", "org.apache.solr")
.build());
CounterSnapshot.CounterDataPointSnapshot nodeUpdateRequests =
(CounterSnapshot.CounterDataPointSnapshot)
SolrMetricTestUtils.getDataPointSnapshot(
nodeReader,
- "solr_node_requests",
+ "solr_core_requests",
Labels.builder()
.label("category", "UPDATE")
.label("handler", "/update")
+ .label("replica_type", "NRT")
.label("otel_scope_name", "org.apache.solr")
.build());
CounterSnapshot.CounterDataPointSnapshot nodeSubmittedOps =
(CounterSnapshot.CounterDataPointSnapshot)
SolrMetricTestUtils.getDataPointSnapshot(
nodeReader,
- "solr_node_update_submitted_ops",
+ "solr_core_update_submitted_ops",
Labels.builder()
.label("category", "UPDATE")
.label("ops", "adds")
+ .label("replica_type", "NRT")
.label("otel_scope_name", "org.apache.solr")
.build());
diff --git a/solr/core/src/test/org/apache/solr/handler/admin/StatsReloadRaceTest.java b/solr/core/src/test/org/apache/solr/handler/admin/StatsReloadRaceTest.java
index 641a6c66ed3..f54d163ebb4 100644
--- a/solr/core/src/test/org/apache/solr/handler/admin/StatsReloadRaceTest.java
+++ b/solr/core/src/test/org/apache/solr/handler/admin/StatsReloadRaceTest.java
@@ -144,7 +144,7 @@ public class StatsReloadRaceTest extends SolrTestCaseJ4 {
var datapoint =
SolrMetricTestUtils.getGaugeDatapoint(
reader,
- "solr_searcher_index_version",
+ "solr_core_indexsearcher_index_version",
SolrMetricTestUtils.newStandaloneLabelsBuilder(core)
.label("category", "SEARCHER")
.build());
diff --git a/solr/core/src/test/org/apache/solr/metrics/SolrMetricsIntegrationTest.java b/solr/core/src/test/org/apache/solr/metrics/SolrMetricsIntegrationTest.java
index 8d646539c5f..dd599e1f1b4 100644
--- a/solr/core/src/test/org/apache/solr/metrics/SolrMetricsIntegrationTest.java
+++ b/solr/core/src/test/org/apache/solr/metrics/SolrMetricsIntegrationTest.java
@@ -84,8 +84,8 @@ public class SolrMetricsIntegrationTest extends SolrTestCaseJ4 {
assertNotNull(getGaugeOpt(reader, "solr_cores_loaded", "permanent"));
assertNotNull(getGaugeOpt(reader, "solr_cores_loaded", "unloaded"));
- assertNotNull(getGaugeOpt(reader, "solr_disk_space_bytes", "total_space"));
- assertNotNull(getGaugeOpt(reader, "solr_disk_space_bytes", "usable_space"));
+ assertNotNull(getGaugeOpt(reader, "solr_disk_space_megabytes", "total_space"));
+ assertNotNull(getGaugeOpt(reader, "solr_disk_space_megabytes", "usable_space"));
}
private static GaugeDataPointSnapshot getGaugeOpt(
diff --git a/solr/core/src/test/org/apache/solr/search/TestMainQueryCaching.java b/solr/core/src/test/org/apache/solr/search/TestMainQueryCaching.java
index 23349bf643b..afc8807a6e6 100644
--- a/solr/core/src/test/org/apache/solr/search/TestMainQueryCaching.java
+++ b/solr/core/src/test/org/apache/solr/search/TestMainQueryCaching.java
@@ -102,7 +102,7 @@ public class TestMainQueryCaching extends SolrTestCaseJ4 {
return (long)
SolrMetricTestUtils.getCounterDatapoint(
core,
- "solr_searcher_live_docs_cache",
+ "solr_core_indexsearcher_live_docs_cache",
SolrMetricTestUtils.newStandaloneLabelsBuilder(core)
.label("category", "SEARCHER")
.label("type", type)
diff --git a/solr/core/src/test/org/apache/solr/search/TestSolrFieldCacheBean.java b/solr/core/src/test/org/apache/solr/search/TestSolrFieldCacheBean.java
index 726d42d2c70..466eb3e5043 100644
--- a/solr/core/src/test/org/apache/solr/search/TestSolrFieldCacheBean.java
+++ b/solr/core/src/test/org/apache/solr/search/TestSolrFieldCacheBean.java
@@ -31,8 +31,8 @@ import org.junit.Test;
public class TestSolrFieldCacheBean extends SolrTestCaseJ4 {
- private static final String ENTRIES_METRIC_NAME = "solr_field_cache_entries";
- private static final String SIZE_BYTES_METRIC_NAME = "solr_field_cache_size_bytes";
+ private static final String ENTRIES_METRIC_NAME = "solr_core_field_cache_entries";
+ private static final String SIZE_BYTES_METRIC_NAME = "solr_core_field_cache_size_bytes";
private static final String DISABLE_ENTRY_LIST_PROPERTY = "disableSolrFieldCacheMBeanEntryList";
private static final String DISABLE_ENTRY_LIST_JMX_PROPERTY =
"disableSolrFieldCacheMBeanEntryListJmx";
diff --git a/solr/core/src/test/org/apache/solr/update/SolrIndexMetricsTest.java b/solr/core/src/test/org/apache/solr/update/SolrIndexMetricsTest.java
index f7d0470c88d..68d105cc7d2 100644
--- a/solr/core/src/test/org/apache/solr/update/SolrIndexMetricsTest.java
+++ b/solr/core/src/test/org/apache/solr/update/SolrIndexMetricsTest.java
@@ -64,7 +64,7 @@ public class SolrIndexMetricsTest extends SolrTestCaseJ4 {
var indexSize =
SolrMetricTestUtils.getGaugeDatapoint(
core,
- "solr_core_index_size_bytes",
+ "solr_core_index_size_megabytes",
SolrMetricTestUtils.newStandaloneLabelsBuilder(core)
.label("category", "CORE")
.build());
@@ -106,7 +106,7 @@ public class SolrIndexMetricsTest extends SolrTestCaseJ4 {
var minorMergeTimer =
SolrMetricTestUtils.getHistogramDatapoint(
core,
- "solr_indexwriter_merge_time_milliseconds",
+ "solr_core_indexwriter_merge_time_milliseconds",
SolrMetricTestUtils.newStandaloneLabelsBuilder(core)
.label(CATEGORY_ATTR.toString(), SolrInfoBean.Category.INDEX.toString())
.label(MERGE_TYPE_ATTR.toString(), "minor")
@@ -118,7 +118,7 @@ public class SolrIndexMetricsTest extends SolrTestCaseJ4 {
var majorMergeTimer =
SolrMetricTestUtils.getHistogramDatapoint(
core,
- "solr_indexwriter_merge_time_milliseconds",
+ "solr_core_indexwriter_merge_time_milliseconds",
SolrMetricTestUtils.newStandaloneLabelsBuilder(core)
.label(CATEGORY_ATTR.toString(), SolrInfoBean.Category.INDEX.toString())
.label(MERGE_TYPE_ATTR.toString(), "major")
@@ -131,7 +131,7 @@ public class SolrIndexMetricsTest extends SolrTestCaseJ4 {
var minorMergeDocs =
SolrMetricTestUtils.getCounterDatapoint(
core,
- "solr_indexwriter_merge_docs",
+ "solr_core_indexwriter_merge_docs",
SolrMetricTestUtils.newStandaloneLabelsBuilder(core)
.label(CATEGORY_ATTR.toString(), SolrInfoBean.Category.INDEX.toString())
.label(MERGE_TYPE_ATTR.toString(), "minor")
@@ -146,7 +146,7 @@ public class SolrIndexMetricsTest extends SolrTestCaseJ4 {
var majorMergeDocs =
SolrMetricTestUtils.getCounterDatapoint(
core,
- "solr_indexwriter_merge_docs",
+ "solr_core_indexwriter_merge_docs",
SolrMetricTestUtils.newStandaloneLabelsBuilder(core)
.label(CATEGORY_ATTR.toString(), SolrInfoBean.Category.INDEX.toString())
.label(MERGE_TYPE_ATTR.toString(), "major")
@@ -163,7 +163,7 @@ public class SolrIndexMetricsTest extends SolrTestCaseJ4 {
var minorSegmentsMergeMetric =
SolrMetricTestUtils.getCounterDatapoint(
core,
- "solr_indexwriter_merge_segments",
+ "solr_core_indexwriter_merge_segments",
SolrMetricTestUtils.newStandaloneLabelsBuilder(core)
.label(CATEGORY_ATTR.toString(), SolrInfoBean.Category.INDEX.toString())
.label(MERGE_TYPE_ATTR.toString(), "minor")
@@ -179,7 +179,7 @@ public class SolrIndexMetricsTest extends SolrTestCaseJ4 {
var majorSegmentsMergeMetric =
SolrMetricTestUtils.getCounterDatapoint(
core,
- "solr_indexwriter_merge_segments",
+ "solr_core_indexwriter_merge_segments",
SolrMetricTestUtils.newStandaloneLabelsBuilder(core)
.label(CATEGORY_ATTR.toString(), SolrInfoBean.Category.INDEX.toString())
.label(MERGE_TYPE_ATTR.toString(), "major")
@@ -196,7 +196,7 @@ public class SolrIndexMetricsTest extends SolrTestCaseJ4 {
var flushCounter =
SolrMetricTestUtils.getCounterDatapoint(
core,
- "solr_indexwriter_flushes",
+ "solr_core_indexwriter_flushes",
SolrMetricTestUtils.newStandaloneLabelsBuilder(core)
.label(CATEGORY_ATTR.toString(), SolrInfoBean.Category.INDEX.toString())
.build());
diff --git a/solr/core/src/test/org/apache/solr/util/stats/OtelInstrumentedExecutorServiceTest.java b/solr/core/src/test/org/apache/solr/util/stats/OtelInstrumentedExecutorServiceTest.java
index 3ae36b14db6..e6b5f1d287b 100644
--- a/solr/core/src/test/org/apache/solr/util/stats/OtelInstrumentedExecutorServiceTest.java
+++ b/solr/core/src/test/org/apache/solr/util/stats/OtelInstrumentedExecutorServiceTest.java
@@ -44,7 +44,6 @@ public class OtelInstrumentedExecutorServiceTest extends SolrTestCase {
public static long EXEC_TIMEOUT = 1;
public static TimeUnit EXEC_TIMEOUT_UNITS = TimeUnit.SECONDS;
public static final String REGISTRY_NAME = "solr-test-otel-registry";
- public static final String TAG_NAME = "solr-test-otel-tag";
public static final double DELTA = 2.4e-07;
public static SolrMetricsContext metricsContext;
@@ -67,10 +66,10 @@ public class OtelInstrumentedExecutorServiceTest extends SolrTestCase {
metricsContext.getMetricManager().getPrometheusMetricReader(REGISTRY_NAME).collect();
GaugeSnapshot tasksRunning =
SolrMetricTestUtils.getMetricSnapshot(
- GaugeSnapshot.class, metrics, "solr_executor_tasks_running");
+ GaugeSnapshot.class, metrics, "solr_node_executor_tasks_running");
CounterSnapshot taskCounters =
SolrMetricTestUtils.getMetricSnapshot(
- CounterSnapshot.class, metrics, "solr_executor_tasks");
+ CounterSnapshot.class, metrics, "solr_node_executor_tasks");
GaugeDataPointSnapshot runningTasks = tasksRunning.getDataPoints().getFirst();
CounterDataPointSnapshot submittedTasks = getCounterData(taskCounters, "submitted");
@@ -95,10 +94,10 @@ public class OtelInstrumentedExecutorServiceTest extends SolrTestCase {
metricsContext.getMetricManager().getPrometheusMetricReader(REGISTRY_NAME).collect();
GaugeSnapshot tasksRunning =
SolrMetricTestUtils.getMetricSnapshot(
- GaugeSnapshot.class, metrics, "solr_executor_tasks_running");
+ GaugeSnapshot.class, metrics, "solr_node_executor_tasks_running");
CounterSnapshot taskCounters =
SolrMetricTestUtils.getMetricSnapshot(
- CounterSnapshot.class, metrics, "solr_executor_tasks");
+ CounterSnapshot.class, metrics, "solr_node_executor_tasks");
GaugeDataPointSnapshot runningTasks = tasksRunning.getDataPoints().getFirst();
CounterDataPointSnapshot submittedTasks = getCounterData(taskCounters, "submitted");
@@ -129,7 +128,10 @@ public class OtelInstrumentedExecutorServiceTest extends SolrTestCase {
HistogramSnapshot taskTimers =
metrics.stream()
.filter(
- m -> m.getMetadata().getPrometheusName().startsWith("solr_executor_task_times"))
+ m ->
+ m.getMetadata()
+ .getPrometheusName()
+ .startsWith("solr_node_executor_task_times"))
.findFirst()
.map(HistogramSnapshot.class::cast)
.get();
@@ -163,10 +165,10 @@ public class OtelInstrumentedExecutorServiceTest extends SolrTestCase {
metricsContext.getMetricManager().getPrometheusMetricReader(REGISTRY_NAME).collect();
GaugeSnapshot sizeGauges =
SolrMetricTestUtils.getMetricSnapshot(
- GaugeSnapshot.class, metrics, "solr_executor_thread_pool_size");
+ GaugeSnapshot.class, metrics, "solr_node_executor_thread_pool_size");
GaugeSnapshot taskGauges =
SolrMetricTestUtils.getMetricSnapshot(
- GaugeSnapshot.class, metrics, "solr_executor_thread_pool_tasks");
+ GaugeSnapshot.class, metrics, "solr_node_executor_thread_pool_tasks");
GaugeDataPointSnapshot poolSize = getGaugeData(sizeGauges, "size");
GaugeDataPointSnapshot corePoolSize = getGaugeData(sizeGauges, "core");
@@ -205,10 +207,10 @@ public class OtelInstrumentedExecutorServiceTest extends SolrTestCase {
metricsContext.getMetricManager().getPrometheusMetricReader(REGISTRY_NAME).collect();
GaugeSnapshot taskGauges =
SolrMetricTestUtils.getMetricSnapshot(
- GaugeSnapshot.class, metrics, "solr_executor_fork_join_pool_tasks");
+ GaugeSnapshot.class, metrics, "solr_node_executor_fork_join_pool_tasks");
GaugeSnapshot threadGauges =
SolrMetricTestUtils.getMetricSnapshot(
- GaugeSnapshot.class, metrics, "solr_executor_fork_join_pool_threads");
+ GaugeSnapshot.class, metrics, "solr_node_executor_fork_join_pool_threads");
GaugeDataPointSnapshot stolenTasks = getGaugeData(taskGauges, "stolen");
GaugeDataPointSnapshot queuedTasks = getGaugeData(taskGauges, "queued");
@@ -224,8 +226,8 @@ public class OtelInstrumentedExecutorServiceTest extends SolrTestCase {
}
private static ExecutorService testExecutor(String name, ExecutorService exec) {
- return MetricUtils.instrumentedExecutorService(
- exec, metricsContext, SolrInfoBean.Category.ADMIN, name);
+ return metricsContext.instrumentedExecutorService(
+ exec, "solr_node_executor", name, SolrInfoBean.Category.ADMIN);
}
private static CounterDataPointSnapshot getCounterData(CounterSnapshot snapshot, String type) {
diff --git a/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/impl/NodeValueFetcher.java b/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/impl/NodeValueFetcher.java
index b9a2e439d51..bd9b237cecd 100644
--- a/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/impl/NodeValueFetcher.java
+++ b/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/impl/NodeValueFetcher.java
@@ -64,8 +64,8 @@ public class NodeValueFetcher {
/** Various well known tags that can be fetched from a node */
public enum Metrics {
- FREEDISK("freedisk", "solr_disk_space_bytes", "type", "usable_space"),
- TOTALDISK("totaldisk", "solr_disk_space_bytes", "type", "total_space"),
+ FREEDISK("freedisk", "solr_disk_space_megabytes", "type", "usable_space"),
+ TOTALDISK("totaldisk", "solr_disk_space_megabytes", "type", "total_space"),
CORES("cores", "solr_cores_loaded") {
@Override
public Object extractFromPrometheus(List<String> prometheusLines) {
@@ -257,9 +257,8 @@ public class NodeValueFetcher {
/**
* Retrieve values that match metrics. Metrics names are structured like below:
*
- * <p>"metrics:solr_cores_filesystem_disk_space_bytes:type=usable_space" or
- * "metrics:jvm_cpu_count". Metrics are fetched from /admin/metrics and parsed using shared
- * utility methods.
+ * <p>"metrics:solr_disk_space_megabytes:type=usable_space" or "metrics:jvm_cpu_count". Metrics
+ * are fetched from /admin/metrics and parsed using shared utility methods.
*/
private void getRemoteMetrics(
Set<String> requestedTagNames, SolrClientNodeStateProvider.RemoteCallCtx ctx) {
@@ -346,7 +345,7 @@ public class NodeValueFetcher {
/**
* Create a MetricRequest from a metric tag string like "metrics:jvm_cpu_count" or
- * "metrics:solr_cores_filesystem_disk_space_bytes:type=usable_space"
+ * "metrics:solr_disk_space_megabytes:type=usable_space"
*/
public static MetricRequest fromTag(String tag) {
String[] parts = tag.split(":");
diff --git a/solr/solrj/gradle.lockfile b/solr/solrj/gradle.lockfile
index db547de09b9..876ad1344d1 100644
--- a/solr/solrj/gradle.lockfile
+++ b/solr/solrj/gradle.lockfile
@@ -17,12 +17,18 @@ com.github.stephenc.jcip:jcip-annotations:1.0-1=compileClasspath,compileOnlyHelp
com.google.auto.service:auto-service-annotations:1.0.1=annotationProcessor,errorprone,testAnnotationProcessor
com.google.auto.value:auto-value-annotations:1.11.0=annotationProcessor,errorprone,testAnnotationProcessor
com.google.auto:auto-common:1.2.2=annotationProcessor,errorprone,testAnnotationProcessor
+com.google.code.findbugs:jsr305:3.0.2=spotless865458226
com.google.errorprone:error_prone_annotation:2.41.0=annotationProcessor,errorprone,testAnnotationProcessor
+com.google.errorprone:error_prone_annotations:2.18.0=spotless865458226
com.google.errorprone:error_prone_annotations:2.41.0=annotationProcessor,errorprone,jarValidation,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath
com.google.errorprone:error_prone_check_api:2.41.0=annotationProcessor,errorprone,testAnnotationProcessor
com.google.errorprone:error_prone_core:2.41.0=annotationProcessor,errorprone,testAnnotationProcessor
+com.google.googlejavaformat:google-java-format:1.18.1=spotless865458226
com.google.googlejavaformat:google-java-format:1.27.0=annotationProcessor,errorprone,testAnnotationProcessor
+com.google.guava:failureaccess:1.0.1=spotless865458226
com.google.guava:failureaccess:1.0.3=annotationProcessor,errorprone,jarValidation,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath
+com.google.guava:guava-parent:32.1.1-jre=spotless865458226
+com.google.guava:guava:32.1.1-jre=spotless865458226
com.google.guava:guava:33.4.8-jre=annotationProcessor,errorprone,jarValidation,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath
com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,errorprone,jarValidation,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath
com.google.j2objc:j2objc-annotations:3.1=annotationProcessor,errorprone,jarValidation,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath
@@ -125,6 +131,7 @@ org.apache.yetus:audience-annotations:0.12.0=permitTestUnusedDeclared
org.apache.zookeeper:zookeeper-jute:3.9.4=jarValidation,permitTestUnusedDeclared,testCompileClasspath,testRuntimeClasspath
org.apache.zookeeper:zookeeper:3.9.4=jarValidation,permitTestUnusedDeclared,testCompileClasspath,testRuntimeClasspath
org.apiguardian:apiguardian-api:1.1.2=jarValidation,testRuntimeClasspath
+org.checkerframework:checker-qual:3.33.0=spotless865458226
org.codehaus.woodstox:stax2-api:4.2.2=jarValidation,testRuntimeClasspath
org.eclipse.jetty.ee10:jetty-ee10-servlet:12.0.27=jarValidation,testCompileClasspath,testRuntimeClasspath
org.eclipse.jetty.ee10:jetty-ee10-webapp:12.0.27=jarValidation,testCompileClasspath,testRuntimeClasspath
diff --git a/solr/test-framework/src/java/org/apache/solr/cluster/placement/Builders.java b/solr/test-framework/src/java/org/apache/solr/cluster/placement/Builders.java
index cffbea31b4c..7185472b7a9 100644
--- a/solr/test-framework/src/java/org/apache/solr/cluster/placement/Builders.java
+++ b/solr/test-framework/src/java/org/apache/solr/cluster/placement/Builders.java
@@ -435,7 +435,7 @@ public class Builders {
if (initialSizeGBPerShard != null) {
replicaMetricsBuilder.addMetric(
ReplicaMetricImpl.INDEX_SIZE_GB,
- initialSizeGBPerShard.get(shardNumber - 1) * ReplicaMetricImpl.GB);
+ initialSizeGBPerShard.get(shardNumber - 1) * 1024); // GB to MB
}
if (leader == null && type != Replica.ReplicaType.PULL) {
leader = replicaBuilder;
diff --git a/solr/test-framework/src/java/org/apache/solr/util/SolrMetricTestUtils.java b/solr/test-framework/src/java/org/apache/solr/util/SolrMetricTestUtils.java
index 548195acc59..a201c9227bd 100644
--- a/solr/test-framework/src/java/org/apache/solr/util/SolrMetricTestUtils.java
+++ b/solr/test-framework/src/java/org/apache/solr/util/SolrMetricTestUtils.java
@@ -85,6 +85,11 @@ public final class SolrMetricTestUtils {
public static final String SUFFIX = "_testing";
+ /**
+ * Looks up the first {@link MetricSnapshot} named {@code metricName}, and returns the first
+ * {@link DataPointSnapshot} having exactly these {@code labels}. Null if not found. The result is
+ * typically casted to something useful.
+ */
public static DataPointSnapshot getDataPointSnapshot(
PrometheusMetricReader reader, String metricName, Labels labels) {
MetricSnapshots metricSnapshots = reader.collect();
@@ -228,7 +233,7 @@ public final class SolrMetricTestUtils {
SolrCore core, String cacheName, String operation) {
return SolrMetricTestUtils.getCounterDatapoint(
core,
- "solr_searcher_cache_ops",
+ "solr_core_indexsearcher_cache_ops",
SolrMetricTestUtils.newStandaloneLabelsBuilder(core)
.label("category", "CACHE")
.label("ops", operation)
@@ -244,7 +249,7 @@ public final class SolrMetricTestUtils {
.label("name", cacheName)
.label("result", result);
return SolrMetricTestUtils.getCounterDatapoint(
- core, "solr_searcher_cache_lookups", builder.build());
+ core, "solr_core_indexsearcher_cache_lookups", builder.build());
}
public static CounterSnapshot.CounterDataPointSnapshot getCacheSearcherOpsHits(
(solr) 05/05: minor fix solr-jetty-context.xml defaultsDescriptor
Posted by ds...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
dsmiley pushed a commit to branch branch_10_0
in repository https://gitbox.apache.org/repos/asf/solr.git
commit de9c08d8b753608d59127644501aa5bef86d43bc
Author: David Smiley <ds...@apache.org>
AuthorDate: Sat Nov 8 00:35:49 2025 -0500
minor fix solr-jetty-context.xml defaultsDescriptor
I accidentally committed a commenting out of the defaultsDescriptor while merging something totally unrelated.
This probably had no practical effect, as webdefault.xml is itself just the defaults.
(cherry picked from commit 1f5fe210e88c05e6a02a3f49f9f722b26f79aafe)
---
solr/server/contexts/solr-jetty-context.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/solr/server/contexts/solr-jetty-context.xml b/solr/server/contexts/solr-jetty-context.xml
index b6ac292c226..979377932b0 100644
--- a/solr/server/contexts/solr-jetty-context.xml
+++ b/solr/server/contexts/solr-jetty-context.xml
@@ -3,7 +3,7 @@
<Configure class="org.eclipse.jetty.ee10.webapp.WebAppContext">
<Set name="contextPath"><Property name="hostContext" default="/solr"/></Set>
<Set name="war"><Property name="jetty.base"/>/solr-webapp/webapp</Set>
-<!-- <Set name="defaultsDescriptor"><Property name="jetty.base"/>/etc/webdefault.xml</Set>-->
+ <Set name="defaultsDescriptor"><Property name="jetty.base"/>/etc/webdefault.xml</Set>
<Set name="extractWAR">false</Set>
<!--
(solr) 04/05: Remove unintentionally committed file
Posted by ds...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
dsmiley pushed a commit to branch branch_10_0
in repository https://gitbox.apache.org/repos/asf/solr.git
commit 64b8627a28c75a318081140c800e9221d9d2bd4b
Author: Jason Gerlowski <ge...@apache.org>
AuthorDate: Fri Nov 7 21:37:20 2025 -0500
Remove unintentionally committed file
(cherry picked from commit e64c804bf22520709dac557a5b6ec51ddea000f5)
---
ExportTool.java.original | 738 -----------------------------------------------
1 file changed, 738 deletions(-)
diff --git a/ExportTool.java.original b/ExportTool.java.original
deleted file mode 100644
index 050092c2017..00000000000
--- a/ExportTool.java.original
+++ /dev/null
@@ -1,738 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.solr.cli;
-
-import static org.apache.solr.common.params.CommonParams.FL;
-import static org.apache.solr.common.params.CommonParams.JAVABIN;
-import static org.apache.solr.common.params.CommonParams.JSON;
-import static org.apache.solr.common.params.CommonParams.Q;
-import static org.apache.solr.common.params.CommonParams.SORT;
-import static org.apache.solr.common.util.JavaBinCodec.SOLRINPUTDOC;
-
-import java.io.BufferedOutputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.nio.charset.StandardCharsets;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.time.Instant;
-import java.time.format.DateTimeFormatter;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.function.BiConsumer;
-import java.util.function.Consumer;
-import java.util.zip.GZIPOutputStream;
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.Option;
-import org.apache.commons.cli.Options;
-import org.apache.lucene.util.SuppressForbidden;
-import org.apache.solr.client.solrj.SolrClient;
-import org.apache.solr.client.solrj.SolrQuery;
-import org.apache.solr.client.solrj.SolrRequest;
-import org.apache.solr.client.solrj.SolrServerException;
-import org.apache.solr.client.solrj.StreamingResponseCallback;
-import org.apache.solr.client.solrj.impl.CloudHttp2SolrClient;
-import org.apache.solr.client.solrj.impl.CloudSolrClient;
-import org.apache.solr.client.solrj.impl.ClusterStateProvider;
-import org.apache.solr.client.solrj.impl.Http2SolrClient;
-import org.apache.solr.client.solrj.impl.StreamingJavaBinResponseParser;
-import org.apache.solr.client.solrj.request.GenericSolrRequest;
-import org.apache.solr.client.solrj.request.QueryRequest;
-import org.apache.solr.common.SolrDocument;
-import org.apache.solr.common.SolrDocumentList;
-import org.apache.solr.common.cloud.DocCollection;
-import org.apache.solr.common.cloud.Replica;
-import org.apache.solr.common.cloud.Slice;
-import org.apache.solr.common.params.CommonParams;
-import org.apache.solr.common.params.CursorMarkParams;
-import org.apache.solr.common.params.ModifiableSolrParams;
-import org.apache.solr.common.params.SolrParams;
-import org.apache.solr.common.util.CollectionUtil;
-import org.apache.solr.common.util.ExecutorUtil;
-import org.apache.solr.common.util.JavaBinCodec;
-import org.apache.solr.common.util.NamedList;
-import org.apache.solr.common.util.SolrNamedThreadFactory;
-import org.apache.solr.common.util.StrUtils;
-import org.noggit.CharArr;
-import org.noggit.JSONWriter;
-
-/** Supports export command in the bin/solr script. */
-public class ExportTool extends ToolBase {
-
- private static final Option COLLECTION_NAME_OPTION =
- Option.builder("c")
- .longOpt("name")
- .hasArg()
- .argName("NAME")
- .desc("Name of the collection.")
- .build();
-
- private static final Option OUTPUT_OPTION =
- Option.builder()
- .longOpt("output")
- .hasArg()
- .argName("PATH")
- .desc(
- "Path to output the exported data, and optionally the file name, defaults to 'collection-name'.")
- .build();
-
- private static final Option FORMAT_OPTION =
- Option.builder()
- .longOpt("format")
- .hasArg()
- .argName("FORMAT")
- .desc("Output format for exported docs (json, jsonl or javabin), defaulting to json.")
- .build();
-
- private static final Option COMPRESS_OPTION =
- Option.builder().longOpt("compress").desc("Compress the output. Defaults to false.").build();
-
- private static final Option LIMIT_OPTION =
- Option.builder()
- .longOpt("limit")
- .hasArg()
- .argName("#")
- .desc("Maximum number of docs to download. Default is 100, use -1 for all docs.")
- .build();
-
- private static final Option QUERY_OPTION =
- Option.builder()
- .longOpt("query")
- .hasArg()
- .argName("QUERY")
- .desc("A custom query, default is '*:*'.")
- .build();
-
- private static final Option FIELDS_OPTION =
- Option.builder()
- .longOpt("fields")
- .hasArg()
- .argName("FIELDA,FIELDB")
- .desc("Comma separated list of fields to export. By default all fields are fetched.")
- .build();
-
- public ExportTool(ToolRuntime runtime) {
- super(runtime);
- }
-
- @Override
- public String getName() {
- return "export";
- }
-
- @Override
- public Options getOptions() {
- return super.getOptions()
- .addOption(COLLECTION_NAME_OPTION)
- .addOption(OUTPUT_OPTION)
- .addOption(FORMAT_OPTION)
- .addOption(COMPRESS_OPTION)
- .addOption(LIMIT_OPTION)
- .addOption(QUERY_OPTION)
- .addOption(FIELDS_OPTION)
- .addOption(CommonCLIOptions.SOLR_URL_OPTION)
- .addOption(CommonCLIOptions.CREDENTIALS_OPTION);
- }
-
- public abstract static class Info {
- final ToolRuntime runtime;
-
- String baseurl;
- String credentials;
- String format;
- boolean compress;
- String query;
- String coll;
- String out;
- String fields;
- long limit = 100;
- AtomicLong docsWritten = new AtomicLong(0);
- int bufferSize = 1024 * 1024;
- String uniqueKey;
- CloudSolrClient solrClient;
- DocsSink sink;
-
- public Info(ToolRuntime runtime, String url, String credentials) {
- this.runtime = runtime;
- setUrl(url);
- setCredentials(credentials);
- setOutFormat(null, "jsonl", false);
- }
-
- public void setUrl(String url) {
- int idx = url.lastIndexOf('/');
- baseurl = url.substring(0, idx);
- coll = url.substring(idx + 1);
- query = "*:*";
- }
-
- public void setCredentials(String credentials) {
- this.credentials = credentials;
- }
-
- public void setLimit(String maxDocsStr) {
- limit = Long.parseLong(maxDocsStr);
- if (limit == -1) limit = Long.MAX_VALUE;
- }
-
- public void setOutFormat(String out, String format, boolean compress) {
- this.compress = compress;
- this.format = format;
- this.out = out;
- if (this.format == null) {
- this.format = JSON;
- }
- if (!formats.contains(this.format)) {
- throw new IllegalArgumentException("format must be one of: " + formats);
- }
- if (this.out == null) {
- this.out = coll;
- } else if (Files.isDirectory(Path.of(this.out))) {
- this.out = this.out + "/" + coll;
- }
- this.out = this.out + '.' + this.format;
- if (compress) {
- this.out = this.out + ".gz";
- }
- }
-
- DocsSink getSink() {
- DocsSink docSink = null;
- switch (format) {
- case JAVABIN:
- docSink = new JavabinSink(this);
- break;
- case JSON:
- docSink = new JsonSink(this);
- break;
- case "jsonl":
- docSink = new JsonWithLinesSink(this);
- break;
- }
- return docSink;
- }
-
- abstract void exportDocs() throws Exception;
-
- void fetchUniqueKey() throws SolrServerException, IOException {
- Http2SolrClient.Builder builder =
- new Http2SolrClient.Builder().withOptionalBasicAuthCredentials(credentials);
-
- solrClient =
- new CloudHttp2SolrClient.Builder(Collections.singletonList(baseurl))
- .withInternalClientBuilder(builder)
- .build();
- NamedList<Object> response =
- solrClient.request(
- new GenericSolrRequest(
- SolrRequest.METHOD.GET,
- "/schema/uniquekey",
- SolrParams.of("collection", coll))
- .setRequiresCollection(true));
- uniqueKey = (String) response.get("uniqueKey");
- }
-
- public static StreamingResponseCallback getStreamer(Consumer<SolrDocument> sink) {
- return new StreamingResponseCallback() {
- @Override
- public void streamSolrDocument(SolrDocument doc) {
- try {
- sink.accept(doc);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- @Override
- public void streamDocListInfo(long numFound, long start, Float maxScore) {}
- };
- }
- }
-
- static Set<String> formats = Set.of(JAVABIN, JSON, "jsonl");
-
- @Override
- public void runImpl(CommandLine cli) throws Exception {
- String url = null;
- if (cli.hasOption(CommonCLIOptions.SOLR_URL_OPTION)) {
- if (!cli.hasOption(COLLECTION_NAME_OPTION)) {
- throw new IllegalArgumentException(
- "Must specify -c / --name parameter with --solr-url to post documents.");
- }
- url = CLIUtils.normalizeSolrUrl(cli) + "/solr/" + cli.getOptionValue(COLLECTION_NAME_OPTION);
-
- } else {
- // think about support --zk-host someday.
- throw new IllegalArgumentException("Must specify --solr-url.");
- }
- String credentials = cli.getOptionValue(CommonCLIOptions.CREDENTIALS_OPTION);
- Info info = new MultiThreadedRunner(runtime, url, credentials);
- info.query = cli.getOptionValue(QUERY_OPTION, "*:*");
-
- info.setOutFormat(
- cli.getOptionValue(OUTPUT_OPTION),
- cli.getOptionValue(FORMAT_OPTION),
- cli.hasOption(COMPRESS_OPTION));
- info.fields = cli.getOptionValue(FIELDS_OPTION);
- info.setLimit(cli.getOptionValue(LIMIT_OPTION, "100"));
- info.exportDocs();
- }
-
- abstract static class DocsSink {
- Info info;
- OutputStream fos;
-
- abstract void start() throws IOException;
-
- @SuppressForbidden(reason = "Command line tool prints out to console")
- void accept(SolrDocument document) throws IOException {
- long count = info.docsWritten.incrementAndGet();
-
- if (count % 100000 == 0) {
- System.out.println("\nDOCS: " + count);
- }
- }
-
- void end() throws IOException {}
- }
-
- static class JsonWithLinesSink extends DocsSink {
- private final CharArr charArr = new CharArr(1024 * 2);
- JSONWriter jsonWriter = new JSONWriter(charArr, -1);
- private Writer writer;
-
- public JsonWithLinesSink(Info info) {
- this.info = info;
- }
-
- @Override
- public void start() throws IOException {
- fos = new FileOutputStream(info.out);
- if (info.compress) {
- fos = new GZIPOutputStream(fos);
- }
- if (info.bufferSize > 0) {
- fos = new BufferedOutputStream(fos, info.bufferSize);
- }
- writer = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
- }
-
- @Override
- public void end() throws IOException {
- writer.flush();
- fos.flush();
- fos.close();
- }
-
- @Override
- public synchronized void accept(SolrDocument doc) throws IOException {
- charArr.reset();
- Map<String, Object> m = CollectionUtil.newLinkedHashMap(doc.size());
- doc.forEach(
- (s, field) -> {
- if (s.equals("_version_") || s.equals("_roor_")) return;
- if (field instanceof List) {
- if (((List<?>) field).size() == 1) {
- field = ((List<?>) field).get(0);
- }
- }
- field = constructDateStr(field);
- if (field instanceof List<?> list) {
- if (hasdate(list)) {
- ArrayList<Object> listCopy = new ArrayList<>(list.size());
- for (Object o : list) listCopy.add(constructDateStr(o));
- field = listCopy;
- }
- }
- m.put(s, field);
- });
- jsonWriter.write(m);
- writer.write(charArr.getArray(), charArr.getStart(), charArr.getEnd());
- writer.append('\n');
- super.accept(doc);
- }
-
- private boolean hasdate(List<?> list) {
- boolean hasDate = false;
- for (Object o : list) {
- if (o instanceof Date) {
- hasDate = true;
- break;
- }
- }
- return hasDate;
- }
-
- private Object constructDateStr(Object field) {
- if (field instanceof Date) {
- field =
- DateTimeFormatter.ISO_INSTANT.format(Instant.ofEpochMilli(((Date) field).getTime()));
- }
- return field;
- }
- }
-
- static class JsonSink extends DocsSink {
- private final CharArr charArr = new CharArr(1024 * 2);
- JSONWriter jsonWriter = new JSONWriter(charArr, -1);
- private Writer writer;
- private boolean firstDoc = true;
-
- public JsonSink(Info info) {
- this.info = info;
- }
-
- @Override
- public void start() throws IOException {
- fos = new FileOutputStream(info.out);
- if (info.compress) {
- fos = new GZIPOutputStream(fos);
- }
- if (info.bufferSize > 0) {
- fos = new BufferedOutputStream(fos, info.bufferSize);
- }
- writer = new OutputStreamWriter(fos, StandardCharsets.UTF_8);
- writer.append('[');
- }
-
- @Override
- public void end() throws IOException {
- writer.append(']');
- writer.flush();
- fos.flush();
- fos.close();
- }
-
- @Override
- public synchronized void accept(SolrDocument doc) throws IOException {
- charArr.reset();
- Map<String, Object> m = CollectionUtil.newLinkedHashMap(doc.size());
- doc.forEach(
- (s, field) -> {
- if (s.equals("_version_") || s.equals("_roor_")) return;
- if (field instanceof List) {
- if (((List<?>) field).size() == 1) {
- field = ((List<?>) field).get(0);
- }
- }
- field = constructDateStr(field);
- if (field instanceof List<?> list) {
- if (hasdate(list)) {
- ArrayList<Object> listCopy = new ArrayList<>(list.size());
- for (Object o : list) listCopy.add(constructDateStr(o));
- field = listCopy;
- }
- }
- m.put(s, field);
- });
- if (firstDoc) {
- firstDoc = false;
- } else {
- writer.append(',');
- }
- jsonWriter.write(m);
- writer.write(charArr.getArray(), charArr.getStart(), charArr.getEnd());
- writer.append('\n');
- super.accept(doc);
- }
-
- private boolean hasdate(List<?> list) {
- boolean hasDate = false;
- for (Object o : list) {
- if (o instanceof Date) {
- hasDate = true;
- break;
- }
- }
- return hasDate;
- }
-
- private Object constructDateStr(Object field) {
- if (field instanceof Date) {
- field =
- DateTimeFormatter.ISO_INSTANT.format(Instant.ofEpochMilli(((Date) field).getTime()));
- }
- return field;
- }
- }
-
- static class JavabinSink extends DocsSink {
- JavaBinCodec codec;
-
- public JavabinSink(Info info) {
- this.info = info;
- }
-
- @Override
- public void start() throws IOException {
- fos = new FileOutputStream(info.out);
- if (info.compress) {
- fos = new GZIPOutputStream(fos);
- }
- if (info.bufferSize > 0) {
- fos = new BufferedOutputStream(fos, info.bufferSize);
- }
- codec = new JavaBinCodec(fos, null);
- codec.writeTag(JavaBinCodec.NAMED_LST, 2);
- codec.writeStr("params");
- codec.writeNamedList(new NamedList<>());
- codec.writeStr("docs");
- codec.writeTag(JavaBinCodec.ITERATOR);
- }
-
- @Override
- public void end() throws IOException {
- codec.writeTag(JavaBinCodec.END);
- codec.close();
- fos.flush();
- fos.close();
- }
-
- private final BiConsumer<String, Object> bic =
- new BiConsumer<>() {
- @Override
- public void accept(String s, Object o) {
- try {
- if (s.equals("_version_") || s.equals("_root_")) return;
- codec.writeExternString(s);
- codec.writeVal(o);
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- };
-
- @Override
- public synchronized void accept(SolrDocument doc) throws IOException {
- int sz = doc.size();
- if (doc.containsKey("_version_")) sz--;
- if (doc.containsKey("_root_")) sz--;
- codec.writeTag(SOLRINPUTDOC, sz);
- codec.writeFloat(1f); // document boost
- doc.forEach(bic);
- super.accept(doc);
- }
- }
-
- static class MultiThreadedRunner extends Info {
- ExecutorService producerThreadpool, consumerThreadpool;
- ArrayBlockingQueue<SolrDocument> queue = new ArrayBlockingQueue<>(1000);
- SolrDocument EOFDOC = new SolrDocument();
- volatile boolean failed = false;
- Map<String, CoreHandler> corehandlers = new HashMap<>();
- private final long startTime;
-
- @SuppressForbidden(reason = "Need to print out time")
- public MultiThreadedRunner(ToolRuntime runtime, String url, String credentials) {
- super(runtime, url, credentials);
- startTime = System.currentTimeMillis();
- }
-
- @Override
- @SuppressForbidden(reason = "Need to print out time")
- void exportDocs() throws Exception {
- sink = getSink();
- fetchUniqueKey();
- ClusterStateProvider stateProvider = solrClient.getClusterStateProvider();
- DocCollection coll = stateProvider.getCollection(this.coll);
- Map<String, Slice> m = coll.getSlicesMap();
- producerThreadpool =
- ExecutorUtil.newMDCAwareFixedThreadPool(
- m.size(), new SolrNamedThreadFactory("solrcli-exporter-producers"));
- consumerThreadpool =
- ExecutorUtil.newMDCAwareFixedThreadPool(
- 1, new SolrNamedThreadFactory("solrcli-exporter-consumer"));
- sink.start();
- CountDownLatch consumerlatch = new CountDownLatch(1);
- try {
- addConsumer(consumerlatch);
- addProducers(m);
- runtime.println("Number of shards : " + corehandlers.size());
- CountDownLatch producerLatch = new CountDownLatch(corehandlers.size());
- corehandlers.forEach(
- (s, coreHandler) ->
- producerThreadpool.execute(
- () -> {
- try {
- coreHandler.exportDocsFromCore();
- } catch (Exception e) {
- runtime.println("Error exporting docs from : " + s);
- }
- producerLatch.countDown();
- }));
-
- producerLatch.await();
- queue.offer(EOFDOC, 10, TimeUnit.SECONDS);
- consumerlatch.await();
- } finally {
- sink.end();
- solrClient.close();
- producerThreadpool.shutdownNow();
- consumerThreadpool.shutdownNow();
- if (failed) {
- try {
- Files.delete(Path.of(out));
- } catch (IOException e) {
- // ignore
- }
- }
- System.out.println(
- "\nTotal Docs exported: "
- + docsWritten.get()
- + ". Time elapsed: "
- + ((System.currentTimeMillis() - startTime) / 1000)
- + "seconds");
- }
- }
-
- private void addProducers(Map<String, Slice> m) {
- for (Map.Entry<String, Slice> entry : m.entrySet()) {
- Slice slice = entry.getValue();
- Replica replica = slice.getLeader();
- if (replica == null)
- replica = slice.getReplicas().iterator().next(); // get a random replica
- CoreHandler coreHandler = new CoreHandler(replica);
- corehandlers.put(replica.getCoreName(), coreHandler);
- }
- }
-
- private void addConsumer(CountDownLatch consumerlatch) {
- consumerThreadpool.execute(
- () -> {
- while (true) {
- SolrDocument doc;
- try {
- doc = queue.poll(30, TimeUnit.SECONDS);
- } catch (InterruptedException e) {
- runtime.println("Consumer interrupted");
- failed = true;
- break;
- }
- if (doc == EOFDOC) break;
- try {
- if (docsWritten.get() >= limit) {
- continue;
- }
- sink.accept(doc);
- } catch (Exception e) {
- runtime.println("Failed to write to file " + e.getMessage());
- failed = true;
- }
- }
- consumerlatch.countDown();
- });
- }
-
- class CoreHandler {
- final Replica replica;
- long expectedDocs;
- AtomicLong receivedDocs = new AtomicLong();
-
- CoreHandler(Replica replica) {
- this.replica = replica;
- }
-
- boolean exportDocsFromCore() throws IOException, SolrServerException {
- // reference the replica's node URL, not the baseUrl in scope, which could be anywhere
- try (SolrClient client = CLIUtils.getSolrClient(replica.getBaseUrl(), credentials)) {
- expectedDocs = getDocCount(replica.getCoreName(), client, query);
- QueryRequest request;
- ModifiableSolrParams params = new ModifiableSolrParams();
- params.add(Q, query);
- if (fields != null) params.add(FL, fields);
- params.add(SORT, uniqueKey + " asc");
- params.add(CommonParams.DISTRIB, "false");
- params.add(CommonParams.ROWS, "1000");
- String cursorMark = CursorMarkParams.CURSOR_MARK_START;
- Consumer<SolrDocument> wrapper =
- doc -> {
- try {
- queue.offer(doc, 10, TimeUnit.SECONDS);
- receivedDocs.incrementAndGet();
- } catch (InterruptedException e) {
- failed = true;
- runtime.println("Failed to write docs from" + e.getMessage());
- }
- };
- StreamingJavaBinResponseParser responseParser =
- new StreamingJavaBinResponseParser(getStreamer(wrapper));
- while (true) {
- if (failed) return false;
- if (docsWritten.get() > limit) return true;
- params.set(CursorMarkParams.CURSOR_MARK_PARAM, cursorMark);
- request = new QueryRequest(params);
- request.setResponseParser(responseParser);
- try {
- NamedList<Object> rsp = client.request(request, replica.getCoreName());
- String nextCursorMark = (String) rsp.get(CursorMarkParams.CURSOR_MARK_NEXT);
- if (nextCursorMark == null || Objects.equals(cursorMark, nextCursorMark)) {
- runtime.println(
- StrUtils.formatString(
- "\nExport complete from shard {0}, core {1}, docs received: {2}",
- replica.getShard(), replica.getCoreName(), receivedDocs.get()));
- if (expectedDocs != receivedDocs.get()) {
- runtime.println(
- StrUtils.formatString(
- "Could not download all docs from core {0}, docs expected: {1}, received: {2}",
- replica.getCoreName(), expectedDocs, receivedDocs.get()));
- return false;
- }
- return true;
- }
- cursorMark = nextCursorMark;
- runtime.print(".");
- } catch (SolrServerException e) {
- runtime.println(
- "Error reading from server "
- + replica.getBaseUrl()
- + "/"
- + replica.getCoreName());
- failed = true;
- return false;
- }
- }
- }
- }
- }
- }
-
- static long getDocCount(String coreName, SolrClient client, String query)
- throws SolrServerException, IOException {
- SolrQuery q = new SolrQuery(query);
- q.setRows(0);
- q.add("distrib", "false");
- final var request = new QueryRequest(q);
- NamedList<Object> res = client.request(request, coreName);
- SolrDocumentList sdl = (SolrDocumentList) res.get("response");
- return sdl.getNumFound();
- }
-}
(solr) 03/05: New gradle runDev alternative to "dev" (#3816)
Posted by ds...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
dsmiley pushed a commit to branch branch_10_0
in repository https://gitbox.apache.org/repos/asf/solr.git
commit c10d3acec62484534fd593722a493e651f46f068
Author: David Smiley <ds...@apache.org>
AuthorDate: Fri Nov 7 17:40:15 2025 -0500
New gradle runDev alternative to "dev" (#3816)
(cherry picked from commit d6c8095371ed571545ca9a566a237a2a695cfbab)
---
dev-docs/gradle-help/workflow.txt | 11 +++++++----
gradle/help.gradle | 2 +-
solr/packaging/build.gradle | 33 +++++++++++++++++++++++++++++++++
3 files changed, 41 insertions(+), 5 deletions(-)
diff --git a/dev-docs/gradle-help/workflow.txt b/dev-docs/gradle-help/workflow.txt
index a50063334ab..47cde864f53 100644
--- a/dev-docs/gradle-help/workflow.txt
+++ b/dev-docs/gradle-help/workflow.txt
@@ -31,15 +31,18 @@ Put together a local Solr binary "distribution" folder:
gradlew -p solr/packaging assemble
ls solr/packaging/build/solr-* # expanded directory
-For quick local development
-gradlew -p solr/packaging dev
-ls solr/packaging/build/dev # expanded directory
+Build & run Solr directly from Gradle, skipping "bin/solr", retaining data between runs:
+gradlew -p solr/packaging runDev
+
+Build & run Solr, retaining data between runs:
+gradlew -p solr/packaging devSlim
+(cd solr/packaging/build/dev-slim && bin/solr start -f)
Generate the release tar archive (see publishing.txt for details)
gradlew -p solr/distribution assembleRelease
ls solr/distribution/build/release # release archives
-Build a docker image from the local repository (see docker/gradle-help.txt for more)
+Build & run a docker image from the local repository (see docker/gradle-help.txt for more)
gradlew dockerBuild dockerTag
docker run --rm -p 8983:8983 apache/solr:9.0.0-SNAPSHOT
diff --git a/gradle/help.gradle b/gradle/help.gradle
index f17b4067efb..3e3e5f957d8 100644
--- a/gradle/help.gradle
+++ b/gradle/help.gradle
@@ -46,7 +46,7 @@ configure(rootProject) {
doLast {
println ""
println "This is the Solr gradle build. See some guidelines, "
- println "ant-equivalent commands, etc. under help/*; or type:"
+ println "ant-equivalent commands, etc. under dev-docs/gradle-help/*; or type:"
println ""
helpFiles.each { section, path, sectionInfo ->
println String.format(Locale.ROOT,
diff --git a/solr/packaging/build.gradle b/solr/packaging/build.gradle
index feab0004d4a..33fd9197bb3 100644
--- a/solr/packaging/build.gradle
+++ b/solr/packaging/build.gradle
@@ -215,6 +215,39 @@ artifacts {
solrSlimTgz(slimDistTar)
}
+tasks.register('runDev', JavaExec) {
+ group = 'application'
+ description = 'Starts Solr for local experimentation. Does NOT use the bin/solr script.'
+ dependsOn 'devSlim'
+
+ workingDir = file("$slimDevDir/server")
+
+ // Intentionally not synchronizing the logic here with bin/solr; don't want the burden
+
+ doFirst {
+ println "To attach a debugger, at the CLI pass: --debug-jvm"
+ println "To pass JVM args, at the CLI pass: -PjvmArgs='--add-modules jdk.incubator.vector'"
+ println "To pass system properties, at the CLI pass: -Dsolr.port.listen=8983"
+ }
+
+ maxHeapSize = project.findProperty('maxHeapSize') ?: '1G'
+
+ jvmArgs = [] // don't use defaults from our build that assume this is a typical build task
+ jvmArgs((project.findProperty('jvmArgs') ?: '').split())
+
+ systemProperty 'solr.port.listen', '8983'
+ systemProperty 'solr.install.dir', file("$workingDir/..")
+ systemProperty 'solr.logs.dir', file("$workingDir/logs")
+ systemProperty 'solr.zookeeper.server.enabled', 'true' // SolrCloud; embedded ZK
+
+ // Propagate CLI system properties (override defaults above)
+ systemProperties += gradle.startParameter.systemPropertiesArgs
+
+ classpath = files("$workingDir/start.jar")
+
+ args((project.findProperty('args') ?: '--module=http').split())
+}
+
task downloadBats(type: NpmTask) {
group = 'Build Dependency Download'
args = ["install", "https://github.com/bats-core/bats-core#v${libs.versions.bats.core.get()}",