Skip to content

Commit

Permalink
Update dependencies (#693)
Browse files Browse the repository at this point in the history
* Update most dependencies

* USe the latest working versions for grpc and protobuf

* Add check for symlink when calculating directory size

* Fix metrics test

* Remove property

* Revert grpc and protobuf versions bumps in example-plugin
  • Loading branch information
sarthakn7 authored Aug 20, 2024
1 parent f79dc0a commit a7f3dee
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 35 deletions.
40 changes: 20 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,23 @@ def _artifactId = 'server'
System.setProperty("org.gradle.internal.publish.checksums.insecure", "True")

def luceneVersion = '9.11.1'
project.ext.slf4jVersion = '2.0.0-alpha1'
project.ext.grpcVersion = '1.46.0'
project.ext.lz4Version = '1.7.0'
project.ext.slf4jVersion = '2.0.16'
project.ext.grpcVersion = '1.60.2'
project.ext.lz4Version = '1.8.0'
project.ext.mockitoVersion = '5.12.0'
project.ext.jacksonYamlVersion = '2.15.0'
project.ext.jacksonYamlVersion = '2.17.2'
project.ext.junitVersion = '4.13.2'
def log4jVersion = '2.18.0'
def disruptorVersion = '3.2.1'
def gsonVersion = '2.9.0'
def snakeYamlVersion = '2.0'
def spatial4jVersion = '0.7'
def log4jVersion = '2.23.1'
def disruptorVersion = '4.0.0'
def gsonVersion = '2.11.0'
def snakeYamlVersion = '2.2'
def spatial4jVersion = '0.8'
def s3mockVersion = '0.2.6'
def commonsCompressVersion = '1.21'
def awsJavaSdkVersion = '1.12.457'
def commonsCompressVersion = '1.27.0'
def awsJavaSdkVersion = '1.12.768'
def guiceVersion = '7.0.0'
def prometheusClientVersion = '0.8.0'
def fastutilVersion = '8.5.6'
def prometheusClientVersion = '0.16.0'
def fastutilVersion = '8.5.14'

dependencies {

Expand All @@ -63,20 +63,20 @@ dependencies {

//logging deps
implementation "org.slf4j:slf4j-api:${project.ext.slf4jVersion}"
implementation "org.apache.logging.log4j:log4j-slf4j18-impl:${log4jVersion}"
implementation "org.apache.logging.log4j:log4j-slf4j2-impl:${log4jVersion}"
implementation "org.apache.logging.log4j:log4j-api:${log4jVersion}"
implementation "org.apache.logging.log4j:log4j-core:${log4jVersion}"
implementation "com.lmax:disruptor:${disruptorVersion}"


implementation "com.google.code.gson:gson:${gsonVersion}"
implementation 'commons-io:commons-io:2.7'
implementation 'commons-io:commons-io:2.16.1'
implementation "org.yaml:snakeyaml:${snakeYamlVersion}"
implementation "org.apache.commons:commons-compress:${commonsCompressVersion}"
implementation "com.amazonaws:aws-java-sdk-core:${awsJavaSdkVersion}"
implementation "com.amazonaws:aws-java-sdk-s3:${awsJavaSdkVersion}"
runtimeOnly "com.amazonaws:aws-java-sdk-sts:${awsJavaSdkVersion}"
implementation "javax.xml.bind:jaxb-api:2.3.1"
implementation "jakarta.xml.bind:jakarta.xml.bind-api:4.0.2"
implementation "com.google.inject:guice:${guiceVersion}"
implementation "org.lz4:lz4-java:${project.ext.lz4Version}"
implementation "com.fasterxml.jackson.core:jackson-databind:${project.ext.jacksonYamlVersion}"
Expand All @@ -100,8 +100,8 @@ dependencies {
implementation "org.apache.lucene:lucene-join:${luceneVersion}"

//cli deps
implementation 'info.picocli:picocli:4.0.4'
implementation 'org.apache.commons:commons-csv:1.7'
implementation 'info.picocli:picocli:4.7.6'
implementation 'org.apache.commons:commons-csv:1.11.0'

// gRPC deps
implementation "io.grpc:grpc-services:${project.ext.grpcVersion}"
Expand All @@ -113,9 +113,9 @@ dependencies {
testImplementation "org.mockito:mockito-core:${project.ext.mockitoVersion}"
testImplementation "org.apache.lucene:lucene-test-framework:${luceneVersion}"
testImplementation "org.locationtech.spatial4j:spatial4j:${spatial4jVersion}"
testImplementation "io.findify:s3mock_2.12:${s3mockVersion}"
testImplementation "io.findify:s3mock_2.13:${s3mockVersion}"

testImplementation "org.assertj:assertj-core:3.19.0"
testImplementation "org.assertj:assertj-core:3.26.3"

api project(':clientlib')
}
Expand Down
2 changes: 1 addition & 1 deletion clientlib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ startScripts.enabled = false
def _artifactId = 'clientlib'

// Dependency versions
def protobufVersion = '3.24.3'
def protobufVersion = '3.25.1'
def protocVersion = protobufVersion

dependencies {
Expand Down
2 changes: 1 addition & 1 deletion example-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ repositories {
}

ext {
assertjVersion = '3.19.0'
assertjVersion = '3.26.3'
grpcVersion = "1.46.0"
junitVersion = "4.13.2"
nrtsearchVersion = "1.+"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
import com.yelp.nrtsearch.server.luceneserver.GlobalState;
import io.prometheus.client.Collector;
import io.prometheus.client.GaugeMetricFamily;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.file.PathUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -55,9 +55,11 @@ public List<MetricFamilySamples> collect() {
Set<String> indexNames = globalState.getIndexNames();
for (String indexName : indexNames) {
Path indexDataPath = globalState.getIndexDir(indexName);
File indexDataFile = indexDataPath.toFile();
if (indexDataFile.exists()) {
long dirSizeBytes = FileUtils.sizeOfDirectory(indexDataFile);
if (Files.exists(indexDataPath)) {
if (Files.isSymbolicLink(indexDataPath)) {
indexDataPath = Files.readSymbolicLink(indexDataPath);
}
long dirSizeBytes = PathUtils.sizeOfDirectory(indexDataPath);
indexDirSize.addMetric(Collections.singletonList(indexName), (double) dirSizeBytes);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ class ServerMetrics {
Counter.build()
.namespace("grpc")
.subsystem("server")
.name("started_total")
.name("started")
.labelNames("grpc_type", "grpc_service", "grpc_method", "serviceName", "nodeName")
.help("Total number of RPCs started on the server.");

private static final Counter.Builder serverHandledBuilder =
Counter.build()
.namespace("grpc")
.subsystem("server")
.name("handled_total")
.name("handled")
.labelNames("grpc_type", "grpc_service", "grpc_method", "serviceName", "nodeName", "code")
.help("Total number of RPCs completed on the server, regardless of success or failure.");

Expand All @@ -63,15 +63,15 @@ class ServerMetrics {
Counter.build()
.namespace("grpc")
.subsystem("server")
.name("msg_received_total")
.name("msg_received")
.labelNames("grpc_type", "grpc_service", "grpc_method", "serviceName", "nodeName")
.help("Total number of stream messages received from the client.");

private static final Counter.Builder serverStreamMessagesSentBuilder =
Counter.build()
.namespace("grpc")
.subsystem("server")
.name("msg_sent_total")
.name("msg_sent")
.labelNames("grpc_type", "grpc_service", "grpc_method", "serviceName", "nodeName")
.help("Total number of stream messages sent by the server.");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1000,11 +1000,12 @@ public void testMetrics() {
HashSet expectedSampleNames =
new HashSet(
Arrays.asList(
"grpc_server_started_total",
"grpc_server_handled_total",
"grpc_server_msg_received_total",
"grpc_server_msg_sent_total",
"grpc_server_handled_latency_seconds"));
"grpc_server_handled_latency_seconds",
"grpc_server_handled_total",
"grpc_server_started_total",
"grpc_server_started_created",
"grpc_server_msg_sent_total"));
assertEquals("text/plain", response.getContentType());
String data = new String(response.getData().toByteArray());
String[] arr = data.split("\n");
Expand Down

0 comments on commit a7f3dee

Please sign in to comment.