mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-25 21:46:50 +00:00
refactor: remove storage api facade (#3490)
This commit is contained in:
@@ -60,7 +60,6 @@ pub use global::{get_global_lock_client, get_global_lock_clients, set_global_loc
|
||||
pub use global::{new_object_layer_fn, resolve_object_store_handle, set_object_store_resolver};
|
||||
|
||||
pub use global::GLOBAL_Endpoints;
|
||||
pub use store_api::StorageAPI;
|
||||
|
||||
#[cfg(test)]
|
||||
mod rio_tests {
|
||||
|
||||
@@ -55,7 +55,7 @@ use crate::{
|
||||
BucketInfo, BucketOperations, BucketOptions, CompletePart, DeleteBucketOptions, DeletedObject, GetObjectReader,
|
||||
HTTPRangeSpec, HealOperations, ListMultipartsInfo, ListObjectsV2Info, ListOperations, MakeBucketOptions, MultipartInfo,
|
||||
MultipartOperations, MultipartUploadResult, NamespaceLocking, ObjectIO, ObjectInfo, ObjectOperations, PartInfo,
|
||||
PutObjReader, StorageAPI,
|
||||
PutObjReader,
|
||||
},
|
||||
store_init::load_format_erasure,
|
||||
};
|
||||
@@ -1633,9 +1633,6 @@ impl SetDisks {
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl StorageAPI for SetDisks {}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl NamespaceLocking for SetDisks {
|
||||
#[tracing::instrument(skip(self))]
|
||||
|
||||
@@ -31,7 +31,7 @@ use crate::{
|
||||
BucketInfo, BucketOperations, BucketOptions, CompletePart, DeleteBucketOptions, DeletedObject, GetObjectReader,
|
||||
HTTPRangeSpec, HealOperations, ListMultipartsInfo, ListObjectVersionsInfo, ListObjectsV2Info, ListOperations,
|
||||
MakeBucketOptions, MultipartInfo, MultipartOperations, MultipartUploadResult, NamespaceLocking, ObjectIO, ObjectInfo,
|
||||
ObjectOperations, ObjectOptions, ObjectToDelete, PartInfo, PutObjReader, StorageAPI,
|
||||
ObjectOperations, ObjectOptions, ObjectToDelete, PartInfo, PutObjReader,
|
||||
},
|
||||
store_init::{check_format_erasure_values, get_format_erasure_in_quorum, load_format_erasure_all, save_format_file},
|
||||
};
|
||||
@@ -896,9 +896,6 @@ impl HealOperations for Sets {
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl StorageAPI for Sets {}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl NamespaceLocking for Sets {
|
||||
async fn new_ns_lock(&self, bucket: &str, object: &str) -> Result<NamespaceLockWrapper> {
|
||||
|
||||
@@ -68,7 +68,7 @@ use crate::{
|
||||
BucketInfo, BucketOperations, BucketOptions, CompletePart, DeleteBucketOptions, DeletedObject, GetObjectReader,
|
||||
HTTPRangeSpec, HealOperations, ListObjectsV2Info, ListOperations, MakeBucketOptions, MultipartOperations,
|
||||
MultipartUploadResult, NamespaceLocking, ObjectInfo, ObjectOperations, ObjectOptions, ObjectToDelete, PartInfo,
|
||||
PutObjReader, StorageAPI,
|
||||
PutObjReader,
|
||||
},
|
||||
store_init,
|
||||
};
|
||||
@@ -703,9 +703,6 @@ impl HealOperations for ECStore {
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl StorageAPI for ECStore {}
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl NamespaceLocking for ECStore {
|
||||
async fn new_ns_lock(&self, bucket: &str, object: &str) -> Result<NamespaceLockWrapper> {
|
||||
|
||||
@@ -178,13 +178,3 @@ pub trait HealOperations: Send + Sync + Debug {
|
||||
pub trait NamespaceLocking: Send + Sync + Debug + 'static {
|
||||
async fn new_ns_lock(&self, bucket: &str, object: &str) -> Result<NamespaceLockWrapper>;
|
||||
}
|
||||
|
||||
/// Unified storage API combining all operation groups.
|
||||
///
|
||||
/// Consumers can depend on specific sub-traits (e.g., `BucketOperations`)
|
||||
/// when they don't need the full API surface.
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub trait StorageAPI:
|
||||
ObjectIO + BucketOperations + ObjectOperations + ListOperations + MultipartOperations + HealOperations + Debug
|
||||
{
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user