Xuanwo opened a new issue, #8848: URL: https://github.com/apache/opendal/issues/8848
> AI-authored issue from a read-only readability audit against `main` (`615a8f24f`), guided by the optimize-for-reading guidelines in #8847. ### Problem On the read path, `BufferStream` (`core/core/src/types/read/buffer_stream.rs:36-97`) delegates unchunked streaming reads to `StreamingReader`, which jumps across files to `ReadGenerator` (`core/core/src/types/context/read.rs:182-273`). However: - `StreamingReader` is the only non-test caller of `ReadGenerator` in the workspace. - `BufferStream::new` (`core/core/src/types/read/buffer_stream.rs:336-340`) only constructs `StreamingReader` when `ctx.options().chunk().is_none()` (all chunked reads go through `ChunkedReader`). - Consequently, `ReadGenerator`'s chunk-planning logic (`PlannedRange`, `plan_next_range`, `commit_range`) and its 6 unit tests covering `chunk(3)` are unreachable in production, while duplicating the `PlannedRange` type name used by `ChunkedReader` (`buffer_stream.rs:105`). ### Proposed Change `ReadGenerator`, `StreamingReader`, and `ChunkedReader` are all crate-internal types (not re-exported from `core/core/src/types/mod.rs` or `core/core/src/types/read/mod.rs`). - Inline the single `open(range)` flow directly into `StreamingReader`. - Remove `ReadGenerator` and its unreachable chunking logic/tests from `core/core/src/types/context/read.rs`. ### Coordination Notes - Open PR #8824 currently modifies both `core/core/src/types/context/read.rs` and `core/core/src/types/read/buffer_stream.rs` (adding suffix revalidation to both `ReadGenerator`/`StreamingReader` and `ChunkedReader`). Coordinate with or rebase after #8824 merges so suffix revalidation is preserved cleanly in `StreamingReader` without merge conflicts. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
