Apply InfoLogLevel to the logs in db/column_family.cc

Summary: Apply InfoLogLevel to the logs in db/column_family.cc

Test Plan: make

Reviewers: ljin, sdong, igor

Reviewed By: igor

Subscribers: dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D27843
This commit is contained in:
Yueh-Hsuan Chiang 2014-10-29 15:11:32 -07:00
parent cda9943f9f
commit 34d436b7db

View File

@ -260,7 +260,8 @@ ColumnFamilyData::ColumnFamilyData(uint32_t id, const std::string& name,
new FIFOCompactionPicker(ioptions_, &internal_comparator_)); new FIFOCompactionPicker(ioptions_, &internal_comparator_));
} }
Log(ioptions_.info_log, "Options for column family \"%s\":\n", Log(InfoLogLevel::INFO_LEVEL,
ioptions_.info_log, "Options for column family \"%s\":\n",
name.c_str()); name.c_str());
const ColumnFamilyOptions* cf_options = &options_; const ColumnFamilyOptions* cf_options = &options_;
cf_options->Dump(ioptions_.info_log); cf_options->Dump(ioptions_.info_log);
@ -331,7 +332,7 @@ void ColumnFamilyData::RecalculateWriteStallConditions(
if (imm()->size() >= mutable_cf_options.max_write_buffer_number) { if (imm()->size() >= mutable_cf_options.max_write_buffer_number) {
write_controller_token_ = write_controller->GetStopToken(); write_controller_token_ = write_controller->GetStopToken();
internal_stats_->AddCFStats(InternalStats::MEMTABLE_COMPACTION, 1); internal_stats_->AddCFStats(InternalStats::MEMTABLE_COMPACTION, 1);
Log(ioptions_.info_log, Log(InfoLogLevel::WARN_LEVEL, ioptions_.info_log,
"[%s] Stopping writes because we have %d immutable memtables " "[%s] Stopping writes because we have %d immutable memtables "
"(waiting for flush), max_write_buffer_number is set to %d", "(waiting for flush), max_write_buffer_number is set to %d",
name_.c_str(), imm()->size(), name_.c_str(), imm()->size(),
@ -340,7 +341,7 @@ void ColumnFamilyData::RecalculateWriteStallConditions(
mutable_cf_options.level0_stop_writes_trigger) { mutable_cf_options.level0_stop_writes_trigger) {
write_controller_token_ = write_controller->GetStopToken(); write_controller_token_ = write_controller->GetStopToken();
internal_stats_->AddCFStats(InternalStats::LEVEL0_NUM_FILES, 1); internal_stats_->AddCFStats(InternalStats::LEVEL0_NUM_FILES, 1);
Log(ioptions_.info_log, Log(InfoLogLevel::WARN_LEVEL, ioptions_.info_log,
"[%s] Stopping writes because we have %d level-0 files", "[%s] Stopping writes because we have %d level-0 files",
name_.c_str(), current_->NumLevelFiles(0)); name_.c_str(), current_->NumLevelFiles(0));
} else if (mutable_cf_options.level0_slowdown_writes_trigger >= 0 && } else if (mutable_cf_options.level0_slowdown_writes_trigger >= 0 &&
@ -352,7 +353,7 @@ void ColumnFamilyData::RecalculateWriteStallConditions(
mutable_cf_options.level0_stop_writes_trigger); mutable_cf_options.level0_stop_writes_trigger);
write_controller_token_ = write_controller->GetDelayToken(slowdown); write_controller_token_ = write_controller->GetDelayToken(slowdown);
internal_stats_->AddCFStats(InternalStats::LEVEL0_SLOWDOWN, slowdown); internal_stats_->AddCFStats(InternalStats::LEVEL0_SLOWDOWN, slowdown);
Log(ioptions_.info_log, Log(InfoLogLevel::WARN_LEVEL, ioptions_.info_log,
"[%s] Stalling writes because we have %d level-0 files (%" PRIu64 "[%s] Stalling writes because we have %d level-0 files (%" PRIu64
"us)", "us)",
name_.c_str(), current_->NumLevelFiles(0), slowdown); name_.c_str(), current_->NumLevelFiles(0), slowdown);
@ -363,7 +364,7 @@ void ColumnFamilyData::RecalculateWriteStallConditions(
write_controller->GetDelayToken(kHardLimitSlowdown); write_controller->GetDelayToken(kHardLimitSlowdown);
internal_stats_->RecordLevelNSlowdown(max_level, kHardLimitSlowdown, internal_stats_->RecordLevelNSlowdown(max_level, kHardLimitSlowdown,
false); false);
Log(ioptions_.info_log, Log(InfoLogLevel::WARN_LEVEL, ioptions_.info_log,
"[%s] Stalling writes because we hit hard limit on level %d. " "[%s] Stalling writes because we hit hard limit on level %d. "
"(%" PRIu64 "us)", "(%" PRIu64 "us)",
name_.c_str(), max_level, kHardLimitSlowdown); name_.c_str(), max_level, kHardLimitSlowdown);
@ -374,7 +375,7 @@ void ColumnFamilyData::RecalculateWriteStallConditions(
mutable_cf_options.hard_rate_limit); mutable_cf_options.hard_rate_limit);
write_controller_token_ = write_controller->GetDelayToken(slowdown); write_controller_token_ = write_controller->GetDelayToken(slowdown);
internal_stats_->RecordLevelNSlowdown(max_level, slowdown, true); internal_stats_->RecordLevelNSlowdown(max_level, slowdown, true);
Log(ioptions_.info_log, Log(InfoLogLevel::WARN_LEVEL, ioptions_.info_log,
"[%s] Stalling writes because we hit soft limit on level %d (%" PRIu64 "[%s] Stalling writes because we hit soft limit on level %d (%" PRIu64
"us)", "us)",
name_.c_str(), max_level, slowdown); name_.c_str(), max_level, slowdown);