mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-09 06:39:25 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user