refactor: split compat facade imports (#3716)

This commit is contained in:
安正超
2026-06-22 09:53:22 +08:00
committed by GitHub
parent 89552e1df0
commit de158743c3
23 changed files with 182 additions and 84 deletions
+3 -1
View File
@@ -14,7 +14,9 @@
#![allow(dead_code, unused_imports)]
use rustfs_ecstore::api::{bucket as ecstore_bucket, disk as ecstore_disk, rpc as ecstore_rpc};
use rustfs_ecstore::api::bucket as ecstore_bucket;
use rustfs_ecstore::api::disk as ecstore_disk;
use rustfs_ecstore::api::rpc as ecstore_rpc;
pub(crate) type BucketTargetSys = ecstore_bucket::bucket_target_sys::BucketTargetSys;
pub(crate) type TonicInterceptor = ecstore_rpc::TonicInterceptor;
+5 -4
View File
@@ -12,10 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use rustfs_ecstore::api::{
data_usage as ecstore_data_usage, disk as ecstore_disk, error as ecstore_error, global as ecstore_global,
storage as ecstore_storage,
};
use rustfs_ecstore::api::data_usage as ecstore_data_usage;
use rustfs_ecstore::api::disk as ecstore_disk;
use rustfs_ecstore::api::error as ecstore_error;
use rustfs_ecstore::api::global as ecstore_global;
use rustfs_ecstore::api::storage as ecstore_storage;
pub(crate) const DATA_USAGE_CACHE_NAME: &str = ecstore_data_usage::DATA_USAGE_CACHE_NAME;
pub(crate) const BUCKET_META_PREFIX: &str = ecstore_disk::BUCKET_META_PREFIX;
+5 -3
View File
@@ -16,9 +16,11 @@
use std::sync::Arc;
use rustfs_ecstore::api::{
bucket as ecstore_bucket, disk as ecstore_disk, error as ecstore_error, layout as ecstore_layout, storage as ecstore_storage,
};
use rustfs_ecstore::api::bucket as ecstore_bucket;
use rustfs_ecstore::api::disk as ecstore_disk;
use rustfs_ecstore::api::error as ecstore_error;
use rustfs_ecstore::api::layout as ecstore_layout;
use rustfs_ecstore::api::storage as ecstore_storage;
pub(crate) type DiskStore = ecstore_disk::DiskStore;
pub(crate) type ECStore = ecstore_storage::ECStore;
+5 -4
View File
@@ -14,10 +14,11 @@
use std::sync::Arc;
use rustfs_ecstore::api::{
config as ecstore_config, error as ecstore_error, global as ecstore_global, notification as ecstore_notification,
storage as ecstore_storage,
};
use rustfs_ecstore::api::config as ecstore_config;
use rustfs_ecstore::api::error as ecstore_error;
use rustfs_ecstore::api::global as ecstore_global;
use rustfs_ecstore::api::notification as ecstore_notification;
use rustfs_ecstore::api::storage as ecstore_storage;
pub(crate) const IAM_CONFIG_ROOT_PREFIX: &str = ecstore_config::RUSTFS_CONFIG_PREFIX;
+6 -7
View File
@@ -13,10 +13,9 @@
// limitations under the License.
use rustfs_config::server_config::Config;
use rustfs_ecstore::api::{
config::com as ecstore_config_com, global::resolve_object_store_handle as ecstore_resolve_object_store_handle,
storage as ecstore_storage,
};
use rustfs_ecstore::api::config as ecstore_config;
use rustfs_ecstore::api::global as ecstore_global;
use rustfs_ecstore::api::storage as ecstore_storage;
use std::sync::Arc;
type NotifyStore = ecstore_storage::ECStore;
@@ -48,17 +47,17 @@ where
}
fn resolve_notify_object_store_handle() -> Option<Arc<NotifyStore>> {
ecstore_resolve_object_store_handle()
ecstore_global::resolve_object_store_handle()
}
async fn read_notify_server_config_without_migrate(store: Arc<NotifyStore>) -> Result<Config, NotifyConfigStoreError> {
ecstore_config_com::read_config_without_migrate(store)
ecstore_config::com::read_config_without_migrate(store)
.await
.map_err(|err| NotifyConfigStoreError::Read(err.to_string()))
}
async fn save_notify_server_config(store: Arc<NotifyStore>, config: &Config) -> Result<(), NotifyConfigStoreError> {
ecstore_config_com::save_server_config(store, config)
ecstore_config::com::save_server_config(store, config)
.await
.map_err(|err| NotifyConfigStoreError::Save(err.to_string()))
}
+6 -4
View File
@@ -16,10 +16,12 @@ use crate::metrics::collectors::{
BucketReplicationStats as MetricBucketReplicationStats, BucketReplicationTargetStats,
ReplicationStats as MetricReplicationStats,
};
use rustfs_ecstore::api::{
bucket as ecstore_bucket, capacity as ecstore_capacity, data_usage as ecstore_data_usage, error as ecstore_error,
global as ecstore_global, storage as ecstore_storage,
};
use rustfs_ecstore::api::bucket as ecstore_bucket;
use rustfs_ecstore::api::capacity as ecstore_capacity;
use rustfs_ecstore::api::data_usage as ecstore_data_usage;
use rustfs_ecstore::api::error as ecstore_error;
use rustfs_ecstore::api::global as ecstore_global;
use rustfs_ecstore::api::storage as ecstore_storage;
use rustfs_storage_api::StorageAdminApi;
use std::collections::HashMap;
use std::sync::Arc;
+4 -3
View File
@@ -14,9 +14,10 @@
use std::sync::Arc;
use rustfs_ecstore::api::{
bucket as ecstore_bucket, error as ecstore_error, global as ecstore_global, storage as ecstore_storage,
};
use rustfs_ecstore::api::bucket as ecstore_bucket;
use rustfs_ecstore::api::error as ecstore_error;
use rustfs_ecstore::api::global as ecstore_global;
use rustfs_ecstore::api::storage as ecstore_storage;
pub(super) type SwiftBucketMetadata = ecstore_bucket::metadata::BucketMetadata;
pub(super) type SwiftStorageResult<T> = ecstore_error::Result<T>;
+4 -3
View File
@@ -12,9 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use rustfs_ecstore::api::{
error as ecstore_error, global as ecstore_global, set_disk as ecstore_set_disk, storage as ecstore_storage,
};
use rustfs_ecstore::api::error as ecstore_error;
use rustfs_ecstore::api::global as ecstore_global;
use rustfs_ecstore::api::set_disk as ecstore_set_disk;
use rustfs_ecstore::api::storage as ecstore_storage;
pub(crate) type SelectStorageError = ecstore_error::StorageError;
pub(crate) type SelectStore = ecstore_storage::ECStore;
+11 -5
View File
@@ -13,11 +13,17 @@
// limitations under the License.
use http::HeaderMap;
use rustfs_ecstore::api::{
bucket as ecstore_bucket, cache as ecstore_cache, capacity as ecstore_capacity, config as ecstore_config,
data_usage as ecstore_data_usage, disk as ecstore_disk, error as ecstore_error, global as ecstore_global,
set_disk as ecstore_set_disk, storage as ecstore_storage, tier as ecstore_tier,
};
use rustfs_ecstore::api::bucket as ecstore_bucket;
use rustfs_ecstore::api::cache as ecstore_cache;
use rustfs_ecstore::api::capacity as ecstore_capacity;
use rustfs_ecstore::api::config as ecstore_config;
use rustfs_ecstore::api::data_usage as ecstore_data_usage;
use rustfs_ecstore::api::disk as ecstore_disk;
use rustfs_ecstore::api::error as ecstore_error;
use rustfs_ecstore::api::global as ecstore_global;
use rustfs_ecstore::api::set_disk as ecstore_set_disk;
use rustfs_ecstore::api::storage as ecstore_storage;
use rustfs_ecstore::api::tier as ecstore_tier;
use rustfs_storage_api::{HTTPRangeSpec, ObjectIO, ObjectToDelete};
use std::path::PathBuf;
use std::sync::Arc;
@@ -17,10 +17,15 @@
use std::collections::HashMap;
use std::sync::Arc;
use rustfs_ecstore::api::{
bucket as ecstore_bucket, capacity as ecstore_capacity, client as ecstore_client, disk as ecstore_disk,
error as ecstore_error, global as ecstore_global, layout as ecstore_layout, storage as ecstore_storage, tier as ecstore_tier,
};
use rustfs_ecstore::api::bucket as ecstore_bucket;
use rustfs_ecstore::api::capacity as ecstore_capacity;
use rustfs_ecstore::api::client as ecstore_client;
use rustfs_ecstore::api::disk as ecstore_disk;
use rustfs_ecstore::api::error as ecstore_error;
use rustfs_ecstore::api::global as ecstore_global;
use rustfs_ecstore::api::layout as ecstore_layout;
use rustfs_ecstore::api::storage as ecstore_storage;
use rustfs_ecstore::api::tier as ecstore_tier;
use time::OffsetDateTime;
pub(crate) const BUCKET_LIFECYCLE_CONFIG: &str = ecstore_bucket::metadata::BUCKET_LIFECYCLE_CONFIG;