Skip to content
Merged
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
38 changes: 38 additions & 0 deletions clirr-ignores.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,44 @@
<justification>Replacing Datastax Cloud with Scylla Cloud. Removing confusing code that won't be maintained.</justification>
</difference>

<difference>
<differenceType>7002</differenceType> <!-- method removed -->
<className>com/datastax/driver/core/Cluster$Builder</className>
<method>com.datastax.driver.core.Cluster$Builder withScyllaCloudConnectionConfig(java.io.File)</method>
<justification>Serverless was dropped. This code has no use anymore.</justification>
</difference>

<difference>
<differenceType>7002</differenceType> <!-- method removed -->
<className>com/datastax/driver/core/Cluster$Builder</className>
<method>com.datastax.driver.core.Cluster$Builder withScyllaCloudConnectionConfig(java.net.URL)</method>
<justification>Serverless was dropped. This code has no use anymore.</justification>
</difference>

<difference>
<differenceType>7002</differenceType> <!-- method removed -->
<className>com/datastax/driver/core/Cluster$Builder</className>
<method>com.datastax.driver.core.Cluster$Builder withScyllaCloudConnectionConfig(java.io.InputStream)</method>
<justification>Serverless was dropped. This code has no use anymore.</justification>
</difference>

<difference>
<differenceType>7002</differenceType> <!-- method removed -->
<className>com/datastax/driver/core/Cluster$Builder</className>
<method>com.datastax.driver.core.Cluster$Builder withScyllaCloudConnectionConfig(com.datastax.driver.core.ScyllaCloudConnectionConfig)</method>
<justification>Serverless was dropped. This code has no use anymore.</justification>
</difference>

<difference>
<differenceType>7002</differenceType> <!-- method removed -->
<className>com/datastax/driver/core/Host</className>
<method>void setEndPoint(com.datastax.driver.core.EndPoint)</method>
<justification>Originally endPoint field was made non-final to work around serverless limitations.
We're making it final again for clarity. Driver always used to treat the EndPoint as something that
does not change for given Host outside that specific case.
</justification>
</difference>

<difference>
<differenceType>7004</differenceType> <!-- the number of arguments has changed -->
<className>com/datastax/driver/core/Metadata</className>
Expand Down
18 changes: 0 additions & 18 deletions driver-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -176,24 +176,6 @@
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk18on -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk18on</artifactId>
<version>1.82</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcpkix-jdk18on -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk18on</artifactId>
<version>1.82</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcutil-jdk18on -->
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcutil-jdk18on</artifactId>
<version>1.82</version>
</dependency>

<!-- added for easier DNS hostname resolution mocking -->
<dependency>
Expand Down
91 changes: 0 additions & 91 deletions driver-core/src/main/java/com/datastax/driver/core/Cluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,9 @@
import com.google.common.util.concurrent.SettableFuture;
import com.google.common.util.concurrent.Uninterruptibles;
import java.io.Closeable;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.URL;
import java.net.UnknownHostException;
import java.security.GeneralSecurityException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -1384,92 +1379,6 @@ public Builder withNoCompact() {
return this;
}

/**
* Configure for Scylla Cloud Serverless cluster using configuration bundle.
*
* @param configurationFile configuration bundle file.
* @return this builder.
* @throws IOException
* @see Builder#withScyllaCloudConnectionConfig(ScyllaCloudConnectionConfig)
*/
public Builder withScyllaCloudConnectionConfig(File configurationFile) throws IOException {
return withScyllaCloudConnectionConfig(configurationFile.toURI().toURL());
}

/**
* Configure for Scylla Cloud Serverless cluster using URL to configuration bundle.
*
* @param configurationUrl URL from which configuration bundle can be read.
* @return this builder.
* @throws IOException
* @see Builder#withScyllaCloudConnectionConfig(ScyllaCloudConnectionConfig)
*/
public Builder withScyllaCloudConnectionConfig(URL configurationUrl) throws IOException {
return withScyllaCloudConnectionConfig(configurationUrl.openStream());
}

/**
* Configure for Scylla Cloud Serverless cluster using InputStream of configuration bundle.
*
* @param inputStream input stream containing configuration bundle format data.
* @return this builder.
* @throws IOException
* @see Builder#withScyllaCloudConnectionConfig(ScyllaCloudConnectionConfig)
*/
public Builder withScyllaCloudConnectionConfig(InputStream inputStream) throws IOException {
return withScyllaCloudConnectionConfig(
ScyllaCloudConnectionConfig.fromInputStream(inputStream));
}

