koushiro commented on issue #7242:
URL: https://github.com/apache/opendal/issues/7242#issuecomment-4053055702
Hi @clbarnes thanks for your report.
In 0.55.0, it's true that only a portion of services were implicitly
registered into the DEFAULT_OPERATOR_REGISTRY.
```rust
fn register_builtin_services(registry: &OperatorRegistry) {
let _ = registry;
#[cfg(feature = "services-memory")]
registry.register::<crate::services::Memory>(crate::services::MEMORY_SCHEME);
#[cfg(feature = "services-fs")]
registry.register::<crate::services::Fs>(crate::services::FS_SCHEME);
#[cfg(feature = "services-s3")]
registry.register::<crate::services::S3>(crate::services::S3_SCHEME);
#[cfg(feature = "services-azblob")]
registry.register::<crate::services::Azblob>(crate::services::AZBLOB_SCHEME);
#[cfg(feature = "services-b2")]
registry.register::<crate::services::B2>(crate::services::B2_SCHEME);
#[cfg(feature = "services-cos")]
registry.register::<crate::services::Cos>(crate::services::COS_SCHEME);
#[cfg(feature = "services-gcs")]
registry.register::<crate::services::Gcs>(crate::services::GCS_SCHEME);
#[cfg(feature = "services-obs")]
registry.register::<crate::services::Obs>(crate::services::OBS_SCHEME);
#[cfg(feature = "services-oss")]
registry.register::<crate::services::Oss>(crate::services::OSS_SCHEME);
#[cfg(feature = "services-upyun")]
registry.register::<crate::services::Upyun>(crate::services::UPYUN_SCHEME);
}
```
But in the latest main branch, the operator registry has been refactored,
and similar issues should no longer exist now.
```rust
pub fn init_default_registry() {
static DEFAULT_REGISTRY_INIT: std::sync::Once = std::sync::Once::new();
DEFAULT_REGISTRY_INIT.call_once(||
init_default_registry_inner(OperatorRegistry::get()));
}
fn init_default_registry_inner(registry: &OperatorRegistry) {
opendal_core::services::register_memory_service(registry);
#[cfg(feature = "services-aliyun-drive")]
opendal_service_aliyun_drive::register_aliyun_drive_service(registry);
// ...
#[cfg(any(feature = "services-redis", feature =
"services-redis-native-tls"))]
opendal_service_redis::register_redis_service(registry);
}
#[cfg(feature = "auto-register-services")]
#[ctor::ctor]
fn register_default_operator_registry() {
init_default_registry();
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]