From 167fb919a55e8dc5d12d4debe7965208029e3505 Mon Sep 17 00:00:00 2001 From: sdong Date: Wed, 16 Dec 2015 16:05:59 -0800 Subject: [PATCH] ZSTD to use CompressionOptions.level Summary: Now ZSTD hard code level 1. Change it to use the compression level setting. Test Plan: Run it with hacked codes of sst_dump and show ZSTD compression sizes with different levels. Reviewers: rven, anthony, yhchiang, kradhakrishnan, igor, IslamAbdelRahman Reviewed By: IslamAbdelRahman Subscribers: yoshinorim, leveldb, dhruba Differential Revision: https://reviews.facebook.net/D52041 --- util/compression.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/compression.h b/util/compression.h index 691bf1e69..ac285e5f1 100644 --- a/util/compression.h +++ b/util/compression.h @@ -620,7 +620,7 @@ inline bool ZSTD_Compress(const CompressionOptions& opts, const char* input, size_t compressBound = ZSTD_compressBound(length); output->resize(static_cast(output_header_len + compressBound)); size_t outlen = ZSTD_compress(&(*output)[output_header_len], compressBound, - input, length, 1 /* level */); + input, length, opts.level); if (outlen == 0) { return false; }