feat(storage): add direct chunk GET fast path (#2351)
Signed-off-by: houseme <[email protected]> Co-authored-by: heihutu <[email protected]> Co-authored-by: cxymds <[email protected]>
This commit is contained in:
co-authored by
heihutu
cxymds
parent
8d27170ce4
commit
32bf8f5bf3
@@ -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