Skip to content

chore(refactor) refactor manifest list writer to take Box<dyn FileWrite> to prep for encryption#2564

Merged
blackmwk merged 8 commits into
apache:mainfrom
xanderbailey:xb/refactor_manifest_list_writer
Jun 4, 2026
Merged

chore(refactor) refactor manifest list writer to take Box<dyn FileWrite> to prep for encryption#2564
blackmwk merged 8 commits into
apache:mainfrom
xanderbailey:xb/refactor_manifest_list_writer

Conversation

@xanderbailey
Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Working towards: #2034

What changes are included in this PR?

Change ManifestListWriter to take a Box<dyn FileWrite> in the constructor rather than an OutputFile. For encryption support we have EncryptedOutputFile which has a Box<dyn FileWrite> for transparent streaming encryption on write.

Are these changes tested?

@xanderbailey xanderbailey force-pushed the xb/refactor_manifest_list_writer branch from eeb7f21 to 3a5e3a6 Compare June 2, 2026 11:55
self.table.metadata().current_snapshot_id(),
next_seq_num,
),
FormatVersion::V3 => ManifestListWriter::v3(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Alternative to this would be adding a v3_encrypted constructor and leave all other constructors alone and then ManifestListWriter internally stores a pinned future to a file writer similar to the approach proposed in #2568 but honestly I think this API break is acceptable and keeps constructors uniform. The worry with introducing a new constructor here for v3_encrypted is it's easy for future contributors to misuse the api and "forget" to encrypt things correctly.

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.

Sounds reasonable to me.

blackmwk pushed a commit that referenced this pull request Jun 4, 2026
…ite> and location (#2568)

## Which issue does this PR close?

<!--
We generally require a GitHub issue to be filed for all bug fixes and
enhancements and this helps us generate change logs for our releases.
You can link an issue to this PR using the GitHub syntax. For example
`Closes #123` indicates that this PR will close issue #123.
-->

Working towards: #2034

## What changes are included in this PR?
Similar reasons to #2564. For
the current encryption work we will construct a FileWrite to do
transparent encryption on write, this means we need to change the
constructor of the `ManifestWriterBuilder` to now take both a `Box<dyn
FileWrite>` and a `location`.
<!--
Provide a summary of the modifications in this PR. List the main changes
such as new features, bug fixes, refactoring, or any other updates.
-->

## Are these changes tested?

<!--
Specify what test covers (unit test, integration test, etc.).

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
-->
@blackmwk
Copy link
Copy Markdown
Contributor

blackmwk commented Jun 4, 2026

Please help to resolve conflicts.

…/refactor_manifest_list_writer

Resolve conflict from b60717a (manifest_list split into modules)
by applying FileWrite refactor to the new writer.rs file.
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 @xanderbailey for this pr!

@blackmwk blackmwk merged commit d32c234 into apache:main Jun 4, 2026
21 checks passed
SreeramGarlapati added a commit to SreeramGarlapati/iceberg-rust that referenced this pull request Jun 4, 2026
…r API

Upstream apache#2564 changed `ManifestListWriter::v1/v2/v3` to take
`Box<dyn FileWrite>` instead of `OutputFile` (to prep for encryption).
Mirror sibling `transaction/snapshot.rs` by extracting the writer ahead
of the format-version match.
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.

2 participants