diff --git a/core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java b/core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java
index dd60a2487fb..375d61a7982 100644
--- a/core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java
+++ b/core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java
@@ -869,14 +869,6 @@ public enum DefaultDriverOption implements DriverOption {
*/
NETTY_DAEMON("advanced.netty.daemon"),
- /**
- * The location of the cloud secure bundle used to connect to DataStax Apache Cassandra as a
- * service.
- *
- * Value-type: {@link String}
- */
- CLOUD_SECURE_CONNECT_BUNDLE("basic.cloud.secure-connect-bundle"),
-
/**
* Whether the slow replica avoidance should be enabled in the default LBP.
*
diff --git a/core/src/main/java/com/datastax/oss/driver/api/core/config/TypedDriverOption.java b/core/src/main/java/com/datastax/oss/driver/api/core/config/TypedDriverOption.java
index af93e734ef1..7c9085270ed 100644
--- a/core/src/main/java/com/datastax/oss/driver/api/core/config/TypedDriverOption.java
+++ b/core/src/main/java/com/datastax/oss/driver/api/core/config/TypedDriverOption.java
@@ -685,12 +685,6 @@ public String toString() {
/** Whether the threads created by the driver should be daemon threads. */
public static final TypedDriverOption NETTY_DAEMON =
new TypedDriverOption<>(DefaultDriverOption.NETTY_DAEMON, GenericType.BOOLEAN);
- /**
- * The location of the cloud secure bundle used to connect to DataStax Apache Cassandra as a
- * service.
- */
- public static final TypedDriverOption CLOUD_SECURE_CONNECT_BUNDLE =
- new TypedDriverOption<>(DefaultDriverOption.CLOUD_SECURE_CONNECT_BUNDLE, GenericType.STRING);
/** Whether the slow replica avoidance should be enabled in the default LBP. */
public static final TypedDriverOption LOAD_BALANCING_POLICY_SLOW_AVOIDANCE =
new TypedDriverOption<>(
diff --git a/core/src/main/java/com/datastax/oss/driver/api/core/session/ProgrammaticArguments.java b/core/src/main/java/com/datastax/oss/driver/api/core/session/ProgrammaticArguments.java
index 4db44655dc2..d70bf780593 100644
--- a/core/src/main/java/com/datastax/oss/driver/api/core/session/ProgrammaticArguments.java
+++ b/core/src/main/java/com/datastax/oss/driver/api/core/session/ProgrammaticArguments.java
@@ -36,7 +36,6 @@
import com.datastax.oss.driver.shaded.guava.common.collect.ImmutableMap;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
-import java.net.InetSocketAddress;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@@ -68,7 +67,6 @@ public static Builder builder() {
private final ClassLoader classLoader;
private final AuthProvider authProvider;
private final SslEngineFactory sslEngineFactory;
- private final InetSocketAddress cloudProxyAddress;
private final UUID startupClientId;
private final String startupApplicationName;
private final String startupApplicationVersion;
@@ -88,7 +86,6 @@ private ProgrammaticArguments(
@Nullable ClassLoader classLoader,
@Nullable AuthProvider authProvider,
@Nullable SslEngineFactory sslEngineFactory,
- @Nullable InetSocketAddress cloudProxyAddress,
@Nullable UUID startupClientId,
@Nullable String startupApplicationName,
@Nullable String startupApplicationVersion,
@@ -107,7 +104,6 @@ private ProgrammaticArguments(
this.classLoader = classLoader;
this.authProvider = authProvider;
this.sslEngineFactory = sslEngineFactory;
- this.cloudProxyAddress = cloudProxyAddress;
this.startupClientId = startupClientId;
this.startupApplicationName = startupApplicationName;
this.startupApplicationVersion = startupApplicationVersion;
@@ -173,11 +169,6 @@ public SslEngineFactory getSslEngineFactory() {
return sslEngineFactory;
}
- @Nullable
- public InetSocketAddress getCloudProxyAddress() {
- return cloudProxyAddress;
- }
-
@Nullable
public UUID getStartupClientId() {
return startupClientId;
@@ -223,7 +214,6 @@ public static class Builder {
private ClassLoader classLoader;
private AuthProvider authProvider;
private SslEngineFactory sslEngineFactory;
- private InetSocketAddress cloudProxyAddress;
private UUID startupClientId;
private String startupApplicationName;
private String startupApplicationVersion;
@@ -388,12 +378,6 @@ public Builder withClassLoader(@Nullable ClassLoader classLoader) {
return this;
}
- @NonNull
- public Builder withCloudProxyAddress(@Nullable InetSocketAddress cloudAddress) {
- this.cloudProxyAddress = cloudAddress;
- return this;
- }
-
@NonNull
public Builder withAuthProvider(@Nullable AuthProvider authProvider) {
this.authProvider = authProvider;
@@ -456,7 +440,6 @@ public ProgrammaticArguments build() {
classLoader,
authProvider,
sslEngineFactory,
- cloudProxyAddress,
startupClientId,
startupApplicationName,
startupApplicationVersion,
diff --git a/core/src/main/java/com/datastax/oss/driver/api/core/session/SessionBuilder.java b/core/src/main/java/com/datastax/oss/driver/api/core/session/SessionBuilder.java
index 8375f0ef30b..77c17fc7b41 100644
--- a/core/src/main/java/com/datastax/oss/driver/api/core/session/SessionBuilder.java
+++ b/core/src/main/java/com/datastax/oss/driver/api/core/session/SessionBuilder.java
@@ -30,7 +30,6 @@
import com.datastax.oss.driver.api.core.auth.ProgrammaticPlainTextAuthProvider;
import com.datastax.oss.driver.api.core.config.ClientRoutesConfig;
import com.datastax.oss.driver.api.core.config.DefaultDriverOption;
-import com.datastax.oss.driver.api.core.config.DriverConfig;
import com.datastax.oss.driver.api.core.config.DriverConfigLoader;
import com.datastax.oss.driver.api.core.config.DriverExecutionProfile;
import com.datastax.oss.driver.api.core.context.DriverContext;
@@ -48,24 +47,16 @@
import com.datastax.oss.driver.api.core.type.codec.registry.MutableCodecRegistry;
import com.datastax.oss.driver.api.core.uuid.Uuids;
import com.datastax.oss.driver.internal.core.ContactPoints;
-import com.datastax.oss.driver.internal.core.config.cloud.CloudConfig;
-import com.datastax.oss.driver.internal.core.config.cloud.CloudConfigFactory;
import com.datastax.oss.driver.internal.core.config.typesafe.DefaultDriverConfigLoader;
import com.datastax.oss.driver.internal.core.context.DefaultDriverContext;
import com.datastax.oss.driver.internal.core.context.InternalDriverContext;
import com.datastax.oss.driver.internal.core.metadata.DefaultEndPoint;
import com.datastax.oss.driver.internal.core.session.DefaultSession;
-import com.datastax.oss.driver.internal.core.tracker.W3CContextRequestIdGenerator;
import com.datastax.oss.driver.internal.core.util.concurrent.BlockingOperation;
import com.datastax.oss.driver.internal.core.util.concurrent.CompletableFutures;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.Nullable;
-import java.io.InputStream;
import java.net.InetSocketAddress;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.nio.file.Path;
-import java.nio.file.Paths;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
@@ -73,7 +64,6 @@
import java.util.Map;
import java.util.Set;
import java.util.UUID;
-import java.util.concurrent.Callable;
import java.util.concurrent.CompletionStage;
import java.util.function.Predicate;
import javax.net.ssl.SSLContext;
@@ -92,8 +82,6 @@
@NotThreadSafe
public abstract class SessionBuilder {
- public static final String ASTRA_PAYLOAD_KEY = "traceparent";
-
private static final Logger LOG = LoggerFactory.getLogger(SessionBuilder.class);
@SuppressWarnings("unchecked")
@@ -102,11 +90,8 @@ public abstract class SessionBuilder {
protected DriverConfigLoader configLoader;
protected Set programmaticContactPoints = new HashSet<>();
protected CqlIdentifier keyspace;
- protected Callable cloudConfigInputStream;
protected ProgrammaticArguments.Builder programmaticArgumentsBuilder =
ProgrammaticArguments.builder();
- private boolean programmaticSslFactory = false;
- private boolean programmaticLocalDatacenter = false;
/**
* Sets the configuration loader to use.
@@ -427,7 +412,6 @@ public SelfT withCredentials(
*/
@NonNull
public SelfT withSslEngineFactory(@Nullable SslEngineFactory sslEngineFactory) {
- this.programmaticSslFactory = true;
this.programmaticArgumentsBuilder.withSslEngineFactory(sslEngineFactory);
return self;
}
@@ -465,7 +449,6 @@ public SelfT withSslContext(@Nullable SSLContext sslContext) {
* if you use a third-party implementation, refer to their documentation.
*/
public SelfT withLocalDatacenter(@NonNull String profileName, @NonNull String localDatacenter) {
- this.programmaticLocalDatacenter = true;
this.programmaticArgumentsBuilder.withLocalDatacenter(profileName, localDatacenter);
return self;
}
@@ -647,31 +630,6 @@ public SelfT withClassLoader(@Nullable ClassLoader classLoader) {
return self;
}
- /**
- * Configures this SessionBuilder for Cloud deployments by retrieving connection information from
- * the provided {@link Path}.
- *
- * To connect to a Cloud database, you must first download the secure database bundle from the
- * DataStax Astra console that contains the connection information, then instruct the driver to
- * read its contents using either this method or one if its variants.
- *
- *
For more information, please refer to the DataStax Astra documentation.
- *
- * @param cloudConfigPath Path to the secure connect bundle zip file.
- * @see #withCloudSecureConnectBundle(URL)
- * @see #withCloudSecureConnectBundle(InputStream)
- */
- @NonNull
- public SelfT withCloudSecureConnectBundle(@NonNull Path cloudConfigPath) {
- try {
- URL cloudConfigUrl = cloudConfigPath.toAbsolutePath().normalize().toUri().toURL();
- this.cloudConfigInputStream = cloudConfigUrl::openStream;
- } catch (MalformedURLException e) {
- throw new IllegalArgumentException("Incorrect format of cloudConfigPath", e);
- }
- return self;
- }
-
/**
* Registers a CodecRegistry to use for the session.
*
@@ -684,72 +642,6 @@ public SelfT withCodecRegistry(@Nullable MutableCodecRegistry codecRegistry) {
return self;
}
- /**
- * Configures this SessionBuilder for Cloud deployments by retrieving connection information from
- * the provided {@link URL}.
- *
- *
To connect to a Cloud database, you must first download the secure database bundle from the
- * DataStax Astra console that contains the connection information, then instruct the driver to
- * read its contents using either this method or one if its variants.
- *
- *
For more information, please refer to the DataStax Astra documentation.
- *
- * @param cloudConfigUrl URL to the secure connect bundle zip file.
- * @see #withCloudSecureConnectBundle(Path)
- * @see #withCloudSecureConnectBundle(InputStream)
- */
- @NonNull
- public SelfT withCloudSecureConnectBundle(@NonNull URL cloudConfigUrl) {
- this.cloudConfigInputStream = cloudConfigUrl::openStream;
- return self;
- }
-
- /**
- * Configures this SessionBuilder for Cloud deployments by retrieving connection information from
- * the provided {@link InputStream}.
- *
- *
To connect to a Cloud database, you must first download the secure database bundle from the
- * DataStax Astra console that contains the connection information, then instruct the driver to
- * read its contents using either this method or one if its variants.
- *
- *
For more information, please refer to the DataStax Astra documentation.
- *
- *
Note that the provided stream will be consumed and closed when either {@link
- * #build()} or {@link #buildAsync()} are called; attempting to reuse it afterwards will result in
- * an error being thrown.
- *
- * @param cloudConfigInputStream A stream containing the secure connect bundle zip file.
- * @see #withCloudSecureConnectBundle(Path)
- * @see #withCloudSecureConnectBundle(URL)
- */
- @NonNull
- public SelfT withCloudSecureConnectBundle(@NonNull InputStream cloudConfigInputStream) {
- this.cloudConfigInputStream = () -> cloudConfigInputStream;
- return self;
- }
-
- /**
- * Configures this SessionBuilder to use the provided Cloud proxy endpoint.
- *
- *
Normally, this method should not be called directly; the normal and easiest way to configure
- * the driver for Cloud deployments is through a {@linkplain #withCloudSecureConnectBundle(URL)
- * secure connect bundle}.
- *
- *
Setting this option to any non-null address will make the driver use a special topology
- * monitor tailored for Cloud deployments. This topology monitor assumes that the target cluster
- * should be contacted through the proxy specified here, using SNI routing.
- *
- *
For more information, please refer to the DataStax Astra documentation.
- *
- * @param cloudProxyAddress The address of the Cloud proxy to use.
- * @see Server Name Indication
- */
- @NonNull
- public SelfT withCloudProxyAddress(@Nullable InetSocketAddress cloudProxyAddress) {
- this.programmaticArgumentsBuilder.withCloudProxyAddress(cloudProxyAddress);
- return self;
- }
-
/**
* Configures this session to use client routes for cloud private-endpoint deployments.
*
@@ -910,52 +802,8 @@ protected final CompletionStage buildDefaultSessionAsync() {
: defaultConfigLoader(programmaticArguments.getClassLoader());
DriverExecutionProfile defaultConfig = configLoader.getInitialConfig().getDefaultProfile();
- if (cloudConfigInputStream == null) {
- String configUrlString =
- defaultConfig.getString(DefaultDriverOption.CLOUD_SECURE_CONNECT_BUNDLE, null);
- if (configUrlString != null) {
- cloudConfigInputStream = () -> getURL(configUrlString).openStream();
- }
- }
List configContactPoints =
defaultConfig.getStringList(DefaultDriverOption.CONTACT_POINTS, Collections.emptyList());
- if (cloudConfigInputStream != null) {
- // override request id generator, unless user has already set it
- if (programmaticArguments.getRequestIdGenerator() == null) {
- programmaticArgumentsBuilder.withRequestIdGenerator(
- new W3CContextRequestIdGenerator(ASTRA_PAYLOAD_KEY));
- LOG.debug(
- "A secure connect bundle is provided, using W3CContextRequestIdGenerator as request ID generator.");
- }
- if (!programmaticContactPoints.isEmpty() || !configContactPoints.isEmpty()) {
- LOG.info(
- "Both a secure connect bundle and contact points were provided. These are mutually exclusive. The contact points from the secure bundle will have priority.");
- // clear the contact points provided in the setting file and via addContactPoints
- configContactPoints = Collections.emptyList();
- programmaticContactPoints = new HashSet<>();
- }
-
- if (programmaticSslFactory
- || defaultConfig.isDefined(DefaultDriverOption.SSL_ENGINE_FACTORY_CLASS)) {
- LOG.info(
- "Both a secure connect bundle and SSL options were provided. They are mutually exclusive. The SSL options from the secure bundle will have priority.");
- }
- CloudConfig cloudConfig =
- new CloudConfigFactory().createCloudConfig(cloudConfigInputStream.call());
- addContactEndPoints(cloudConfig.getEndPoints());
-
- boolean localDataCenterDefined =
- anyProfileHasDatacenterDefined(configLoader.getInitialConfig());
- if (programmaticLocalDatacenter || localDataCenterDefined) {
- LOG.info(
- "Both a secure connect bundle and a local datacenter were provided. They are mutually exclusive. The local datacenter from the secure bundle will have priority.");
- programmaticArgumentsBuilder.clearDatacenters();
- }
- withLocalDatacenter(cloudConfig.getLocalDatacenter());
- withSslEngineFactory(cloudConfig.getSslEngineFactory());
- withCloudProxyAddress(cloudConfig.getProxyAddress());
- programmaticArguments = programmaticArgumentsBuilder.build();
- }
boolean resolveAddresses =
defaultConfig.getBoolean(DefaultDriverOption.RESOLVE_CONTACT_POINTS, false);
@@ -980,36 +828,6 @@ protected final CompletionStage buildDefaultSessionAsync() {
}
}
- private boolean anyProfileHasDatacenterDefined(DriverConfig driverConfig) {
- for (DriverExecutionProfile driverExecutionProfile : driverConfig.getProfiles().values()) {
- if (driverExecutionProfile.isDefined(DefaultDriverOption.LOAD_BALANCING_LOCAL_DATACENTER)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Returns URL based on the configUrl setting. If the configUrl has no protocol provided, the
- * method will fallback to file:// protocol and return URL that has file protocol specified.
- *
- * @param configUrl url to config secure bundle
- * @return URL with file protocol if there was not explicit protocol provided in the configUrl
- * setting
- */
- private URL getURL(String configUrl) throws MalformedURLException {
- try {
- return new URL(configUrl);
- } catch (MalformedURLException e1) {
- try {
- return Paths.get(configUrl).toAbsolutePath().normalize().toUri().toURL();
- } catch (MalformedURLException e2) {
- e2.addSuppressed(e1);
- throw e2;
- }
- }
- }
-
/**
* This must return an instance of {@code InternalDriverContext} (it's not expressed
* directly in the signature to avoid leaking that type through the protected API).
diff --git a/core/src/main/java/com/datastax/oss/driver/internal/core/channel/ChannelFactory.java b/core/src/main/java/com/datastax/oss/driver/internal/core/channel/ChannelFactory.java
index 35190afa3f4..75e81b2475e 100644
--- a/core/src/main/java/com/datastax/oss/driver/internal/core/channel/ChannelFactory.java
+++ b/core/src/main/java/com/datastax/oss/driver/internal/core/channel/ChannelFactory.java
@@ -23,11 +23,9 @@
*/
package com.datastax.oss.driver.internal.core.channel;
-import com.datastax.oss.driver.api.core.ConsistencyLevel;
import com.datastax.oss.driver.api.core.ProtocolVersion;
import com.datastax.oss.driver.api.core.UnsupportedProtocolVersionException;
import com.datastax.oss.driver.api.core.config.DefaultDriverOption;
-import com.datastax.oss.driver.api.core.config.DriverConfig;
import com.datastax.oss.driver.api.core.config.DriverExecutionProfile;
import com.datastax.oss.driver.api.core.context.DriverContext;
import com.datastax.oss.driver.api.core.metadata.EndPoint;
@@ -35,7 +33,6 @@
import com.datastax.oss.driver.api.core.metadata.NodeShardingInfo;
import com.datastax.oss.driver.api.core.metrics.DefaultNodeMetric;
import com.datastax.oss.driver.api.core.metrics.DefaultSessionMetric;
-import com.datastax.oss.driver.internal.core.config.typesafe.TypesafeDriverConfig;
import com.datastax.oss.driver.internal.core.context.InternalDriverContext;
import com.datastax.oss.driver.internal.core.context.NettyOptions;
import com.datastax.oss.driver.internal.core.metadata.DefaultNode;
@@ -46,7 +43,6 @@
import com.datastax.oss.driver.internal.core.protocol.FrameEncoder;
import com.datastax.oss.driver.shaded.guava.common.annotations.VisibleForTesting;
import com.datastax.oss.driver.shaded.guava.common.base.Preconditions;
-import com.datastax.oss.driver.shaded.guava.common.collect.ImmutableMap;
import com.datastax.oss.protocol.internal.ProtocolFeatures;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel;
@@ -59,7 +55,6 @@
import java.net.ServerSocket;
import java.net.SocketAddress;
import java.util.List;
-import java.util.Map;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
@@ -76,20 +71,8 @@ public class ChannelFactory {
private static final Logger LOG = LoggerFactory.getLogger(ChannelFactory.class);
- /**
- * A value for {@link #productType} that indicates that we are connected to DataStax Cloud. This
- * value matches the one defined at DSE DB server side at {@code ProductType.java}.
- */
- private static final String DATASTAX_CLOUD_PRODUCT_TYPE = "DATASTAX_APOLLO";
-
private static final AtomicBoolean LOGGED_ORPHAN_WARNING = new AtomicBoolean();
- /**
- * A value for {@link #productType} that indicates that the server does not report any product
- * type.
- */
- private static final String UNKNOWN_PRODUCT_TYPE = "UNKNOWN";
-
// The names of the handlers on the pipeline:
public static final String SSL_HANDLER_NAME = "ssl";
public static final String INBOUND_TRAFFIC_METER_NAME = "inboundTrafficMeter";
@@ -132,14 +115,6 @@ public static int effectiveMaxOrphanRequests(
private volatile String clusterName;
- /**
- * The value of the {@code PRODUCT_TYPE} option reported by the first channel we opened, in
- * response to a {@code SUPPORTED} request.
- *
- * If the server does not return that option, the value will be {@link #UNKNOWN_PRODUCT_TYPE}.
- */
- @VisibleForTesting volatile String productType;
-
public ChannelFactory(InternalDriverContext context) {
this.logPrefix = context.getSessionName();
this.context = context;
@@ -296,24 +271,6 @@ private void connect(
if (ChannelFactory.this.clusterName == null) {
ChannelFactory.this.clusterName = driverChannel.getClusterName();
}
- Map> supportedOptions = driverChannel.getOptions();
- if (ChannelFactory.this.productType == null && supportedOptions != null) {
- List productTypes = supportedOptions.get("PRODUCT_TYPE");
- String productType =
- productTypes != null && !productTypes.isEmpty()
- ? productTypes.get(0)
- : UNKNOWN_PRODUCT_TYPE;
- ChannelFactory.this.productType = productType;
- DriverConfig driverConfig = context.getConfig();
- if (driverConfig instanceof TypesafeDriverConfig
- && productType.equals(DATASTAX_CLOUD_PRODUCT_TYPE)) {
- ((TypesafeDriverConfig) driverConfig)
- .overrideDefaults(
- ImmutableMap.of(
- DefaultDriverOption.REQUEST_CONSISTENCY,
- ConsistencyLevel.LOCAL_QUORUM.name()));
- }
- }
resultFuture.complete(driverChannel);
} else {
Throwable error = connectFuture.cause();
diff --git a/core/src/main/java/com/datastax/oss/driver/internal/core/channel/DriverChannel.java b/core/src/main/java/com/datastax/oss/driver/internal/core/channel/DriverChannel.java
index ba51469ab2d..557100c13c4 100644
--- a/core/src/main/java/com/datastax/oss/driver/internal/core/channel/DriverChannel.java
+++ b/core/src/main/java/com/datastax/oss/driver/internal/core/channel/DriverChannel.java
@@ -49,7 +49,6 @@
import io.netty.util.concurrent.Promise;
import java.net.SocketAddress;
import java.nio.ByteBuffer;
-import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
@@ -63,8 +62,6 @@
public class DriverChannel {
static final AttributeKey CLUSTER_NAME_KEY = AttributeKey.valueOf("cluster_name");
- static final AttributeKey