Print compaction_options_universal.stop_style in LOG file

Summary:
Print compaction_options_universal.stop_style in LOG file
./db_bench --benchmarks=fillseq and read the log
Closes https://github.com/facebook/rocksdb/pull/2268

Differential Revision: D5032438

Pulled By: lightmark

fbshipit-source-id: 0e72fcd96a1caaf3cab20e86d39c75fbebf5ce37
This commit is contained in:
Aaron Gao 2017-05-09 15:44:48 -07:00 committed by Facebook Github Bot
parent 4897eb250b
commit df035b6826
2 changed files with 21 additions and 3 deletions

View File

@ -312,7 +312,7 @@ void ColumnFamilyOptions::Dump(Logger* log) const {
str_compaction_style = it_compaction_style->second;
}
ROCKS_LOG_HEADER(log,
" Options.compaction_style: %s",
" Options.compaction_style: %s",
str_compaction_style.c_str());
const auto& it_compaction_pri =
@ -325,10 +325,10 @@ void ColumnFamilyOptions::Dump(Logger* log) const {
str_compaction_pri = it_compaction_pri->second;
}
ROCKS_LOG_HEADER(log,
" Options.compaction_pri: %s",
" Options.compaction_pri: %s",
str_compaction_pri.c_str());
ROCKS_LOG_HEADER(log,
" Options.compaction_options_universal.size_ratio: %u",
"Options.compaction_options_universal.size_ratio: %u",
compaction_options_universal.size_ratio);
ROCKS_LOG_HEADER(log,
"Options.compaction_options_universal.min_merge_width: %u",
@ -345,6 +345,19 @@ void ColumnFamilyOptions::Dump(Logger* log) const {
log,
"Options.compaction_options_universal.compression_size_percent: %d",
compaction_options_universal.compression_size_percent);
const auto& it_compaction_stop_style = compaction_stop_style_to_string.find(
compaction_options_universal.stop_style);
std::string str_compaction_stop_style;
if (it_compaction_stop_style == compaction_stop_style_to_string.end()) {
assert(false);
str_compaction_stop_style =
"unknown_" + std::to_string(compaction_options_universal.stop_style);
} else {
str_compaction_stop_style = it_compaction_stop_style->second;
}
ROCKS_LOG_HEADER(log,
"Options.compaction_options_universal.stop_style: %s",
str_compaction_stop_style.c_str());
ROCKS_LOG_HEADER(
log, "Options.compaction_options_fifo.max_table_files_size: %" PRIu64,
compaction_options_fifo.max_table_files_size);

View File

@ -37,6 +37,11 @@ static std::map<CompactionPri, std::string> compaction_pri_to_string = {
{kOldestSmallestSeqFirst, "kOldestSmallestSeqFirst"},
{kMinOverlappingRatio, "kMinOverlappingRatio"}};
static std::map<CompactionStopStyle, std::string>
compaction_stop_style_to_string = {
{kCompactionStopStyleSimilarSize, "kCompactionStopStyleSimilarSize"},
{kCompactionStopStyleTotalSize, "kCompactionStopStyleTotalSize"}};
#ifndef ROCKSDB_LITE
Status GetMutableOptionsFromStrings(