Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ decompose = "3.4.0"
diffplug-spotless = "8.3.0"
# @keep Use for dockerfile JRE version
dockerfile-baseimage-java = "25"
dropwizard-metrics = "4.2.33"
eclipse-ecj = "3.39.0"
eclipse-jetty = "12.0.34"
# @keep jgit version used by git-status.gradle
Expand Down Expand Up @@ -240,8 +239,8 @@ amazon-awssdk-s3 = { module = "software.amazon.awssdk:s3", version.ref = "amazon
amazon-awssdk-sdkcore = { module = "software.amazon.awssdk:sdk-core", version.ref = "amazon-awssdk" }
amazon-awssdk-sts = { module = "software.amazon.awssdk:sts", version.ref = "amazon-awssdk" }
androidx-lifecycle-runtimeCompose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidx-lifecycle" }
androidx-lifecycle-viewmodelCompose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" }
androidx-lifecycle-viewModelNav3 = { module = "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-navigation3", version.ref = "androidx-lifecycle" }
androidx-lifecycle-viewmodelCompose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" }
androidx-material3-adaptive = { module = "org.jetbrains.compose.material3.adaptive:adaptive", version.ref = "androidx-adaptive" }
androidx-material3-adaptive-nav3 = { module = "org.jetbrains.compose.material3.adaptive:adaptive-navigation3", version.ref = "androidx-adaptive" }
androidx-navigation3-ui = { module = "org.jetbrains.androidx.navigation3:navigation3-ui", version.ref = "androidx-navigation3" }
Expand Down Expand Up @@ -331,8 +330,6 @@ cuvs-java = { module = "com.nvidia.cuvs:cuvs-java", version.ref = "cuvs-java" }
cuvs-lucene = { module = "com.nvidia.cuvs.lucene:cuvs-lucene", version.ref = "cuvs-lucene" }
decompose-decompose = { module = "com.arkivanov.decompose:decompose", version.ref = "decompose" }
decompose-extensions-compose = { module = "com.arkivanov.decompose:extensions-compose", version.ref = "decompose" }
dropwizard-metrics-core = { module = "io.dropwizard.metrics:metrics-core", version.ref = "dropwizard-metrics" }
dropwizard-metrics-jetty12-ee10 = { module = "io.dropwizard.metrics:metrics-jetty12-ee10", version.ref = "dropwizard-metrics" }
eclipse-jdt-ecj = { module = "org.eclipse.jdt:ecj", version.ref = "eclipse-ecj" }
eclipse-jetty-alpnjavaclient = { module = "org.eclipse.jetty:jetty-alpn-java-client", version.ref = "eclipse-jetty" }
eclipse-jetty-alpnjavaserver = { module = "org.eclipse.jetty:jetty-alpn-java-server", version.ref = "eclipse-jetty" }
Expand Down
5 changes: 1 addition & 4 deletions solr/api/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ com.tdunning:t-digest:3.3=jarValidation,testRuntimeClasspath
commons-cli:commons-cli:1.11.0=jarValidation,testRuntimeClasspath
commons-codec:commons-codec:1.21.0=jarValidation,testRuntimeClasspath
commons-io:commons-io:2.21.0=jarValidation,testCompileClasspath,testRuntimeClasspath
io.dropwizard.metrics:metrics-annotation:4.2.33=jarValidation,testRuntimeClasspath
io.dropwizard.metrics:metrics-core:4.2.33=jarValidation,testRuntimeClasspath
io.dropwizard.metrics:metrics-jetty12-ee10:4.2.33=jarValidation,testRuntimeClasspath
io.dropwizard.metrics:metrics-jetty12:4.2.33=jarValidation,testRuntimeClasspath
io.dropwizard.metrics:metrics-core:3.2.5=jarValidation,testRuntimeClasspath
io.github.classgraph:classgraph:4.8.165=swaggerBuild
io.github.eisop:dataflow-errorprone:3.41.0-eisop1=annotationProcessor,errorprone,testAnnotationProcessor
io.github.java-diff-utils:java-diff-utils:4.12=annotationProcessor,errorprone,testAnnotationProcessor
Expand Down
1 change: 0 additions & 1 deletion solr/benchmark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ dependencies {

implementation libs.apache.lucene.core
implementation libs.commonsio.commonsio
implementation libs.dropwizard.metrics.core
implementation libs.apache.commons.math3
implementation libs.jctools.core
implementation libs.quicktheories.quicktheories
Expand Down
5 changes: 1 addition & 4 deletions solr/benchmark/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ com.tdunning:t-digest:3.3=jarValidation,runtimeClasspath,testRuntimeClasspath
commons-cli:commons-cli:1.11.0=jarValidation,runtimeClasspath,testRuntimeClasspath
commons-codec:commons-codec:1.21.0=jarValidation,runtimeClasspath,testRuntimeClasspath
commons-io:commons-io:2.21.0=compileClasspath,jarValidation,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
io.dropwizard.metrics:metrics-annotation:4.2.33=jarValidation,runtimeClasspath,testRuntimeClasspath
io.dropwizard.metrics:metrics-core:4.2.33=compileClasspath,jarValidation,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
io.dropwizard.metrics:metrics-jetty12-ee10:4.2.33=jarValidation,runtimeClasspath,testRuntimeClasspath
io.dropwizard.metrics:metrics-jetty12:4.2.33=jarValidation,runtimeClasspath,testRuntimeClasspath
io.dropwizard.metrics:metrics-core:3.2.5=jarValidation,runtimeClasspath,testRuntimeClasspath
io.github.eisop:dataflow-errorprone:3.41.0-eisop1=annotationProcessor,errorprone,testAnnotationProcessor
io.github.java-diff-utils:java-diff-utils:4.12=annotationProcessor,errorprone,testAnnotationProcessor
io.netty:netty-buffer:4.2.12.Final=compileClasspath,jarValidation,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
Expand Down
32 changes: 22 additions & 10 deletions solr/benchmark/src/java/org/apache/solr/bench/SolrBenchState.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import static org.apache.commons.io.file.PathUtils.deleteDirectory;
import static org.apache.solr.bench.BaseBenchState.log;

import com.codahale.metrics.Meter;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
Expand All @@ -37,6 +36,7 @@
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicLong;
import org.apache.solr.client.solrj.SolrServerException;
import org.apache.solr.client.solrj.jetty.HttpJettySolrClient;
import org.apache.solr.client.solrj.request.CollectionAdminRequest;
Expand Down Expand Up @@ -396,7 +396,8 @@ public void index(String collection, Docs docs, int docCount, boolean parallel)
@SuppressForbidden(reason = "Benchmarks may use JDK ExecutorService impls")
private void indexParallel(String collection, Docs docs, int docCount)
throws InterruptedException {
Meter meter = new Meter();
AtomicLong meterCount = new AtomicLong();
long meterStartNanos = System.nanoTime();
ExecutorService executorService =
Executors.newFixedThreadPool(
Runtime.getRuntime().availableProcessors(),
Expand All @@ -406,10 +407,12 @@ private void indexParallel(String collection, Docs docs, int docCount)
new SolrNamedThreadFactory("SolrJMH Indexer Progress"));
scheduledExecutor.scheduleAtFixedRate(
() -> {
if (meter.getCount() == docCount) {
long count = meterCount.get();
if (count == docCount) {
scheduledExecutor.shutdown();
} else {
log(meter.getCount() + " docs at " + meter.getMeanRate() + " doc/s");
double rate = count / ((System.nanoTime() - meterStartNanos) / 1e9);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to see something that requires less trust in the time math as a code reviewer... like some JDK API calls to produce a readable equivalent.

log(count + " docs at " + rate + " doc/s");
}
},
10,
Expand All @@ -427,7 +430,7 @@ public void run() {
SolrInputDocument doc = docs.inputDocument();
// log("add doc " + doc);
updateRequest.add(doc);
meter.mark();
meterCount.incrementAndGet();

try {
client.requestWithBaseUrl(url, updateRequest, collection);
Expand All @@ -451,27 +454,36 @@ public void run() {

private void indexBatch(String collection, Docs docs, int docCount, int batchSize)
throws SolrServerException, IOException {
Meter meter = new Meter();
long meterCount = 0;
long meterStartNanos = System.nanoTime();
List<SolrInputDocument> batch = new ArrayList<>(batchSize);
for (int i = 1; i <= docCount; i++) {
batch.add(docs.inputDocument());
if (i % batchSize == 0) {
UpdateRequest updateRequest = new UpdateRequest();
updateRequest.add(batch);
client.requestWithBaseUrl(nodes.get(0), updateRequest, collection);
meter.mark(batch.size());
meterCount += batch.size();
batch.clear();
log(meter.getCount() + " docs at " + (long) meter.getMeanRate() + " doc/s");
log(
meterCount
+ " docs at "
+ (long) (meterCount / ((System.nanoTime() - meterStartNanos) / 1e9))
+ " doc/s");
}
}
if (!batch.isEmpty()) {
UpdateRequest updateRequest = new UpdateRequest();
updateRequest.add(batch);
client.requestWithBaseUrl(nodes.get(0), updateRequest, collection);
meter.mark(batch.size());
meterCount += batch.size();
batch = null;
}
log(meter.getCount() + " docs at " + (long) meter.getMeanRate() + " doc/s");
log(
meterCount
+ " docs at "
+ (long) (meterCount / ((System.nanoTime() - meterStartNanos) / 1e9))
+ " doc/s");
}

/**
Expand Down
3 changes: 0 additions & 3 deletions solr/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ dependencies {
api project(':solr:solrj-zookeeper')
api project(':solr:solrj-streaming')

implementation libs.dropwizard.metrics.core

implementation platform(libs.jersey.bom)
runtimeOnly(libs.jersey.containers.jettyhttp, {
exclude group: "org.eclipse.jetty", module: "jetty-continuation"
Expand Down Expand Up @@ -205,5 +203,4 @@ dependencies {
testImplementation libs.apache.httpcomponents.httpclient

testImplementation libs.opentelemetry.sdk.testing
testImplementation libs.dropwizard.metrics.core
}
5 changes: 1 addition & 4 deletions solr/core/gradle.lockfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ com.tdunning:t-digest:3.3=compileClasspath,jarValidation,runtimeClasspath,runtim
commons-cli:commons-cli:1.11.0=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
commons-codec:commons-codec:1.21.0=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
commons-io:commons-io:2.21.0=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
io.dropwizard.metrics:metrics-annotation:4.2.33=jarValidation,testRuntimeClasspath
io.dropwizard.metrics:metrics-core:4.2.33=compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
io.dropwizard.metrics:metrics-jetty12-ee10:4.2.33=jarValidation,testRuntimeClasspath
io.dropwizard.metrics:metrics-jetty12:4.2.33=jarValidation,testRuntimeClasspath
io.dropwizard.metrics:metrics-core:3.2.5=jarValidation,testCompileClasspath,testRuntimeClasspath
io.github.eisop:dataflow-errorprone:3.41.0-eisop1=annotationProcessor,errorprone,testAnnotationProcessor
io.github.java-diff-utils:java-diff-utils:4.12=annotationProcessor,errorprone,testAnnotationProcessor
io.netty:netty-buffer:4.2.12.Final=apiHelper,compileClasspath,jarValidation,runtimeClasspath,runtimeLibs,testCompileClasspath,testRuntimeClasspath
Expand Down
6 changes: 0 additions & 6 deletions solr/core/src/java/org/apache/solr/cloud/Overseer.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import static org.apache.solr.common.params.CommonParams.ID;

import com.codahale.metrics.Timer;
import io.opentelemetry.api.common.Attributes;
import java.io.Closeable;
import java.io.IOException;
Expand Down Expand Up @@ -427,7 +426,6 @@ private ClusterState processQueueItem(
"Message missing " + QUEUE_OPERATION + ":" + message);
}
List<ZkWriteCommand> zkWriteCommands = null;
final Timer.Context timerContext = stats.time(operation);
try {
zkWriteCommands = processMessage(clusterState, message, operation);
stats.success(operation);
Expand All @@ -442,8 +440,6 @@ private ClusterState processQueueItem(
message,
e);
stats.error(operation);
} finally {
timerContext.stop();
}
if (zkWriteCommands != null) {
clusterState = zkStateWriter.enqueueUpdate(clusterState, zkWriteCommands, callback);
Expand Down Expand Up @@ -594,7 +590,6 @@ private List<ZkWriteCommand> processMessage(
}

private LeaderStatus amILeader() {
Timer.Context timerContext = stats.time("am_i_leader");
boolean success = true;
String propsId = null;
try {
Expand Down Expand Up @@ -623,7 +618,6 @@ private LeaderStatus amILeader() {
success = false;
log.warn("Unexpected exception", e);
} finally {
timerContext.stop();
if (success) {
stats.success("am_i_leader");
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import static org.apache.solr.common.params.CommonAdminParams.ASYNC;
import static org.apache.solr.common.params.CommonParams.ID;

import com.codahale.metrics.Timer;
import io.opentelemetry.api.common.Attributes;
import java.io.Closeable;
import java.lang.invoke.MethodHandles;
Expand Down Expand Up @@ -497,7 +496,6 @@ public static String getLeaderId(SolrZkClient zkClient)

protected LeaderStatus amILeader() {
String statsName = "collection_am_i_leader";
Timer.Context timerContext = stats.time(statsName);
boolean success = true;
String propsId = null;
try {
Expand All @@ -524,7 +522,6 @@ protected LeaderStatus amILeader() {
success = false;
Thread.currentThread().interrupt();
} finally {
timerContext.stop();
if (success) {
stats.success(statsName);
} else {
Expand Down Expand Up @@ -577,7 +574,6 @@ public Runner(
@Override
public void run() {
String statsName = messageHandler.getTimerName(operation);
final Timer.Context timerContext = stats.time(statsName);

boolean success = false;
final String asyncId = message.getStr(ASYNC);
Expand All @@ -590,7 +586,6 @@ public void run() {
}
response = messageHandler.processMessage(message, operation, lock);
} finally {
timerContext.stop();
updateStats(statsName);
}

Expand Down
57 changes: 20 additions & 37 deletions solr/core/src/java/org/apache/solr/cloud/OverseerTaskQueue.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
package org.apache.solr.cloud;

import com.codahale.metrics.Timer;
import java.lang.invoke.MethodHandles;
import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -114,32 +113,26 @@ public boolean containsTaskWithRequestId(String requestIdKey, String requestId)
*/
public void remove(QueueEvent event, boolean setResult)
throws KeeperException, InterruptedException {
Timer.Context time = stats.time(dir + "_remove_event");
try {
String path = event.getId();
String path = event.getId();

// Set response data in the response node
if (setResult) {
String responsePath =
dir + "/" + RESPONSE_PREFIX + path.substring(path.lastIndexOf('-') + 1);
// Set response data in the response node
if (setResult) {
String responsePath = dir + "/" + RESPONSE_PREFIX + path.substring(path.lastIndexOf('-') + 1);

try {
zookeeper.setData(responsePath, event.getBytes());
} catch (KeeperException.NoNodeException ignored) {
// we must handle the race case where the node no longer exists
log.info(
"Response ZK path: {} doesn't exist. Requestor may have disconnected from ZooKeeper",
responsePath);
}
}

// Remove the request node
try {
zookeeper.delete(path, -1);
zookeeper.setData(responsePath, event.getBytes());
} catch (KeeperException.NoNodeException ignored) {
// we must handle the race case where the node no longer exists
log.info(
"Response ZK path: {} doesn't exist. Requestor may have disconnected from ZooKeeper",
responsePath);
}
} finally {
time.stop();
}

// Remove the request node
try {
zookeeper.delete(path, -1);
} catch (KeeperException.NoNodeException ignored) {
}
}

Expand Down Expand Up @@ -232,7 +225,6 @@ public QueueEvent offer(byte[] data, long timeout) throws KeeperException, Inter
SolrException.ErrorCode.CONFLICT,
"Solr is shutting down, no more overseer tasks may be offered");
}
Timer.Context time = stats.time(dir + "_offer");
try {
// Create and watch the response node before creating the request node;
// otherwise we may miss the response.
Expand All @@ -255,7 +247,6 @@ public QueueEvent offer(byte[] data, long timeout) throws KeeperException, Inter
zookeeper.delete(watchID, -1);
return event;
} finally {
time.stop();
pendingResponses.decrementAndGet();
}
}
Expand All @@ -276,20 +267,12 @@ public List<QueueEvent> peekTopN(int n, Predicate<String> excludeSet, long waitM
ArrayList<QueueEvent> topN = new ArrayList<>();

log.debug("Peeking for top {} elements. ExcludeSet: {}", n, excludeSet);
Timer.Context time;
if (waitMillis == Long.MAX_VALUE) time = stats.time(dir + "_peekTopN_wait_forever");
else time = stats.time(dir + "_peekTopN_wait" + waitMillis);

try {
for (Pair<String, byte[]> element :
peekElements(n, waitMillis, child -> !excludeSet.test(dir + "/" + child))) {
topN.add(new QueueEvent(dir + "/" + element.first(), element.second(), null));
}
printQueueEventsListElementIds(topN);
return topN;
} finally {
time.stop();
for (Pair<String, byte[]> element :
peekElements(n, waitMillis, child -> !excludeSet.test(dir + "/" + child))) {
topN.add(new QueueEvent(dir + "/" + element.first(), element.second(), null));
}
printQueueEventsListElementIds(topN);
return topN;
}

private static void printQueueEventsListElementIds(ArrayList<QueueEvent> topN) {
Expand Down
Loading
Loading