Skip to content

feat(io): let FileIO wrap a caller-provided opendal operator#618

Open
jordepic wants to merge 1 commit into
apache:mainfrom
jordepic:fileio-operator-hook
Open

feat(io): let FileIO wrap a caller-provided opendal operator#618
jordepic wants to merge 1 commit into
apache:mainfrom
jordepic:fileio-operator-hook

Conversation

@jordepic

Copy link
Copy Markdown

Purpose

Linked issue: close #616

Storage::build resolves the backing opendal operator through a closed scheme match, so an embedding engine cannot supply its own operator (custom service, metrics/caching layer, preconfigured client). Java Paimon exposes this axis through the FileIO interface, the FileIOLoader SPI, and CatalogContext's preferIO/fallbackIO; this is the minimal Rust analog.

Brief change log

  • FileIOBuilder::with_operator(op) stores a prebuilt opendal::Operator; when set, it takes precedence over scheme resolution in build.
  • Storage::Custom { op } variant carries it through; create() reuses the fs-relative path handling.

Tests

  • cargo test -p paimon --lib io:: (85 tests) passes; the builder path is exercised by the existing FileIO suites plus downstream use in StreamFusion, which drives all its state-table IO through an operator injected here.

API and Format

Additive API on FileIOBuilder; no storage-format change.

Documentation

Doc comments on the new builder method.

Embedders that manage their own storage backend today have no way to
hand it to FileIO: Storage::build is a closed match over registered
schemes. FileIOBuilder::with_operator accepts a prebuilt operator (for
example a customized local-filesystem service) and short-circuits the
scheme dispatch through a new Storage::Custom variant. Paths reach the
operator in scheme-relative form, exactly as the built-in
local-filesystem backend receives them, so the operator's root decides
what they resolve against.
@jordepic

Copy link
Copy Markdown
Author

cc @JingsongLi — this is the minimal Rust analog of Java Paimon's configurable FileIO (FileIOLoader/preferIO); would appreciate your review. #619 is a companion from the same downstream use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FileIO cannot use a caller-provided opendal operator

1 participant