revert: remove BlockReadable trait and chunk-based I/O from rio, ecstore, disk layers (#2533)

This commit is contained in:
安正超
2026-04-14 19:09:02 +08:00
committed by GitHub
parent 2a3d127a86
commit 6d476ae9a1
22 changed files with 426 additions and 2807 deletions
@@ -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