Skip to content

Commit

Permalink
added ensure_initialized
Browse files Browse the repository at this point in the history
  • Loading branch information
ccciudatu committed Feb 4, 2025
1 parent 927f7fb commit 4d9c113
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
1 change: 0 additions & 1 deletion crates/aws/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ pub fn register_handlers(_additional_prefixes: Option<Url>) {
#[ctor::ctor]
fn init() {
register_handlers(None);
tracing::info!("AWS initialized");
}

/// Representation of a log entry stored in DynamoDb
Expand Down
1 change: 0 additions & 1 deletion crates/azure/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,4 @@ pub fn register_handlers(_additional_prefixes: Option<Url>) {
#[ctor::ctor]
fn init() {
register_handlers(None);
tracing::info!("Azure initialized");
}
15 changes: 15 additions & 0 deletions crates/deltalake/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::sync::Once;
/**
* The deltalake crate is currently just a meta-package shim for deltalake-core
*/
Expand All @@ -11,3 +12,17 @@ pub use deltalake_azure as azure;
pub use deltalake_gcp as gcp;
#[cfg(feature = "hdfs")]
pub use deltalake_hdfs as hdfs;

pub fn ensure_initialized() {
let once = Once::new();
once.call_once(|| {
#[cfg(any(feature = "s3", feature = "s3-native-tls"))]
aws::register_handlers(None);
#[cfg(feature = "azure")]
azure::register_handlers(None);
#[cfg(feature = "gcs")]
gcp::register_handlers(None);
#[cfg(feature = "hdfs")]
hdfs::register_handlers(None);
})
}
1 change: 0 additions & 1 deletion crates/gcp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,4 @@ pub fn register_handlers(_additional_prefixes: Option<Url>) {
#[ctor::ctor]
fn init() {
register_handlers(None);
tracing::info!("GCP initialized");
}
1 change: 0 additions & 1 deletion crates/hdfs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@ pub fn register_handlers(_additional_prefixes: Option<Url>) {
#[ctor::ctor]
fn init() {
register_handlers(None);
tracing::info!("HDFS initialized");
}

0 comments on commit 4d9c113

Please sign in to comment.