Skip to content
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

Task AB#1355841: [LevelDB] - Add ZlibRaw Compression Support #12

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

yabmek-msft
Copy link
Collaborator

@yabmek-msft yabmek-msft commented Jan 30, 2025

https://dev-mc.visualstudio.com/Minecraft/_workitems/edit/1355841

The compression, know as inflate in leveldb-mcpe, and decompression implementation was moved from leveldb-mcpe https://github.com/Mojang/leveldb-mcpe/blob/0382f10e9d295896eecfb729f2e852d6fdb4bb07/db/zlib_compressor.cc with a few minor modifications to match the native compression and decompression functions in leveldb(snappy and zstd):

  • both compression and decompression function now return a bool
  • asserts in compression function replaced with a return false for failure and true for success.
  • logic that returned error code number in decompression function now returns true for success or false for failure
  • raw parameter was added to both compression and decompression functions to allow for raw compression as needed (excludes zlib headers and trailers)
  • level parameter was added to compression function which allows for adjustment of compression level
  • output parameter of compression and decompression functions was changed from string reference to a string pointer

The calling of the compression and decompression functions done in table_builder.cc and format.cc respectively was moved from leveldb-mcpe https://github.com/Mojang/leveldb-mcpe/blob/0382f10e9d295896eecfb729f2e852d6fdb4bb07/table/format.cc and https://github.com/Mojang/leveldb-mcpe/blob/0382f10e9d295896eecfb729f2e852d6fdb4bb07/table/table_builder.cc. The use of the custom compressor system is excluded.

@yabmek-msft yabmek-msft requested review from a team and rohunMS January 30, 2025 09:26
@yabmek-msft yabmek-msft marked this pull request as ready for review January 30, 2025 09:39
@yabmek-msft yabmek-msft changed the title Task AB#: [LevelDB] - Add ZlibRaw Compression Support Task AB# 1355841: [LevelDB] - Add ZlibRaw Compression Support Jan 30, 2025
@yabmek-msft yabmek-msft changed the title Task AB# 1355841: [LevelDB] - Add ZlibRaw Compression Support Task AB#1355841: [LevelDB] - Add ZlibRaw Compression Support Jan 30, 2025
@yabmek-msft yabmek-msft requested review from a team January 31, 2025 00:57
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.

1 participant