Xuanwo opened a new pull request, #8893:
URL: https://github.com/apache/opendal/pull/8893
# Which issue does this PR close?
Part of #8850.
Part of #8851.
# Rationale for this change
`opendal-layer-foyer` and `opendal-layer-retry` still carried legacy private
`fn layer()` trampolines, unnecessary `#[doc(hidden)] pub` visibility on
crate-internal service and wrapper types, a throwaway `Arc<Inner>` allocation
in `FoyerService::rename`, and an unreachable `oio::ReadStream` implementation
on `RetryWrapper`. Cleaning up both layer crates removes indirection and dead
code without changing their user-facing APIs.
# What changes are included in this PR?
- `core/layers/foyer`:
- Inline `FoyerService` construction directly into `Layer::apply_service`
and remove the leftover `FoyerLayer::layer` trampoline.
- Drop `#[doc(hidden)] pub` visibility on crate-internal types with zero
external references (`FoyerService`, `Deleter`, `Writer`, and `FullReader`) and
remove the `pub use` re-exports of `Deleter` and `Writer` while keeping
`FoyerLayer`, `FoyerKey`, and `FoyerValue` public.
- Remove the temporary `Arc<Inner>` allocation in `FoyerService::rename`
by invalidating both unversioned keys directly through
`self.deleted_keys.invalidate(&self.cache, &[...], &[])`.
- Update crate-internal tests in `src/lib.rs` to call
`Layer::apply_service` and `DeletedKeys::invalidate` directly, and remove the
obsolete `operation_types_remain_available` compile-time test from
`tests/cache_invalidation.rs` that asserted the former `#[doc(hidden)] pub`
exports.
- `core/layers/retry`:
- Inline `RetryService` construction directly into `Layer::apply_service`
and remove the leftover `RetryLayer::layer` trampoline.
- Drop `#[doc(hidden)] pub` visibility on crate-internal types with zero
external references (`RetryService`, `RetryReader`, `RetryReadStream`,
`RetryWrapper`) while keeping `RetryLayer`, `RetryBudget`, `RetryEvent`,
`RetryInterceptor`, and `DefaultRetryInterceptor` public.
- Remove the dead `impl oio::ReadStream for RetryWrapper` (unused because
`RetryReader` returns `RetryReadStream`).
# Are there any user-facing changes?
None. Only crate-internal `#[doc(hidden)]` wrapper types and unused internal
code were changed.
# Breaking changes
# AI Usage Statement
- Harness: pi / T3 Code
- Model: Gemini 4 Neon
- Effort: High
- Role: Audited workspace references, implemented the `opendal-layer-foyer`
and `opendal-layer-retry` cleanups, and updated crate tests.
--
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]