From 65797bf768a3d25ad96165ec9bef968f5bff64f6 Mon Sep 17 00:00:00 2001 From: Yaron Kaikov Date: Thu, 21 Dec 2023 09:59:55 +0200 Subject: [PATCH] Rename getHostText() to getHost() Following the changed made in https://github.com/scylladb/scylla-tools-java/pull/369, dtest is now failing during `test_connectivity_with_cassandra_stress` with the following error: ``` stderr: java.lang.NoSuchMethodError: 'java.lang.String com.google.common.net.HostAndPort.getHostText()' at com.datastax.driver.core.ScyllaCloudDatacenter.getServer(ScyllaCloudDatacenter.java:77) at com.datastax.driver.core.Cluster$Builder.withScyllaCloudConnectionConfig(Cluster.java:1404) at com.datastax.driver.core.Cluster$Builder.withScyllaCloudConnectionConfig(Cluster.java:1397) at com.datastax.driver.core.Cluster$Builder.withScyllaCloudConnectionConfig(Cluster.java:1393) at com.datastax.driver.core.Cluster$Builder.withScyllaCloudConnectionConfig(Cluster.java:1389) at org.apache.cassandra.stress.util.JavaDriverClient.connect(JavaDriverClient.java:181) at org.apache.cassandra.stress.settings.StressSettings.getJavaDriverClient(StressSettings.java:213) at org.apache.cassandra.stress.settings.SettingsSchema.createKeySpacesNative(SettingsSchema.java:84) at org.apache.cassandra.stress.settings.SettingsSchema.createKeySpaces(SettingsSchema.java:74) at org.apache.cassandra.stress.settings.StressSettings.maybeCreateKeyspaces(StressSettings.java:230) at org.apache.cassandra.stress.StressAction.run(StressAction.java:58) at org.apache.cassandra.stress.Stress.run(Stress.java:143) at org.apache.cassandra.stress.Stress.main(Stress.java:62) ``` bump guava version to 32.1.3-jre Since in the the update `Guava` version we started to use `getHostText()` was deprecated and changed to `getHost()` --- .../main/java/com/datastax/driver/core/GuavaCompatibility.java | 2 +- .../java/com/datastax/driver/core/ScyllaCloudDatacenter.java | 2 +- pom.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/driver-core/src/main/java/com/datastax/driver/core/GuavaCompatibility.java b/driver-core/src/main/java/com/datastax/driver/core/GuavaCompatibility.java index 069f550b049..ebcb99b2439 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/GuavaCompatibility.java +++ b/driver-core/src/main/java/com/datastax/driver/core/GuavaCompatibility.java @@ -195,7 +195,7 @@ public String getHost(HostAndPort hostAndPort) { return (String) HostAndPort.class.getMethod("getHost").invoke(hostAndPort); } catch (Exception e) { // Guava < 22.0 - return hostAndPort.getHostText(); + return hostAndPort.getHost(); } } diff --git a/driver-core/src/main/java/com/datastax/driver/core/ScyllaCloudDatacenter.java b/driver-core/src/main/java/com/datastax/driver/core/ScyllaCloudDatacenter.java index 20d76c155bc..a083c30f91e 100644 --- a/driver-core/src/main/java/com/datastax/driver/core/ScyllaCloudDatacenter.java +++ b/driver-core/src/main/java/com/datastax/driver/core/ScyllaCloudDatacenter.java @@ -74,7 +74,7 @@ public byte[] getCertificateAuthorityData() { public InetSocketAddress getServer() { HostAndPort parsedServer = HostAndPort.fromString(server); - return InetSocketAddress.createUnresolved(parsedServer.getHostText(), parsedServer.getPort()); + return InetSocketAddress.createUnresolved(parsedServer.getHost(), parsedServer.getPort()); } public String getNodeDomain() { diff --git a/pom.xml b/pom.xml index 698f23d2bb6..c0a86715abe 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ 1.2.17 1.7.25 1.7.25 - 19.0 + 32.1.3-jre 4.1.100.Final netty-tcnative 2.0.61.Final