mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-11 07:36:53 +00:00
revert: remove BlockReadable trait and chunk-based I/O from rio, ecstore, disk layers (#2533)
This commit is contained in:
@@ -22,7 +22,7 @@ use rustfs_object_io::put::{
|
||||
apply_trailing_checksums, build_put_object_ingress_source, build_put_object_legacy_hash_stage,
|
||||
build_put_object_plain_hash_stage, plan_put_object_body_with_transforms, resolve_put_transformed_fallback_reason,
|
||||
};
|
||||
use rustfs_rio::{BlockReadable, BoxReadBlockFuture, EtagResolvable, HashReaderDetector, TryGetIndex};
|
||||
use rustfs_rio::{EtagResolvable, HashReaderDetector, TryGetIndex};
|
||||
use rustfs_utils::http::headers::AMZ_TRAILER;
|
||||
|
||||
const DEFAULT_SMALL_PUT_EAGER_MAX_BYTES: i64 = 1024 * 1024;
|
||||
@@ -145,22 +145,6 @@ impl AsyncRead for PooledBufferReader {
|
||||
}
|
||||
}
|
||||
|
||||
impl BlockReadable for PooledBufferReader {
|
||||
fn read_block<'a>(&'a mut self, buf: &'a mut [u8]) -> BoxReadBlockFuture<'a> {
|
||||
Box::pin(async move {
|
||||
let remaining = &self.buffer[self.position..];
|
||||
if remaining.is_empty() {
|
||||
return Ok(0);
|
||||
}
|
||||
|
||||
let to_copy = remaining.len().min(buf.len());
|
||||
buf[..to_copy].copy_from_slice(&remaining[..to_copy]);
|
||||
self.position += to_copy;
|
||||
Ok(to_copy)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl EtagResolvable for PooledBufferReader {}
|
||||
|
||||
impl HashReaderDetector for PooledBufferReader {}
|
||||
@@ -480,10 +464,7 @@ impl DefaultObjectUsecase {
|
||||
|
||||
if stage.ingress_kind == PutObjectIngressKind::ReducedCopyCandidate {
|
||||
plain_reduced_copy_stage = true;
|
||||
debug!(
|
||||
"Plain PUT is using the reduced-copy Reader + BlockReadable hash path (bucket={}, key={})",
|
||||
bucket, key
|
||||
);
|
||||
debug!("Plain PUT is using the reduced-copy Reader hash path (bucket={}, key={})", bucket, key);
|
||||
}
|
||||
|
||||
stage
|
||||
|
||||
Reference in New Issue
Block a user