refactor: segment external storage api boundaries (#3903)

This commit is contained in:
Zhengchao An
2026-06-26 15:10:49 +08:00
committed by GitHub
parent 738b805ec0
commit 1f7e159388
41 changed files with 269 additions and 48 deletions
+1 -1
View File
@@ -14,7 +14,7 @@
//! Swift account operations and validation
use super::storage_api::{BucketOperations, MakeBucketOptions};
use super::storage_api::account::{BucketOperations, MakeBucketOptions};
use super::{SwiftError, SwiftResult};
use super::{get_swift_bucket_metadata, resolve_swift_object_store_handle, set_swift_bucket_metadata};
use rustfs_credentials::Credentials;
+1 -1
View File
@@ -17,7 +17,7 @@
//! This module implements Swift container CRUD operations and container-bucket translation.
use super::account::validate_account_access;
use super::storage_api::{
use super::storage_api::container::{
BucketInfo, BucketOperations, BucketOptions, DeleteBucketOptions, ListOperations as _, MakeBucketOptions,
};
use super::types::Container;
+1 -1
View File
@@ -18,7 +18,7 @@
//! Segments are discovered at download time using lexicographic ordering
//! based on a container metadata manifest pointer.
use super::storage_api::HTTPRangeSpec;
use super::storage_api::large_object::HTTPRangeSpec;
use super::{SwiftError, container, object};
use axum::http::{HeaderMap, Response, StatusCode};
use rustfs_credentials::Credentials;
+4 -2
View File
@@ -61,7 +61,9 @@ pub mod versioning;
pub use errors::{SwiftError, SwiftResult};
pub use router::{SwiftRoute, SwiftRouter};
// Note: Container, Object, and SwiftMetadata types used by Swift implementation
pub use storage_api::{SwiftGetObjectReader, SwiftObjectInfo, SwiftObjectOptions, SwiftPutObjReader};
pub(crate) use storage_api::{get_swift_bucket_metadata, resolve_swift_object_store_handle, set_swift_bucket_metadata};
pub use storage_api::public_api::{SwiftGetObjectReader, SwiftObjectInfo, SwiftObjectOptions, SwiftPutObjReader};
pub(crate) use storage_api::public_api::{
get_swift_bucket_metadata, resolve_swift_object_store_handle, set_swift_bucket_metadata,
};
#[allow(unused_imports)]
pub use types::{Container, Object, SwiftMetadata};
+1 -1
View File
@@ -51,7 +51,7 @@
use super::account::validate_account_access;
use super::container::ContainerMapper;
use super::storage_api::{BucketOperations, BucketOptions, HTTPRangeSpec, ObjectIO as _, ObjectOperations as _};
use super::storage_api::object::{BucketOperations, BucketOptions, HTTPRangeSpec, ObjectIO as _, ObjectOperations as _};
use super::{SwiftError, SwiftResult, resolve_swift_object_store_handle};
use axum::http::HeaderMap;
use rustfs_credentials::Credentials;
+1 -1
View File
@@ -18,7 +18,7 @@
//! Large files (>5GB) are split into segments, and a manifest defines
//! how segments are assembled on download.
use super::storage_api::HTTPRangeSpec;
use super::storage_api::large_object::HTTPRangeSpec;
use super::{SwiftError, object};
use axum::http::{HeaderMap, Response, StatusCode};
use rustfs_credentials::Credentials;
+25
View File
@@ -26,6 +26,31 @@ pub(crate) use rustfs_storage_api::{
ObjectOperations,
};
pub(crate) mod account {
pub(crate) use super::{BucketOperations, MakeBucketOptions};
}
pub(crate) mod container {
pub(crate) use super::{BucketInfo, BucketOperations, BucketOptions, DeleteBucketOptions, ListOperations, MakeBucketOptions};
}
pub(crate) mod large_object {
pub(crate) use super::HTTPRangeSpec;
}
pub(crate) mod object {
pub(crate) use super::{BucketOperations, BucketOptions, HTTPRangeSpec, ObjectIO, ObjectOperations};
}
pub(crate) mod public_api {
pub use super::{SwiftGetObjectReader, SwiftObjectInfo, SwiftObjectOptions, SwiftPutObjReader};
pub(crate) use super::{get_swift_bucket_metadata, resolve_swift_object_store_handle, set_swift_bucket_metadata};
}
pub(crate) mod versioning {
pub(crate) use super::{ListOperations, ObjectOperations};
}
pub type SwiftGetObjectReader = <SwiftStore as ObjectIO>::GetObjectReader;
pub type SwiftObjectInfo = <SwiftStore as ObjectOperations>::ObjectInfo;
pub type SwiftObjectOptions = <SwiftStore as ObjectOperations>::ObjectOptions;
+1 -1
View File
@@ -55,7 +55,7 @@ use super::account::validate_account_access;
use super::container::ContainerMapper;
use super::object::{ObjectKeyMapper, SwiftObjectOptions as ObjectOptions, head_object};
use super::resolve_swift_object_store_handle;
use super::storage_api::{ListOperations as _, ObjectOperations as _};
use super::storage_api::versioning::{ListOperations as _, ObjectOperations as _};
use super::{SwiftError, SwiftResult};
use rustfs_credentials::Credentials;
use std::time::{SystemTime, UNIX_EPOCH};