Dump compression info on startup

Summary: It's useful to know if we have compression support or no

Test Plan:
Observed this in my LOG:

      2015/03/26-10:34:35.460681 7f5b322b7840 Snappy supported
      2015/03/26-10:34:35.460682 7f5b322b7840 Zlib supported
      2015/03/26-10:34:35.460686 7f5b322b7840 Bzip supported
      2015/03/26-10:34:35.460687 7f5b322b7840 LZ4 NOT supported

Reviewers: sdong, yhchiang

Reviewed By: yhchiang

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D35955
This commit is contained in:
Igor Canadi 2015-03-26 11:22:20 -07:00
parent 3539e06448
commit 030859eb5d

View File

@ -191,6 +191,30 @@ CompressionType GetCompressionFlush(const ImmutableCFOptions& ioptions) {
return kNoCompression; return kNoCompression;
} }
} }
void DumpCompressionInfo(Logger* logger) {
Log(InfoLogLevel::INFO_LEVEL, logger, "Snappy "
#ifndef SNAPPY
"NOT "
#endif
"supported");
Log(InfoLogLevel::INFO_LEVEL, logger, "Zlib "
#ifndef ZLIB
"NOT "
#endif
"supported");
Log(InfoLogLevel::INFO_LEVEL, logger, "Bzip "
#ifndef BZIP2
"NOT "
#endif
"supported");
Log(InfoLogLevel::INFO_LEVEL, logger, "LZ4 "
#ifndef LZ4
"NOT "
#endif
"supported");
}
} // namespace } // namespace
DBImpl::DBImpl(const DBOptions& options, const std::string& dbname) DBImpl::DBImpl(const DBOptions& options, const std::string& dbname)
@ -251,6 +275,7 @@ DBImpl::DBImpl(const DBOptions& options, const std::string& dbname)
DumpRocksDBBuildVersion(db_options_.info_log.get()); DumpRocksDBBuildVersion(db_options_.info_log.get());
DumpDBFileSummary(db_options_, dbname_); DumpDBFileSummary(db_options_, dbname_);
db_options_.Dump(db_options_.info_log.get()); db_options_.Dump(db_options_.info_log.get());
DumpCompressionInfo(db_options_.info_log.get());
LogFlush(db_options_.info_log); LogFlush(db_options_.info_log);
} }