DB::DumpSupportInfo should log all supported compression types

Summary:
DB::DumpSupportInfo should log all supported compression types.
Closes #3146
Closes https://github.com/facebook/rocksdb/pull/3396

Differential Revision: D6777019

Pulled By: yiwu-arbug

fbshipit-source-id: 5b17f1ffb2d71224e52f7d9c045434746c789fb0
main
Yi Wu 7 years ago committed by Facebook Github Bot
parent ec0167eecb
commit edc258127e
  1. 14
      db/db_impl.cc
  2. 2
      db/malloc_stats.cc
  3. 25
      options/options_helper.cc
  4. 4
      options/options_helper.h

@ -123,13 +123,13 @@ CompressionType GetCompressionFlush(
namespace { namespace {
void DumpSupportInfo(Logger* logger) { void DumpSupportInfo(Logger* logger) {
ROCKS_LOG_HEADER(logger, "Compression algorithms supported:"); ROCKS_LOG_HEADER(logger, "Compression algorithms supported:");
ROCKS_LOG_HEADER(logger, "\tSnappy supported: %d", Snappy_Supported()); for (auto& compression : OptionsHelper::compression_type_string_map) {
ROCKS_LOG_HEADER(logger, "\tZlib supported: %d", Zlib_Supported()); if (compression.second != kNoCompression &&
ROCKS_LOG_HEADER(logger, "\tBzip supported: %d", BZip2_Supported()); compression.second != kDisableCompressionOption) {
ROCKS_LOG_HEADER(logger, "\tLZ4 supported: %d", LZ4_Supported()); ROCKS_LOG_HEADER(logger, "\t%s supported: %d", compression.first.c_str(),
ROCKS_LOG_HEADER(logger, "\tZSTDNotFinal supported: %d", CompressionTypeSupported(compression.second));
ZSTDNotFinal_Supported()); }
ROCKS_LOG_HEADER(logger, "\tZSTD supported: %d", ZSTD_Supported()); }
ROCKS_LOG_HEADER(logger, "Fast CRC32 supported: %s", ROCKS_LOG_HEADER(logger, "Fast CRC32 supported: %s",
crc32c::IsFastCrc32Supported().c_str()); crc32c::IsFastCrc32Supported().c_str());
} }

@ -22,7 +22,7 @@ namespace rocksdb {
#else #else
#include "jemalloc/jemalloc.h" #include "jemalloc/jemalloc.h"
#endif #endif
typedef struct { typedef struct {
char* cur; char* cur;
char* end; char* end;

@ -208,6 +208,18 @@ std::unordered_map<std::string, ChecksumType>
{"kCRC32c", kCRC32c}, {"kCRC32c", kCRC32c},
{"kxxHash", kxxHash}}; {"kxxHash", kxxHash}};
std::unordered_map<std::string, CompressionType>
OptionsHelper::compression_type_string_map = {
{"kNoCompression", kNoCompression},
{"kSnappyCompression", kSnappyCompression},
{"kZlibCompression", kZlibCompression},
{"kBZip2Compression", kBZip2Compression},
{"kLZ4Compression", kLZ4Compression},
{"kLZ4HCCompression", kLZ4HCCompression},
{"kXpressCompression", kXpressCompression},
{"kZSTD", kZSTD},
{"kZSTDNotFinalCompression", kZSTDNotFinalCompression},
{"kDisableCompressionOption", kDisableCompressionOption}};
#ifndef ROCKSDB_LITE #ifndef ROCKSDB_LITE
template <typename T> template <typename T>
@ -1476,19 +1488,6 @@ std::unordered_map<std::string, OptionTypeInfo>
{0, OptionType::kBoolean, OptionVerificationType::kDeprecated, false, {0, OptionType::kBoolean, OptionVerificationType::kDeprecated, false,
0}}}; 0}}};
std::unordered_map<std::string, CompressionType>
OptionsHelper::compression_type_string_map = {
{"kNoCompression", kNoCompression},
{"kSnappyCompression", kSnappyCompression},
{"kZlibCompression", kZlibCompression},
{"kBZip2Compression", kBZip2Compression},
{"kLZ4Compression", kLZ4Compression},
{"kLZ4HCCompression", kLZ4HCCompression},
{"kXpressCompression", kXpressCompression},
{"kZSTD", kZSTD},
{"kZSTDNotFinalCompression", kZSTDNotFinalCompression},
{"kDisableCompressionOption", kDisableCompressionOption}};
std::unordered_map<std::string, BlockBasedTableOptions::IndexType> std::unordered_map<std::string, BlockBasedTableOptions::IndexType>
OptionsHelper::block_base_table_index_type_string_map = { OptionsHelper::block_base_table_index_type_string_map = {
{"kBinarySearch", BlockBasedTableOptions::IndexType::kBinarySearch}, {"kBinarySearch", BlockBasedTableOptions::IndexType::kBinarySearch},

@ -144,6 +144,8 @@ struct OptionsHelper {
static std::map<CompactionStopStyle, std::string> static std::map<CompactionStopStyle, std::string>
compaction_stop_style_to_string; compaction_stop_style_to_string;
static std::unordered_map<std::string, ChecksumType> checksum_type_string_map; static std::unordered_map<std::string, ChecksumType> checksum_type_string_map;
static std::unordered_map<std::string, CompressionType>
compression_type_string_map;
#ifndef ROCKSDB_LITE #ifndef ROCKSDB_LITE
static std::unordered_map<std::string, OptionTypeInfo> cf_options_type_info; static std::unordered_map<std::string, OptionTypeInfo> cf_options_type_info;
static std::unordered_map<std::string, OptionTypeInfo> static std::unordered_map<std::string, OptionTypeInfo>
@ -155,8 +157,6 @@ struct OptionsHelper {
static std::unordered_map<std::string, OptionTypeInfo> db_options_type_info; static std::unordered_map<std::string, OptionTypeInfo> db_options_type_info;
static std::unordered_map<std::string, OptionTypeInfo> static std::unordered_map<std::string, OptionTypeInfo>
lru_cache_options_type_info; lru_cache_options_type_info;
static std::unordered_map<std::string, CompressionType>
compression_type_string_map;
static std::unordered_map<std::string, BlockBasedTableOptions::IndexType> static std::unordered_map<std::string, BlockBasedTableOptions::IndexType>
block_base_table_index_type_string_map; block_base_table_index_type_string_map;
static std::unordered_map<std::string, EncodingType> encoding_type_string_map; static std::unordered_map<std::string, EncodingType> encoding_type_string_map;

Loading…
Cancel
Save