From 7e078329328cecdf711a05384e6808878ccd8217 Mon Sep 17 00:00:00 2001 From: bowang Date: Sat, 14 May 2022 00:40:53 -0700 Subject: [PATCH] update --- db/flush_job.cc | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/db/flush_job.cc b/db/flush_job.cc index 037128247..5082e7965 100644 --- a/db/flush_job.cc +++ b/db/flush_job.cc @@ -1033,6 +1033,21 @@ Status FlushJob::WriteLevel0Table() { return s; } +Env::IOPriority FlushJob::GetRateLimiterPriority( + const RateLimiter::OpType op_type) { + WriteController* write_controller = + versions_->GetColumnFamilySet()->write_controller(); + + if (op_type == RateLimiter::OpType::kWrite) { + if (write_controller->IsStopped() || write_controller->NeedsDelay()) { + return Env::IO_USER; + } + return Env::IO_HIGH; + } else { + return Env::IO_USER; + } +} + #ifndef ROCKSDB_LITE std::unique_ptr FlushJob::GetFlushJobInfo() const { db_mutex_->AssertHeld(); @@ -1065,22 +1080,6 @@ std::unique_ptr FlushJob::GetFlushJobInfo() const { } return info; } - -Env::IOPriority FlushJob::GetRateLimiterPriority( - const RateLimiter::OpType op_type) { - WriteController* write_controller = - versions_->GetColumnFamilySet()->write_controller(); - - if (op_type == RateLimiter::OpType::kWrite) { - if (write_controller->IsStopped() || write_controller->NeedsDelay()) { - return Env::IO_USER; - } - return Env::IO_HIGH; - } else { - return Env::IO_USER; - } -} - #endif // !ROCKSDB_LITE } // namespace ROCKSDB_NAMESPACE