refactor: move object operation contracts (#3559)

This commit is contained in:
安正超
2026-06-18 09:48:13 +08:00
committed by GitHub
parent 3fb4cb3d65
commit e5cad7ed20
34 changed files with 529 additions and 200 deletions
+1
View File
@@ -13,6 +13,7 @@
// limitations under the License.
use super::*;
use rustfs_storage_api::MultipartOperations as _;
impl ECStore {
#[instrument(skip(self))]
+3 -1
View File
@@ -21,6 +21,7 @@ use rustfs_io_metrics::{
record_object_lock_diag_acquire_duration, record_object_lock_diag_hold_duration, record_object_lock_diag_slow_acquire,
record_object_lock_diag_slow_hold,
};
use rustfs_storage_api::{ObjectIO as _, ObjectOperations as _};
use std::{
fmt,
pin::Pin,
@@ -1254,7 +1255,8 @@ impl ECStore {
}
pub(super) async fn handle_verify_object_integrity(&self, bucket: &str, object: &str, opts: &ObjectOptions) -> Result<()> {
let get_object_reader = <Self as ObjectIO>::get_object_reader(self, bucket, object, None, HeaderMap::new(), opts).await?;
let get_object_reader =
<Self as rustfs_storage_api::ObjectIO>::get_object_reader(self, bucket, object, None, HeaderMap::new(), opts).await?;
// Stream to sink to avoid loading entire object into memory during verification
let mut reader = get_object_reader.stream;
tokio::io::copy(&mut reader, &mut tokio::io::sink()).await?;
+1 -1
View File
@@ -14,7 +14,7 @@
use super::*;
use crate::config::get_global_storage_class;
use rustfs_storage_api::StorageAdminApi;
use rustfs_storage_api::{ObjectOperations as _, StorageAdminApi};
struct LatestObjectInfoCandidate {
info: Option<ObjectInfo>,