Skip to content

Commit 7c95833

Browse files
wprzytulamuzarski
authored andcommitted
rename feature: cloud -> unstable-cloud
As the Serverless Cloud is a highly unstable feature, it must be marked as such in order not to break API after 1.0 in case we need to introduce breaking changes to the feature.
1 parent ac3aca3 commit 7c95833

File tree

9 files changed

+47
-47
lines changed

9 files changed

+47
-47
lines changed

examples/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ rustyline-derive = "0.6"
1313
scylla = { path = "../scylla", features = [
1414
"openssl-010",
1515
"rustls-023",
16-
"cloud",
16+
"unstable-cloud",
1717
"chrono-04",
1818
"time-03",
1919
"num-bigint-03",

scylla/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ rustdoc-args = ["--cfg", "docsrs"]
1818
default = []
1919
openssl-010 = ["dep:tokio-openssl", "dep:openssl"]
2020
rustls-023 = ["dep:tokio-rustls", "dep:rustls"]
21-
cloud = [
21+
unstable-cloud = [
2222
"scylla-cql/serde",
2323
"dep:serde_yaml",
2424
"dep:serde",

scylla/src/client/session.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ use super::{Compression, PoolSize, SelfIdentity};
77
use crate::authentication::AuthenticatorProvider;
88
use crate::batch::batch_values;
99
use crate::batch::{Batch, BatchStatement};
10-
#[cfg(feature = "cloud")]
10+
#[cfg(feature = "unstable-cloud")]
1111
use crate::cloud::CloudConfig;
12-
#[cfg(feature = "cloud")]
12+
#[cfg(feature = "unstable-cloud")]
1313
use crate::cluster::node::CloudEndpoint;
1414
use crate::cluster::node::{InternalKnownNode, KnownNode, NodeRef};
1515
use crate::cluster::{Cluster, ClusterNeatDebug, ClusterState};
@@ -51,7 +51,7 @@ use std::num::NonZeroU32;
5151
use std::sync::Arc;
5252
use std::time::Duration;
5353
use tokio::time::timeout;
54-
#[cfg(feature = "cloud")]
54+
#[cfg(feature = "unstable-cloud")]
5555
use tracing::warn;
5656
use tracing::{debug, error, trace, trace_span, Instrument};
5757
use uuid::Uuid;
@@ -201,7 +201,7 @@ pub struct SessionConfig {
201201
pub host_filter: Option<Arc<dyn HostFilter>>,
202202

203203
/// If the driver is to connect to ScyllaCloud, there is a config for it.
204-
#[cfg(feature = "cloud")]
204+
#[cfg(feature = "unstable-cloud")]
205205
pub cloud_config: Option<Arc<CloudConfig>>,
206206

207207
/// If true, the driver will inject a small delay before flushing data
@@ -280,7 +280,7 @@ impl SessionConfig {
280280
address_translator: None,
281281
host_filter: None,
282282
refresh_metadata_on_auto_schema_agreement: true,
283-
#[cfg(feature = "cloud")]
283+
#[cfg(feature = "unstable-cloud")]
284284
cloud_config: None,
285285
enable_write_coalescing: true,
286286
tracing_info_fetch_attempts: NonZeroU32::new(10).unwrap(),
@@ -781,7 +781,7 @@ impl Session {
781781
pub async fn connect(config: SessionConfig) -> Result<Self, NewSessionError> {
782782
let known_nodes = config.known_nodes;
783783

784-
#[cfg(feature = "cloud")]
784+
#[cfg(feature = "unstable-cloud")]
785785
let cloud_known_nodes: Option<Vec<InternalKnownNode>> =
786786
if let Some(ref cloud_config) = config.cloud_config {
787787
let cloud_servers = cloud_config
@@ -799,7 +799,7 @@ impl Session {
799799
None
800800
};
801801

802-
#[cfg(not(feature = "cloud"))]
802+
#[cfg(not(feature = "unstable-cloud"))]
803803
let cloud_known_nodes: Option<Vec<InternalKnownNode>> = None;
804804

805805
let known_nodes = cloud_known_nodes
@@ -814,7 +814,7 @@ impl Session {
814814

815815
#[allow(unused_labels)] // Triggers when `cloud` feature is disabled.
816816
let address_translator = 'translator: {
817-
#[cfg(feature = "cloud")]
817+
#[cfg(feature = "unstable-cloud")]
818818
if let Some(translator) = config.cloud_config.clone() {
819819
if config.address_translator.is_some() {
820820
// This can only happen if the user builds SessionConfig by hand, as SessionBuilder in cloud mode prevents setting custom AddressTranslator.
@@ -832,7 +832,7 @@ impl Session {
832832
};
833833

834834
let tls_provider = 'provider: {
835-
#[cfg(feature = "cloud")]
835+
#[cfg(feature = "unstable-cloud")]
836836
if let Some(cloud_config) = config.cloud_config {
837837
if config.tls_context.is_some() {
838838
// This can only happen if the user builds SessionConfig by hand, as SessionBuilder in cloud mode prevents setting custom TlsContext.

scylla/src/client/session_builder.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
//! SessionBuilder provides an easy way to create new Sessions
22
3-
#[cfg(feature = "cloud")]
3+
#[cfg(feature = "unstable-cloud")]
44
use super::execution_profile::ExecutionProfile;
55
use super::execution_profile::ExecutionProfileHandle;
66
use super::session::{Session, SessionConfig};
77
use super::{Compression, PoolSize, SelfIdentity};
88
use crate::authentication::{AuthenticatorProvider, PlainTextAuthenticator};
99
use crate::client::session::TlsContext;
10-
#[cfg(feature = "cloud")]
10+
#[cfg(feature = "unstable-cloud")]
1111
use crate::cloud::{CloudConfig, CloudConfigError, CloudTlsProvider};
1212
use crate::errors::NewSessionError;
1313
use crate::policies::address_translator::AddressTranslator;
@@ -18,7 +18,7 @@ use std::borrow::Borrow;
1818
use std::marker::PhantomData;
1919
use std::net::SocketAddr;
2020
use std::num::NonZeroU32;
21-
#[cfg(feature = "cloud")]
21+
#[cfg(feature = "unstable-cloud")]
2222
use std::path::Path;
2323
use std::sync::Arc;
2424
use std::time::Duration;
@@ -40,15 +40,15 @@ impl SessionBuilderKind for DefaultMode {}
4040

4141
pub type SessionBuilder = GenericSessionBuilder<DefaultMode>;
4242

43-
#[cfg(feature = "cloud")]
43+
#[cfg(feature = "unstable-cloud")]
4444
#[derive(Clone)]
4545
pub enum CloudMode {}
46-
#[cfg(feature = "cloud")]
46+
#[cfg(feature = "unstable-cloud")]
4747
impl sealed::Sealed for CloudMode {}
48-
#[cfg(feature = "cloud")]
48+
#[cfg(feature = "unstable-cloud")]
4949
impl SessionBuilderKind for CloudMode {}
5050

51-
#[cfg(feature = "cloud")]
51+
#[cfg(feature = "unstable-cloud")]
5252
pub type CloudSessionBuilder = GenericSessionBuilder<CloudMode>;
5353

5454
/// SessionBuilder is used to create new Session instances
@@ -359,7 +359,7 @@ impl GenericSessionBuilder<DefaultMode> {
359359
// NOTE: this `impl` block contains configuration options specific for **Cloud** [`Session`].
360360
// This means that if an option fits both non-Cloud and Cloud `Session`s, it should NOT be put
361361
// here, but rather in `impl<K> GenericSessionBuilder<K>` block.
362-
#[cfg(feature = "cloud")]
362+
#[cfg(feature = "unstable-cloud")]
363363
impl CloudSessionBuilder {
364364
/// Creates a new SessionBuilder with default configuration,
365365
/// based on provided path to Scylla Cloud Config yaml.

scylla/src/cloud/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ pub use config::CloudConfigError;
55
pub use config::CloudTlsProvider;
66

77
#[cfg(all(
8-
feature = "cloud",
8+
feature = "unstable-cloud",
99
not(any(feature = "rustls-023", feature = "openssl-010"))
1010
))]
1111
compile_error!(
12-
r#""cloud" feature requires a TLS backend: at least one of ["rustls-023", "openssl-010"] is needed"#
12+
r#""unstable-cloud" feature requires a TLS backend: at least one of ["rustls-023", "openssl-010"] is needed"#
1313
);

scylla/src/cluster/node.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ pub enum KnownNode {
253253
pub(crate) enum InternalKnownNode {
254254
Hostname(String),
255255
Address(SocketAddr),
256-
#[cfg(feature = "cloud")]
256+
#[cfg(feature = "unstable-cloud")]
257257
CloudEndpoint(CloudEndpoint),
258258
}
259259

@@ -267,7 +267,7 @@ impl From<KnownNode> for InternalKnownNode {
267267
}
268268

269269
/// Describes a database server in the serverless Scylla Cloud.
270-
#[cfg(feature = "cloud")]
270+
#[cfg(feature = "unstable-cloud")]
271271
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
272272
pub(crate) struct CloudEndpoint {
273273
pub(crate) hostname: String,
@@ -278,7 +278,7 @@ pub(crate) struct CloudEndpoint {
278278
#[derive(Debug, Clone)]
279279
pub(crate) struct ResolvedContactPoint {
280280
pub(crate) address: SocketAddr,
281-
#[cfg_attr(not(feature = "cloud"), allow(unused))]
281+
#[cfg_attr(not(feature = "unstable-cloud"), allow(unused))]
282282
pub(crate) datacenter: Option<String>,
283283
}
284284

@@ -328,7 +328,7 @@ pub(crate) async fn resolve_contact_points(
328328
address: *address,
329329
datacenter: None,
330330
}),
331-
#[cfg(feature = "cloud")]
331+
#[cfg(feature = "unstable-cloud")]
332332
InternalKnownNode::CloudEndpoint(CloudEndpoint {
333333
hostname,
334334
datacenter,

scylla/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ pub mod deserialize {
241241

242242
pub mod authentication;
243243
pub mod client;
244-
#[cfg(feature = "cloud")]
244+
#[cfg(feature = "unstable-cloud")]
245245
pub mod cloud;
246246

247247
pub mod cluster;

scylla/src/network/connection.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -228,28 +228,28 @@ mod tls_config {
228228
//! ↳Tls (wrapper over TCP stream which adds encryption)
229229
230230
use std::io;
231-
#[cfg(feature = "cloud")]
231+
#[cfg(feature = "unstable-cloud")]
232232
use std::sync::Arc;
233233

234-
#[cfg(feature = "cloud")]
234+
#[cfg(feature = "unstable-cloud")]
235235
use tracing::warn;
236-
#[cfg(feature = "cloud")]
236+
#[cfg(feature = "unstable-cloud")]
237237
use uuid::Uuid;
238238

239239
use crate::client::session::TlsContext;
240-
#[cfg(feature = "cloud")]
240+
#[cfg(feature = "unstable-cloud")]
241241
use crate::cloud::CloudConfig;
242-
#[cfg(feature = "cloud")]
242+
#[cfg(feature = "unstable-cloud")]
243243
use crate::cluster::metadata::PeerEndpoint;
244244
use crate::cluster::metadata::UntranslatedEndpoint;
245-
#[cfg(feature = "cloud")]
245+
#[cfg(feature = "unstable-cloud")]
246246
use crate::cluster::node::ResolvedContactPoint;
247247

248248
/// Abstraction capable of producing [TlsConfig] for connections on-demand.
249249
#[derive(Clone)] // Cheaply clonable (reference-counted)
250250
pub(crate) enum TlsProvider {
251251
GlobalContext(TlsContext),
252-
#[cfg(feature = "cloud")]
252+
#[cfg(feature = "unstable-cloud")]
253253
ScyllaCloud(Arc<CloudConfig>),
254254
}
255255

@@ -260,7 +260,7 @@ mod tls_config {
260260
}
261261

262262
/// Used in the cloud case.
263-
#[cfg(feature = "cloud")]
263+
#[cfg(feature = "unstable-cloud")]
264264
pub(crate) fn new_cloud(cloud_config: Arc<CloudConfig>) -> Self {
265265
Self::ScyllaCloud(cloud_config)
266266
}
@@ -276,7 +276,7 @@ mod tls_config {
276276
TlsProvider::GlobalContext(context) => {
277277
Some(TlsConfig::new_with_global_context(context.clone()))
278278
}
279-
#[cfg(feature = "cloud")]
279+
#[cfg(feature = "unstable-cloud")]
280280
TlsProvider::ScyllaCloud(cloud_config) => {
281281
let (host_id, address, dc) = match *endpoint {
282282
UntranslatedEndpoint::ContactPoint(ResolvedContactPoint {
@@ -317,7 +317,7 @@ mod tls_config {
317317
#[derive(Clone)]
318318
pub(crate) struct TlsConfig {
319319
context: TlsContext,
320-
#[cfg(feature = "cloud")]
320+
#[cfg(feature = "unstable-cloud")]
321321
sni: Option<String>,
322322
}
323323

@@ -328,7 +328,7 @@ mod tls_config {
328328
#[cfg(feature = "rustls-023")]
329329
Rustls023 {
330330
connector: tokio_rustls::TlsConnector,
331-
#[cfg(feature = "cloud")]
331+
#[cfg(feature = "unstable-cloud")]
332332
sni: Option<rustls::pki_types::ServerName<'static>>,
333333
},
334334
}
@@ -370,21 +370,21 @@ mod tls_config {
370370
pub(crate) fn new_with_global_context(context: TlsContext) -> Self {
371371
Self {
372372
context,
373-
#[cfg(feature = "cloud")]
373+
#[cfg(feature = "unstable-cloud")]
374374
sni: None,
375375
}
376376
}
377377

378378
/// Used in case of Serverless Cloud connections.
379-
#[cfg(feature = "cloud")]
379+
#[cfg(feature = "unstable-cloud")]
380380
pub(crate) fn new_for_sni(
381381
context: TlsContext,
382382
domain_name: &str,
383383
host_id: Option<Uuid>,
384384
) -> Self {
385385
Self {
386386
context,
387-
#[cfg(feature = "cloud")]
387+
#[cfg(feature = "unstable-cloud")]
388388
sni: Some(if let Some(host_id) = host_id {
389389
format!("{}.{}", host_id, domain_name)
390390
} else {
@@ -402,7 +402,7 @@ mod tls_config {
402402
TlsContext::OpenSsl010(ref context) => {
403403
#[allow(unused_mut)]
404404
let mut ssl = openssl::ssl::Ssl::new(context)?;
405-
#[cfg(feature = "cloud")]
405+
#[cfg(feature = "unstable-cloud")]
406406
if let Some(sni) = self.sni.as_ref() {
407407
ssl.set_hostname(sni)?;
408408
}
@@ -411,7 +411,7 @@ mod tls_config {
411411
#[cfg(feature = "rustls-023")]
412412
TlsContext::Rustls023(ref config) => {
413413
let connector = tokio_rustls::TlsConnector::from(config.clone());
414-
#[cfg(feature = "cloud")]
414+
#[cfg(feature = "unstable-cloud")]
415415
let sni = self
416416
.sni
417417
.as_deref()
@@ -421,7 +421,7 @@ mod tls_config {
421421

422422
Ok(Tls::Rustls023 {
423423
connector,
424-
#[cfg(feature = "cloud")]
424+
#[cfg(feature = "unstable-cloud")]
425425
sni,
426426
})
427427
}
@@ -1619,14 +1619,14 @@ impl Connection {
16191619
#[cfg(feature = "rustls-023")]
16201620
tls_config::Tls::Rustls023 {
16211621
connector,
1622-
#[cfg(feature = "cloud")]
1622+
#[cfg(feature = "unstable-cloud")]
16231623
sni,
16241624
} => {
16251625
use rustls::pki_types::ServerName;
1626-
#[cfg(feature = "cloud")]
1626+
#[cfg(feature = "unstable-cloud")]
16271627
let server_name =
16281628
sni.unwrap_or_else(|| ServerName::IpAddress(node_address.into()));
1629-
#[cfg(not(feature = "cloud"))]
1629+
#[cfg(not(feature = "unstable-cloud"))]
16301630
let server_name = ServerName::IpAddress(node_address.into());
16311631
let stream = connector.connect(server_name, stream).await?;
16321632
return Ok(spawn_router_and_get_handle(

scylla/src/network/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//! - NodeConnectionPool - a manager that keeps a desired number of connections opened to each shard.
66
77
mod connection;
8-
#[cfg(feature = "cloud")]
8+
#[cfg(feature = "unstable-cloud")]
99
pub(crate) use connection::TlsConfig;
1010
pub use connection::TlsError;
1111
pub(crate) use connection::TlsProvider;

0 commit comments

Comments
 (0)