Skip to content

Commit

Permalink
Rename getHostText() to getHost()
Browse files Browse the repository at this point in the history
Following the changed made in
scylladb/scylla-tools-java#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()`
  • Loading branch information
yaronkaikov committed Dec 21, 2023
1 parent 51ff0d5 commit 65797bf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<log4j.version>1.2.17</log4j.version>
<slf4j.version>1.7.25</slf4j.version>
<slf4j-log4j12.version>1.7.25</slf4j-log4j12.version>
<guava.version>19.0</guava.version>
<guava.version>32.1.3-jre</guava.version>
<netty.version>4.1.100.Final</netty.version>
<netty-tcnative.artifact>netty-tcnative</netty-tcnative.artifact>
<netty-tcnative.version>2.0.61.Final</netty-tcnative.version>
Expand Down

0 comments on commit 65797bf

Please sign in to comment.