From 88a2776db52015c7c32767bdd38b6d072fd1dbd6 Mon Sep 17 00:00:00 2001 From: Islam AbdelRahman Date: Mon, 20 Jun 2016 11:26:25 -0700 Subject: [PATCH] Update SstFileWriter to use bottommost_compression if avaliable Summary: SstFileWriter ignore Options::bottommost_compression, update it to use bottommost_compression if available Test Plan: make check -j64 verified used compression using ./sst_dump Reviewers: sdong Reviewed By: sdong Subscribers: andrewkr, dhruba, yoshinorim Differential Revision: https://reviews.facebook.net/D59841 --- table/sst_file_writer.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/table/sst_file_writer.cc b/table/sst_file_writer.cc index fd70058c8..3cf870d93 100644 --- a/table/sst_file_writer.cc +++ b/table/sst_file_writer.cc @@ -104,10 +104,14 @@ Status SstFileWriter::Open(const std::string& file_path) { return s; } - CompressionType compression_type = r->mutable_cf_options.compression; - if (!r->ioptions.compression_per_level.empty()) { + CompressionType compression_type; + if (r->ioptions.bottommost_compression != kDisableCompressionOption) { + compression_type = r->ioptions.bottommost_compression; + } else if (!r->ioptions.compression_per_level.empty()) { // Use the compression of the last level if we have per level compression compression_type = *(r->ioptions.compression_per_level.rbegin()); + } else { + compression_type = r->mutable_cf_options.compression; } std::vector>