@@ -1460,7 +1460,7 @@ Status DBImpl::FlushMemTableToOutputFile(bool* madeProgress,
1460
1460
s = imm_.InstallMemtableFlushResults(
1461
1461
mems, versions_.get(), &mutex_, options_.info_log.get(), file_number,
1462
1462
pending_outputs_, &deletion_state.memtables_to_free,
1463
- db_directory_.get());
1463
+ db_directory_.get(), log_buffer );
1464
1464
}
1465
1465
1466
1466
if (s.ok()) {
@@ -2013,9 +2013,10 @@ Status DBImpl::BackgroundFlush(bool* madeProgress,
2013
2013
LogBuffer* log_buffer) {
2014
2014
Status stat;
2015
2015
while (stat.ok() && imm_.IsFlushPending()) {
2016
- Log(options_.info_log,
2017
- "BackgroundCallFlush doing FlushMemTableToOutputFile, flush slots available %d",
2018
- options_.max_background_flushes - bg_flush_scheduled_);
2016
+ LogToBuffer(log_buffer,
2017
+ "BackgroundCallFlush doing FlushMemTableToOutputFile, "
2018
+ "flush slots available %d",
2019
+ options_.max_background_flushes - bg_flush_scheduled_);
2019
2020
stat = FlushMemTableToOutputFile(madeProgress, deletion_state, log_buffer);
2020
2021
}
2021
2022
return stat;
@@ -2461,7 +2462,8 @@ Status DBImpl::FinishCompactionOutputFile(CompactionState* compact,
2461
2462
}
2462
2463
2463
2464
2464
- Status DBImpl::InstallCompactionResults(CompactionState* compact) {
2465
+ Status DBImpl::InstallCompactionResults(CompactionState* compact,
2466
+ LogBuffer* log_buffer) {
2465
2467
mutex_.AssertHeld();
2466
2468
2467
2469
// paranoia: verify that the files that we started with
@@ -2477,11 +2479,10 @@ Status DBImpl::InstallCompactionResults(CompactionState* compact) {
2477
2479
return Status::Corruption("Compaction input files inconsistent");
2478
2480
}
2479
2481
2480
- Log(options_.info_log, "Compacted %d@%d + %d@%d files => %lld bytes",
2481
- compact->compaction->num_input_files(0),
2482
- compact->compaction->level(),
2483
- compact->compaction->num_input_files(1),
2484
- compact->compaction->level() + 1,
2482
+ LogToBuffer(
2483
+ log_buffer, "Compacted %d@%d + %d@%d files => %lld bytes",
2484
+ compact->compaction->num_input_files(0), compact->compaction->level(),
2485
+ compact->compaction->num_input_files(1), compact->compaction->level() + 1,
2485
2486
static_cast<long long>(compact->total_bytes));
2486
2487
2487
2488
// Add compaction outputs
@@ -2905,17 +2906,16 @@ Status DBImpl::DoCompactionWork(CompactionState* compact,
2905
2906
bool prefix_initialized = false;
2906
2907
2907
2908
int64_t imm_micros = 0; // Micros spent doing imm_ compactions
2908
- Log(options_.info_log,
2909
- "Compacting %d@%d + %d@%d files, score %.2f slots available %d",
2910
- compact->compaction->num_input_files(0),
2911
- compact->compaction->level(),
2912
- compact->compaction->num_input_files(1),
2913
- compact->compaction->output_level(),
2914
- compact->compaction->score(),
2915
- options_.max_background_compactions - bg_compaction_scheduled_);
2909
+ LogToBuffer(log_buffer,
2910
+ "Compacting %d@%d + %d@%d files, score %.2f slots available %d",
2911
+ compact->compaction->num_input_files(0),
2912
+ compact->compaction->level(),
2913
+ compact->compaction->num_input_files(1),
2914
+ compact->compaction->output_level(), compact->compaction->score(),
2915
+ options_.max_background_compactions - bg_compaction_scheduled_);
2916
2916
char scratch[2345];
2917
2917
compact->compaction->Summary(scratch, sizeof(scratch));
2918
- Log(options_.info_log , "Compaction start summary: %s\n", scratch);
2918
+ LogToBuffer(log_buffer , "Compaction start summary: %s\n", scratch);
2919
2919
2920
2920
assert(versions_->current()->NumLevelFiles(compact->compaction->level()) > 0);
2921
2921
assert(compact->builder == nullptr);
@@ -3173,11 +3173,12 @@ Status DBImpl::DoCompactionWork(CompactionState* compact,
3173
3173
ReleaseCompactionUnusedFileNumbers(compact);
3174
3174
3175
3175
if (status.ok()) {
3176
- status = InstallCompactionResults(compact);
3176
+ status = InstallCompactionResults(compact, log_buffer );
3177
3177
InstallSuperVersion(deletion_state);
3178
3178
}
3179
3179
Version::LevelSummaryStorage tmp;
3180
- Log(options_.info_log,
3180
+ LogToBuffer(
3181
+ log_buffer,
3181
3182
"compacted to: %s, %.1f MB/sec, level %d, files in(%d, %d) out(%d) "
3182
3183
"MB in(%.1f, %.1f) out(%.1f), read-write-amplify(%.1f) "
3183
3184
"write-amplify(%.1f) %s\n",
0 commit comments