feat(storage): add direct chunk GET fast path (#2351)

Signed-off-by: houseme <housemecn@gmail.com>
Co-authored-by: heihutu <heihutu@gmail.com>
Co-authored-by: cxymds <Cxymds@qq.com>
This commit is contained in:
houseme
2026-04-07 08:33:46 +08:00
committed by GitHub
parent 8d27170ce4
commit 32bf8f5bf3
84 changed files with 15932 additions and 3592 deletions
+5 -5
View File
@@ -55,7 +55,7 @@ use super::{SwiftError, SwiftResult};
use axum::http::HeaderMap;
use rustfs_credentials::Credentials;
use rustfs_ecstore::new_object_layer_fn;
use rustfs_ecstore::store_api::{BucketOperations, BucketOptions, ObjectIO, ObjectOperations, ObjectOptions, PutObjReader};
use rustfs_ecstore::store_api::{BucketOperations, BucketOptions, ChunkNativePutData, ObjectIO, ObjectOperations, ObjectOptions};
use rustfs_rio::HashReader;
use std::collections::HashMap;
use tracing::debug;
@@ -381,8 +381,8 @@ where
let hash_reader = HashReader::from_stream(buf_reader, content_length, content_length, None, None, false)
.map_err(|e| sanitize_storage_error("Hash reader creation", e))?;
// 15. Wrap in PutObjReader as expected by storage layer
let mut put_reader = PutObjReader::new(hash_reader);
// 15. Hand the hash reader to the chunk-native PUT data wrapper
let mut put_reader = ChunkNativePutData::new(hash_reader);
// 16. Upload object to storage
let obj_info = store
@@ -464,8 +464,8 @@ where
let hash_reader = HashReader::from_stream(buf_reader, content_length, content_length, None, None, false)
.map_err(|e| sanitize_storage_error("Hash reader creation", e))?;
// Wrap in PutObjReader
let mut put_reader = PutObjReader::new(hash_reader);
// Hand the hash reader to the chunk-native PUT data wrapper
let mut put_reader = ChunkNativePutData::new(hash_reader);
// Upload object to storage
let obj_info = store