/**
* Sets a collection of options for connecting to Scylla Cloud Serverless cluster.
*
* <p>Sets several options according to provided {@link ScyllaCloudConnectionConfig}. This
* includes calling {@link Builder#withEndPointFactory(EndPointFactory)}, {@link
* Builder#withSSL(SSLOptions)}, {@link Builder#withAuthProvider(AuthProvider)}, {@link
* Builder#withoutAdvancedShardAwareness()} with parameters derived from the config.
*
* <p>Cannot be combined with {@link Builder#addContactPoint}. All contact points should already
* be provided in {@link ScyllaCloudConnectionConfig}.
*
* @param config instantiated ScyllaCloudConnectionConfig.
* @return this builder.
*/
protected Builder withScyllaCloudConnectionConfig(ScyllaCloudConnectionConfig config) {
try {
ScyllaCloudDatacenter currentDatacenter = config.getCurrentDatacenter();
InetSocketAddress proxyAddress = currentDatacenter.getServer();

Builder builder =
withEndPointFactory(
new ScyllaCloudSniEndPointFactory(
proxyAddress, currentDatacenter.getNodeDomain()))
.withSSL(
(config.getCurrentDatacenter().isInsecureSkipTlsVerify()
? config.createBundle().getInsecureSSLOptions()
: config.createBundle().getSSLOptions()))
.withAuthProvider(
new PlainTextAuthProvider(
config.getCurrentAuthInfo().getUsername(),
config.getCurrentAuthInfo().getPassword()))
.withoutAdvancedShardAwareness();

if (builder.rawHostContactPoints.size() > 0
|| builder.rawHostAndPortContactPoints.size() > 0
|| builder.contactPoints.size() > 0) {
throw new IllegalStateException(
"Can't use withCloudSecureConnectBundle if you've already called addContactPoint(s)");
}
builder.addContactPoint(new SniEndPoint(proxyAddress, currentDatacenter.getNodeDomain()));

return builder;
} catch (IOException e) {
throw new IllegalStateException("Cannot construct cloud config", e);
} catch (GeneralSecurityException e) {
throw new IllegalStateException("Cannot construct cloud config", e);
}
}

/**
* Disables advanced shard awareness. By default, this driver chooses local port while making a
* connection to node, to signal which shard it wants to connect to. This allows driver to
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ enum State {

volatile long maxIdleTime;

EndPoint endPoint;
final EndPoint endPoint;
private final String name;
private volatile Integer shardId = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -680,11 +680,6 @@ private static void updateInfo(
}
host.setHostId(row.getUUID("host_id"));
host.setSchemaVersion(row.getUUID("schema_version"));

EndPoint endPoint = cluster.configuration.getPolicies().getEndPointFactory().create(row);
if (endPoint != null) {
host.setEndPoint(endPoint);
}
}

private static void updateLocationInfo(
Expand Down Expand Up @@ -816,8 +811,6 @@ private void refreshNodeListAndTokenMap(
connection.endPoint);
} else {
updateInfo(controlHost, localRow, cluster, isInitialConnection);
connection.endPoint = controlHost.getEndPoint();

if (metadataEnabled && factory != null) {
Set<String> tokensStr = localRow.getSet("tokens", String.class);
if (!tokensStr.isEmpty()) {
Expand Down
6 changes: 1 addition & 5 deletions driver-core/src/main/java/com/datastax/driver/core/Host.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class Host {
static final Logger statesLogger = LoggerFactory.getLogger(Host.class.getName() + ".STATES");

// The address we'll use to connect to the node
private EndPoint endPoint;
private final EndPoint endPoint;

// The broadcast RPC address, as reported in system tables.
// Note that, unlike previous versions of the driver, this address is NOT TRANSLATED.
Expand Down Expand Up @@ -183,10 +183,6 @@ public EndPoint getEndPoint() {
return endPoint;
}

public void setEndPoint(EndPoint endPoint) {
this.endPoint = endPoint;
}

/**
* Returns the address that the driver will use to connect to the node.
*
Expand Down
32 changes: 0 additions & 32 deletions driver-core/src/main/java/com/datastax/driver/core/Parameters.java

This file was deleted.

Loading