Xuanwo opened a new pull request, #9061:
URL: https://github.com/apache/opendal/pull/9061
# Which issue does this PR close?
Related to #6871 and #8526. This PR proposes the RFC for design review and
community consensus; implementation PRs will follow after acceptance.
# Rationale for this change
RFC 7740 reorganized `Operator` into three explicit planes (`Service`,
`OperationContext`, and an ordered list of `Layer`s replayed in a single fold),
and RFC 7749 decoupled `opendal-core` from concrete HTTP clients behind
`HttpTransport` / `HttpTransporter`.
String-based operator construction (`Operator::from_uri`,
`Operator::via_iter`, and `OperatorRegistry::load`) still configures only the
service plane:
1. Non-Rust bindings (Python, Node.js, Java, C, etc.) cannot configure
per-operator HTTP settings such as `proxy`, `no_proxy`, or HTTP timeouts
without relying on process-wide environment variables (#6871).
2. Layers cannot be declared or configured through a URI or key-value map
without adding per-layer FFI bindings in every language.
3. Modeling HTTP transport configuration as a transport-replacing `Layer`
(#8526) would reintroduce hidden layer-order dependence broken out by RFC 7740
(dropping wrappers from earlier layers such as `ConcurrentLimitLayer` or
`TracingLayer` and overriding an explicit `Operator::with_context`).
# What changes are included in this PR?
- Adds the Unified Operator Configuration RFC
(`core/core/src/docs/rfcs/0000_unified_operator_config.md`, registered in
`core/core/src/docs/rfcs/mod.rs`), proposing:
- A flat, case-insensitive namespace split across the three RFC 7740
planes: unprefixed `<field>` for service config, `context.<name>.<field>` for
`OperationContext` slots (starting with `context.http.*`), and `layers` /
`layer.<name>.<field>` for ordered user layers.
- Minimal `opendal-core` API addition: only two methods on
`OperatorRegistry` (`register_context` and `register_layer`) and zero new
public types (`opendal-http-transport-reqwest` parses `context.http.*` via
`ConfigDeserializer` and preserves the incoming `OperationContext` unchanged
when no recognized key is set).
- Symmetric error semantics across all three planes (`Unsupported` for
unregistered components, `ConfigInvalid` for malformed keys/values, ignore
unknown fields inside registered components without side effects).
- Consistent assembly sharing `Operator::new`'s default layers and RFC
7740 single-fold replay, plus minimal binding alignment (fixing Java
`op.context()` to `op.base_context()`, preserving C `opendal_operator_new`, and
zero FFI changes for Python / Node.js).
# Are there any user-facing changes?
Documentation (RFC) only; no runtime or public API changes in this PR.
# Breaking changes
<!-- None; this PR only adds an RFC document. -->
# AI Usage Statement
- **Harness:** pi coding agent
- **Model:** Gemini 4 Neon
- **Effort:** high
- **Role:** Analyzed RFC 7740/7749, `OperatorRegistry`, `OperationContext`,
`opendal-http-transport-reqwest`, layers, and language bindings (`python`,
`nodejs`, `java`, `c`); drafted and iterated on the RFC document and ran `cargo
fmt`, `cargo doc --all-features`, `cargo test --doc`, and `typos` checks.
**Assumptions / unknowns affecting review:** Whether
`Operator::from_iter::<B>` stays service-only remains open in `# Unresolved
questions` for maintainer consensus.
--
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]