refactor: segment residual storage api boundaries (#3905)

This commit is contained in:
Zhengchao An
2026-06-26 15:56:38 +08:00
committed by GitHub
parent ae641a33ac
commit 6efbfff2c5
14 changed files with 106 additions and 23 deletions
@@ -36,7 +36,7 @@ use criterion::{BenchmarkId, Criterion, Throughput, criterion_group, criterion_m
mod storage_api;
use std::hint::black_box;
use std::time::Duration;
use storage_api::Erasure;
use storage_api::comparison::Erasure;
/// Performance test data configuration
struct TestData {
+1 -1
View File
@@ -49,7 +49,7 @@ mod storage_api;
use std::hint::black_box;
use std::io::Cursor;
use std::time::Duration;
use storage_api::{BitrotReader, BitrotWriter, Erasure, calc_shard_size};
use storage_api::erasure::{BitrotReader, BitrotWriter, Erasure, calc_shard_size};
use tokio::runtime::Runtime;
/// Benchmark configuration structure
@@ -18,7 +18,7 @@ mod storage_api;
use std::io::Cursor;
use std::sync::Arc;
use std::time::Duration;
use storage_api::{BitrotWriterWrapper, CustomWriter, Erasure};
use storage_api::single_block_non_inline::{BitrotWriterWrapper, CustomWriter, Erasure};
#[derive(Clone, Debug)]
struct BenchConfig {
+12
View File
@@ -17,3 +17,15 @@
pub(crate) use rustfs_ecstore::api::erasure::{
BitrotReader, BitrotWriter, BitrotWriterWrapper, CustomWriter, Erasure, calc_shard_size,
};
pub(crate) mod comparison {
pub(crate) use super::Erasure;
}
pub(crate) mod erasure {
pub(crate) use super::{BitrotReader, BitrotWriter, Erasure, calc_shard_size};
}
pub(crate) mod single_block_non_inline {
pub(crate) use super::{BitrotWriterWrapper, CustomWriter, Erasure};
}
@@ -18,7 +18,7 @@ use rustfs_common::heal_channel::HealOpts;
use rustfs_filemeta::FileInfo;
use rustfs_lock::NamespaceLockWrapper;
use rustfs_madmin::heal_commands::HealResultItem;
use storage_api::{
use storage_api::contract_compat::{
CompletePart, DeletedObject, DiskStore, ECStore, Error, GetObjectReader, HTTPRangeSpec, ListMultipartsInfo, ListPartsInfo,
MultipartInfo, MultipartUploadResult, ObjectInfo, ObjectOptions, ObjectToDelete, PartInfo, PutObjReader, StorageAdminApi,
StorageHealOperations, StorageListObjectVersionsInfo, StorageListObjectsV2Info, StorageListOperations,
@@ -32,7 +32,7 @@ mod storage_api;
use rustfs_filemeta::{FileInfoOpts, get_file_info};
use rustfs_utils::HashAlgorithm;
use std::path::PathBuf;
use storage_api::{DiskOption, Endpoint, STORAGE_FORMAT_FILE, create_bitrot_reader, new_disk};
use storage_api::legacy_bitrot_read::{DiskOption, Endpoint, STORAGE_FORMAT_FILE, create_bitrot_reader, new_disk};
use tokio::fs;
fn workspace_root() -> PathBuf {
@@ -9,7 +9,7 @@ mod storage_api;
use rustfs_filemeta::{FileInfo, FileInfoOpts, get_file_info};
use serde::Deserialize;
use sha2::{Digest, Sha256};
use storage_api::{
use storage_api::minio_generated_read::{
DiskAPI as _, DiskOption, Endpoint, Erasure, GetObjectReader, ObjectInfo, ObjectOptions, create_bitrot_reader, new_disk,
};
use temp_env::async_with_vars;
+20
View File
@@ -13,3 +13,23 @@ pub(crate) use rustfs_storage_api::{
ObjectInfoOrErr as StorageObjectInfoOrErr, ObjectOperations as StorageObjectOperations, ObjectToDelete, PartInfo,
StorageAdminApi, WalkOptions as StorageWalkOptions,
};
pub(crate) mod contract_compat {
pub(crate) use super::{
CompletePart, DeletedObject, DiskStore, ECStore, Error, GetObjectReader, HTTPRangeSpec, ListMultipartsInfo,
ListPartsInfo, MultipartInfo, MultipartUploadResult, ObjectInfo, ObjectOptions, ObjectToDelete, PartInfo, PutObjReader,
StorageAdminApi, StorageHealOperations, StorageListObjectVersionsInfo, StorageListObjectsV2Info, StorageListOperations,
StorageMultipartOperations, StorageNamespaceLocking, StorageObjectIO, StorageObjectInfoOrErr, StorageObjectOperations,
StorageWalkOptions,
};
}
pub(crate) mod legacy_bitrot_read {
pub(crate) use super::{DiskOption, Endpoint, STORAGE_FORMAT_FILE, create_bitrot_reader, new_disk};
}
pub(crate) mod minio_generated_read {
pub(crate) use super::{
DiskAPI, DiskOption, Endpoint, Erasure, GetObjectReader, ObjectInfo, ObjectOptions, create_bitrot_reader, new_disk,
};
}
+1 -1
View File
@@ -53,6 +53,6 @@ pub use runtime_facade::NotifyRuntimeFacade;
pub use runtime_view::NotifyRuntimeView;
pub use services::NotifyServices;
pub use status_view::NotifyStatusView;
pub(crate) use storage_api::{
pub(crate) use storage_api::crate_boundary::{
read_notify_server_config_without_migrate, resolve_notify_object_store_handle, save_notify_server_config,
};
+6
View File
@@ -41,3 +41,9 @@ pub(crate) async fn save_notify_server_config(
.await
.map_err(|err| err.to_string())
}
pub(crate) mod crate_boundary {
pub(crate) use super::{
read_notify_server_config_without_migrate, resolve_notify_object_store_handle, save_notify_server_config,
};
}