Skip to content

feat!(runtime): Support custom Runtime in Catalog#2308

Open
CTTY wants to merge 15 commits intoapache:mainfrom
CTTY:ctty/runtime-api
Open

feat!(runtime): Support custom Runtime in Catalog#2308
CTTY wants to merge 15 commits intoapache:mainfrom
CTTY:ctty/runtime-api

Conversation

@CTTY
Copy link
Copy Markdown
Collaborator

@CTTY CTTY commented Apr 2, 2026

Which issue does this PR close?

What changes are included in this PR?

  • Introduced RuntimeHandle
  • Refactored Runtime to compose two RuntimeHandles: one for IO-bound work (io()) and one for CPU-bound work (cpu()).
  • Added with_runtime to CatalogBuilder trait

Are these changes tested?

Yes

.metadata(metadata)
.metadata_location(metadata_location)
.identifier(table_ident)
.file_io(file_io.clone())
Copy link
Copy Markdown
Collaborator Author

@CTTY CTTY Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should pass runtime here as well, need to revisit

We can add a builder to IcebergTableProviderFactory and add with_runtime there. But I feel like this can be a separate effort

Comment thread crates/iceberg/src/runtime/mod.rs Outdated
Comment thread crates/iceberg/src/runtime/mod.rs Outdated
@CTTY CTTY changed the title feat(runtime): Support custom Runtime in Catalog feat!(runtime): Support custom Runtime in Catalog Apr 13, 2026
@CTTY CTTY marked this pull request as ready for review April 13, 2026 23:49
Copy link
Copy Markdown
Contributor

@blackmwk blackmwk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @CTTY , generally looks good!

Comment thread crates/iceberg/src/runtime/mod.rs Outdated
Comment thread crates/iceberg/src/runtime/mod.rs Outdated
Comment thread crates/iceberg/src/runtime/mod.rs Outdated
Comment thread crates/iceberg/src/runtime/mod.rs
@CTTY CTTY force-pushed the ctty/runtime-api branch from 001b61b to 2ab8d46 Compare April 29, 2026 23:57
Comment thread crates/iceberg/src/runtime/mod.rs Outdated
T: Send + 'static,
{
JoinHandle(task::spawn_blocking(f))
impl Default for Runtime {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we should not implement Default

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed Default. but I also think an infallible function to build a Runtime instance would be convenient.

I've splitted try_from_current into try_current() and current(). The naming matches better with tokio's naming as well.

Please let me know your thoughts!

Comment thread crates/iceberg/src/runtime/mod.rs Outdated
Comment thread crates/iceberg/src/runtime/mod.rs
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.

[DISCUSSION] Runtime support enhancement

2 participants