Remove an unused parameter (#4816)

Summary:
The `flush_reason` parameter in `DBImpl::InstallSuperVersionAndScheduleWork` is
not used. Remove it.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4816

Differential Revision: D13543218

Pulled By: riversand963

fbshipit-source-id: 8fc75d49462ce092e85aef0fe0c50936140db153
main
Yanqin Jin 6 years ago committed by Facebook Github Bot
parent f0dda35d7d
commit ec68091d19
  1. 15
      db/db_impl.cc
  2. 3
      db/db_impl.h
  3. 34
      db/db_impl_compaction_flush.cc

@ -2389,9 +2389,9 @@ Status DBImpl::DeleteFile(std::string name) {
status = versions_->LogAndApply(cfd, *cfd->GetLatestMutableCFOptions(), status = versions_->LogAndApply(cfd, *cfd->GetLatestMutableCFOptions(),
&edit, &mutex_, directories_.GetDbDir()); &edit, &mutex_, directories_.GetDbDir());
if (status.ok()) { if (status.ok()) {
InstallSuperVersionAndScheduleWork( InstallSuperVersionAndScheduleWork(cfd,
cfd, &job_context.superversion_contexts[0], &job_context.superversion_contexts[0],
*cfd->GetLatestMutableCFOptions(), FlushReason::kDeleteFiles); *cfd->GetLatestMutableCFOptions());
} }
FindObsoleteFiles(&job_context, false); FindObsoleteFiles(&job_context, false);
} // lock released here } // lock released here
@ -2474,9 +2474,9 @@ Status DBImpl::DeleteFilesInRanges(ColumnFamilyHandle* column_family,
status = versions_->LogAndApply(cfd, *cfd->GetLatestMutableCFOptions(), status = versions_->LogAndApply(cfd, *cfd->GetLatestMutableCFOptions(),
&edit, &mutex_, directories_.GetDbDir()); &edit, &mutex_, directories_.GetDbDir());
if (status.ok()) { if (status.ok()) {
InstallSuperVersionAndScheduleWork( InstallSuperVersionAndScheduleWork(cfd,
cfd, &job_context.superversion_contexts[0], &job_context.superversion_contexts[0],
*cfd->GetLatestMutableCFOptions(), FlushReason::kDeleteFiles); *cfd->GetLatestMutableCFOptions());
} }
for (auto* deleted_file : deleted_files) { for (auto* deleted_file : deleted_files) {
deleted_file->being_compacted = false; deleted_file->being_compacted = false;
@ -3172,8 +3172,7 @@ Status DBImpl::IngestExternalFile(
&mutex_, directories_.GetDbDir()); &mutex_, directories_.GetDbDir());
} }
if (status.ok()) { if (status.ok()) {
InstallSuperVersionAndScheduleWork(cfd, &sv_context, *mutable_cf_options, InstallSuperVersionAndScheduleWork(cfd, &sv_context, *mutable_cf_options);
FlushReason::kExternalFileIngestion);
} }
// Resume writes to the DB // Resume writes to the DB

@ -1541,8 +1541,7 @@ class DBImpl : public DB {
// state needs flush or compaction. // state needs flush or compaction.
void InstallSuperVersionAndScheduleWork( void InstallSuperVersionAndScheduleWork(
ColumnFamilyData* cfd, SuperVersionContext* sv_context, ColumnFamilyData* cfd, SuperVersionContext* sv_context,
const MutableCFOptions& mutable_cf_options, const MutableCFOptions& mutable_cf_options);
FlushReason flush_reason = FlushReason::kOthers);
#ifndef ROCKSDB_LITE #ifndef ROCKSDB_LITE
using DB::GetPropertiesOfAllTables; using DB::GetPropertiesOfAllTables;

@ -948,9 +948,9 @@ Status DBImpl::CompactFilesImpl(
Status status = compaction_job.Install(*c->mutable_cf_options()); Status status = compaction_job.Install(*c->mutable_cf_options());
if (status.ok()) { if (status.ok()) {
InstallSuperVersionAndScheduleWork( InstallSuperVersionAndScheduleWork(c->column_family_data(),
c->column_family_data(), &job_context->superversion_contexts[0], &job_context->superversion_contexts[0],
*c->mutable_cf_options(), FlushReason::kManualCompaction); *c->mutable_cf_options());
} }
c->ReleaseCompactionFiles(s); c->ReleaseCompactionFiles(s);
#ifndef ROCKSDB_LITE #ifndef ROCKSDB_LITE
@ -1406,9 +1406,8 @@ Status DBImpl::RunManualCompaction(ColumnFamilyData* cfd, int input_level,
ca->prepicked_compaction = new PrepickedCompaction; ca->prepicked_compaction = new PrepickedCompaction;
ca->prepicked_compaction->manual_compaction_state = &manual; ca->prepicked_compaction->manual_compaction_state = &manual;
ca->prepicked_compaction->compaction = compaction; ca->prepicked_compaction->compaction = compaction;
if (!RequestCompactionToken(cfd, true, if (!RequestCompactionToken(
&ca->prepicked_compaction->task_token, cfd, true, &ca->prepicked_compaction->task_token, &log_buffer)) {
&log_buffer)) {
// Don't throttle manual compaction, only count outstanding tasks. // Don't throttle manual compaction, only count outstanding tasks.
assert(false); assert(false);
} }
@ -2435,9 +2434,9 @@ Status DBImpl::BackgroundCompaction(bool* made_progress,
status = versions_->LogAndApply(c->column_family_data(), status = versions_->LogAndApply(c->column_family_data(),
*c->mutable_cf_options(), c->edit(), *c->mutable_cf_options(), c->edit(),
&mutex_, directories_.GetDbDir()); &mutex_, directories_.GetDbDir());
InstallSuperVersionAndScheduleWork( InstallSuperVersionAndScheduleWork(c->column_family_data(),
c->column_family_data(), &job_context->superversion_contexts[0], &job_context->superversion_contexts[0],
*c->mutable_cf_options(), FlushReason::kAutoCompaction); *c->mutable_cf_options());
ROCKS_LOG_BUFFER(log_buffer, "[%s] Deleted %d files\n", ROCKS_LOG_BUFFER(log_buffer, "[%s] Deleted %d files\n",
c->column_family_data()->GetName().c_str(), c->column_family_data()->GetName().c_str(),
c->num_input_files(0)); c->num_input_files(0));
@ -2489,9 +2488,9 @@ Status DBImpl::BackgroundCompaction(bool* made_progress,
*c->mutable_cf_options(), c->edit(), *c->mutable_cf_options(), c->edit(),
&mutex_, directories_.GetDbDir()); &mutex_, directories_.GetDbDir());
// Use latest MutableCFOptions // Use latest MutableCFOptions
InstallSuperVersionAndScheduleWork( InstallSuperVersionAndScheduleWork(c->column_family_data(),
c->column_family_data(), &job_context->superversion_contexts[0], &job_context->superversion_contexts[0],
*c->mutable_cf_options(), FlushReason::kAutoCompaction); *c->mutable_cf_options());
VersionStorageInfo::LevelSummaryStorage tmp; VersionStorageInfo::LevelSummaryStorage tmp;
c->column_family_data()->internal_stats()->IncBytesMoved(c->output_level(), c->column_family_data()->internal_stats()->IncBytesMoved(c->output_level(),
@ -2575,9 +2574,9 @@ Status DBImpl::BackgroundCompaction(bool* made_progress,
status = compaction_job.Install(*c->mutable_cf_options()); status = compaction_job.Install(*c->mutable_cf_options());
if (status.ok()) { if (status.ok()) {
InstallSuperVersionAndScheduleWork( InstallSuperVersionAndScheduleWork(c->column_family_data(),
c->column_family_data(), &job_context->superversion_contexts[0], &job_context->superversion_contexts[0],
*c->mutable_cf_options(), FlushReason::kAutoCompaction); *c->mutable_cf_options());
} }
*made_progress = true; *made_progress = true;
TEST_SYNC_POINT_CALLBACK("DBImpl::BackgroundCompaction:AfterCompaction", TEST_SYNC_POINT_CALLBACK("DBImpl::BackgroundCompaction:AfterCompaction",
@ -2815,10 +2814,7 @@ void DBImpl::BuildCompactionJobInfo(
void DBImpl::InstallSuperVersionAndScheduleWork( void DBImpl::InstallSuperVersionAndScheduleWork(
ColumnFamilyData* cfd, SuperVersionContext* sv_context, ColumnFamilyData* cfd, SuperVersionContext* sv_context,
const MutableCFOptions& mutable_cf_options, const MutableCFOptions& mutable_cf_options) {
FlushReason /* flush_reason */) {
// TODO(yanqin) investigate if 'flush_reason' can be removed since it's not
// used.
mutex_.AssertHeld(); mutex_.AssertHeld();
// Update max_total_in_memory_state_ // Update max_total_in_memory_state_

Loading…
Cancel
Save