Skip to content

Add ability to create zstd compressor with compression level #4203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DracoLi
Copy link
Contributor

@DracoLi DracoLi commented Aug 22, 2025

Why this should be merged

Blockdb supports zstd compression for blocks, but it needs a non-default compression level (default is level 5).

How this works

This PR adds a NewZstdCompressorWithLevel function to enable zstd compression with a custom level.

How this was tested

Unit tests and blockdb tests in #4201

Need to be documented in RELEASES.md?

Don't think so

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds the ability to create a zstd compressor with a custom compression level to support blockdb's requirement for non-default compression levels.

  • Introduces NewZstdCompressorWithLevel function that accepts a compression level parameter
  • Refactors existing NewZstdCompressor to use the new function with default compression level
  • Updates the compressor to use zstd.CompressLevel instead of zstd.Compress

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
utils/compression/zstd_compressor.go Adds new constructor with level parameter and updates compression logic
utils/compression/compressor_test.go Adds test coverage for the new constructor function

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant