Xuanwo opened a new pull request, #8894: URL: https://github.com/apache/opendal/pull/8894
# Which issue does this PR close? Closes #8848. # Rationale for this change `StreamingReader` is the only caller of `ReadGenerator`, and it is only constructed when `chunk` is unset: `BufferStream::from_range` sends every chunked read to `ChunkedReader`. That left `ReadGenerator`'s chunk planning unreachable in production while splitting the single `open` flow across two modules. # What changes are included in this PR? - Inline the single range `open` into `StreamingReader` and track its pending work with a three-state `PendingRange` (`Range`, `Suffix`, `Opened`). - Preserve the suffix size revalidation added in #8824: the pending revalidation is restored on error, `RpRead` metadata still updates the context, and the revalidated range is still reported to `BufferStream`. - Preserve failure and cancellation semantics: state advances only after `open` succeeds, so a failed or cancelled open retries the same range. - Remove `ReadGenerator`, its chunk-planning types, and the five unit tests that only covered that unreachable chunking path from `core/core/src/types/context/read.rs`. - Add `test_streaming_reader_retries_open_after_error` to keep the single-open retry behavior covered. # Are there any user-facing changes? None. `ReadGenerator`, `StreamingReader`, and `ChunkedReader` are crate-internal and not re-exported. # Breaking changes # AI Usage Statement - Harness: Pi (T3 Code) - Model: DeepSeek - Effort: default - Role: Implemented the refactor, removed the dead chunk-planning path and its tests, and ran formatting, clippy (default, `--no-default-features`, `--all-features`), library tests, doc tests, and the all-features rustdoc build. `ReadGenerator` lived in `core/core/src/types/context/read.rs`, so no separate `read_generator.rs` module existed. The specified plain `cargo doc -p opendal-core --no-deps` fails on a pre-existing broken intra-doc link to `crate::blocking::Lister` when the `blocking` feature is disabled; the all-features doc build validates this change. -- 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]
