You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opendal.apache.org by "Xuanwo (via GitHub)" <gi...@apache.org> on 2026/06/18 08:42:00 UTC
[PR] refactor(core): lazy open positioned read handles [opendal]
Xuanwo opened a new pull request, #7796:
URL: https://github.com/apache/opendal/pull/7796
# Which issue does this PR close?
N/A.
# Rationale for this change
The recent read refactor made `Service::read` a no-IO handle creator, but several file-backed services still opened the underlying file handle from their range read paths. That changed the intended behavior for services that can reuse a cursor-independent positioned read handle.
This change moves lazy handle initialization into `PositionReader` so services only need to implement `PositionRead`. The positioned handle is opened on first use and reused for later `read_at` calls within the same reader.
# What changes are included in this PR?
- Extend `PositionRead` with an associated opened handle and an `open` method.
- Cache the opened handle inside `PositionReader` with `mea::once::OnceCell`.
- Update fs, compfs, hdfs, hdfs-native, and monoiofs to implement only `PositionRead` for positioned reads.
- Move hdfs reads from `async_open + seek` streaming to `hdrs::File::read_at` on a reusable handle.
# Are there any user-facing changes?
No public API changes. This restores the intended internal behavior for reusable positioned read handles in file-backed services.
# AI Usage Statement
This PR was implemented with assistance from OpenAI Codex.
# Validation
- `cargo fmt --all`
- `CARGO_TARGET_DIR=/tmp/opendal-a260-target-pr cargo check -p opendal-service-fs -p opendal-service-compfs -p opendal-service-hdfs -p opendal-service-hdfs-native -p opendal-service-monoiofs`
- `CARGO_TARGET_DIR=/tmp/opendal-a260-target-pr cargo clippy -p opendal-service-fs -p opendal-service-compfs -p opendal-service-hdfs -p opendal-service-hdfs-native -p opendal-service-monoiofs --all-targets -- -D warnings`
- `git diff --check`
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] refactor(core): lazy open positioned read handles [opendal]
Posted by "Xuanwo (via GitHub)" <gi...@apache.org>.
Xuanwo merged PR #7796:
URL: https://github.com/apache/opendal/pull/7796
--
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: commits-unsubscribe@opendal.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org