diff --git a/db/column_family.cc b/db/column_family.cc index 4164e5f8a..d35d6fbfc 100644 --- a/db/column_family.cc +++ b/db/column_family.cc @@ -428,7 +428,7 @@ ColumnFamilyData::ColumnFamilyData( flush_reason_(FlushReason::kOthers), column_family_set_(column_family_set), queued_for_flush_(false), - pending_compaction_(false), + queued_for_compaction_(false), prev_compaction_needed_bytes_(0), allow_2pc_(db_options.allow_2pc), last_memtable_id_(0) { @@ -505,7 +505,7 @@ ColumnFamilyData::~ColumnFamilyData() { // It would be wrong if this ColumnFamilyData is in flush_queue_ or // compaction_queue_ and we destroyed it assert(!queued_for_flush_); - assert(!pending_compaction_); + assert(!queued_for_compaction_); if (super_version_ != nullptr) { // Release SuperVersion reference kept in ThreadLocalPtr. diff --git a/db/column_family.h b/db/column_family.h index 48b872d37..d7fb5db74 100644 --- a/db/column_family.h +++ b/db/column_family.h @@ -346,9 +346,9 @@ class ColumnFamilyData { // Protected by DB mutex void set_queued_for_flush(bool value) { queued_for_flush_ = value; } - void set_pending_compaction(bool value) { pending_compaction_ = value; } + void set_queued_for_compaction(bool value) { queued_for_compaction_ = value; } bool queued_for_flush() { return queued_for_flush_; } - bool pending_compaction() { return pending_compaction_; } + bool queued_for_compaction() { return queued_for_compaction_; } enum class WriteStallCause { kNone, @@ -457,7 +457,7 @@ class ColumnFamilyData { // If true --> this ColumnFamily is currently present in // DBImpl::compaction_queue_ - bool pending_compaction_; + bool queued_for_compaction_; uint64_t prev_compaction_needed_bytes_; diff --git a/db/db_impl_compaction_flush.cc b/db/db_impl_compaction_flush.cc index 2a43bc818..7c15e2e2c 100644 --- a/db/db_impl_compaction_flush.cc +++ b/db/db_impl_compaction_flush.cc @@ -1272,18 +1272,18 @@ DBImpl::BGJobLimits DBImpl::GetBGJobLimits(int max_background_flushes, } void DBImpl::AddToCompactionQueue(ColumnFamilyData* cfd) { - assert(!cfd->pending_compaction()); + assert(!cfd->queued_for_compaction()); cfd->Ref(); compaction_queue_.push_back(cfd); - cfd->set_pending_compaction(true); + cfd->set_queued_for_compaction(true); } ColumnFamilyData* DBImpl::PopFirstFromCompactionQueue() { assert(!compaction_queue_.empty()); auto cfd = *compaction_queue_.begin(); compaction_queue_.pop_front(); - assert(cfd->pending_compaction()); - cfd->set_pending_compaction(false); + assert(cfd->queued_for_compaction()); + cfd->set_queued_for_compaction(false); return cfd; } @@ -1314,7 +1314,7 @@ void DBImpl::SchedulePendingFlush(ColumnFamilyData* cfd, } void DBImpl::SchedulePendingCompaction(ColumnFamilyData* cfd) { - if (!cfd->pending_compaction() && cfd->NeedsCompaction()) { + if (!cfd->queued_for_compaction() && cfd->NeedsCompaction()) { AddToCompactionQueue(cfd); ++unscheduled_compactions_; }