Skip to content

feat: Factor out CompressionCodec to common location and add Gzip#2081

Merged
liurenjie1024 merged 3 commits intoapache:mainfrom
emkornfield:factor_out_codec
Jan 29, 2026
Merged

feat: Factor out CompressionCodec to common location and add Gzip#2081
liurenjie1024 merged 3 commits intoapache:mainfrom
emkornfield:factor_out_codec

Conversation

@emkornfield
Copy link
Contributor

@emkornfield emkornfield commented Jan 29, 2026

Which issue does this PR close?

As discussed in the PR for allowing compressed metadata.json writes we want CompressionCodec in a central place so it can be used in puffin and for other compression use-cases. Happy to move it to spec/ as suggested in the original comment but this seemed more natural.

What changes are included in this PR?

This moves compression.rs to a top level (seems like the best location for common code but please let me know if there is a better place.

  • It adds Gzip as a compression option and replaces current direct use the GzEncoder package.
  • It adds validation to puffin that Gzip is not currently supported (per spec)

Are these changes tested?

Added unit tests to cover additions and existing tests cover the rest.

1. Refactor compression to be top level so it can be used for other use
   cases.
2. Add GZIP encoder and consolidate existing Gzip code into framework.
@emkornfield emkornfield changed the title feat: Factor out codec feat: Factor out CompressionCodec to common location and add Gzip Jan 29, 2026
@emkornfield
Copy link
Contributor Author

CC @liurenjie1024

Copy link
Contributor

@liurenjie1024 liurenjie1024 left a comment

Choose a reason for hiding this comment

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

Thanks @emkornfield for this pr, it looks great!

@liurenjie1024 liurenjie1024 merged commit f93f013 into apache:main Jan 29, 2026
17 checks passed
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