From aca403d2b5227336d4e59b1f5df24125769b4fb4 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Fri, 11 Dec 2015 17:33:40 -0800 Subject: [PATCH] Fix another rebase problems. --- db/db_bench.cc | 1 - db/version_set.cc | 19 +++++++++++-------- util/rate_limiter.h | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/db/db_bench.cc b/db/db_bench.cc index 4bcab1446..b0f279eba 100644 --- a/db/db_bench.cc +++ b/db/db_bench.cc @@ -3214,7 +3214,6 @@ class Benchmark { if (thread->tid > 0) { ReadRandom(thread); } else { - BGWriter(thread, kPut); BGWriter(thread, kWrite); } } diff --git a/db/version_set.cc b/db/version_set.cc index bd18bf3a5..f933b4e0e 100644 --- a/db/version_set.cc +++ b/db/version_set.cc @@ -757,7 +757,7 @@ uint64_t VersionStorageInfo::GetEstimatedActiveKeys() const { // casting to avoid overflowing return static_cast( - (est * static_cast(file_count) / current_num_samples_); + (est * static_cast(file_count) / current_num_samples_) ); } else { return est; @@ -871,21 +871,24 @@ Version::Version(ColumnFamilyData* column_family_data, VersionSet* vset, refs_(0), version_number_(version_number) {} -void Version::Get(const ReadOptions& read_options, - const LookupKey& k, - std::string* value, - Status* status, - MergeContext* merge_context, - bool* value_found) { +void Version::Get(const ReadOptions& read_options, const LookupKey& k, + std::string* value, Status* status, + MergeContext* merge_context, bool* value_found, + bool* key_exists, SequenceNumber* seq) { Slice ikey = k.internal_key(); Slice user_key = k.user_key(); assert(status->ok() || status->IsMergeInProgress()); + if (key_exists != nullptr) { + // will falsify below if not found + *key_exists = true; + } + GetContext get_context( user_comparator(), merge_operator_, info_log_, db_statistics_, status->ok() ? GetContext::kNotFound : GetContext::kMerge, user_key, - value, value_found, merge_context, this->env_); + value, value_found, merge_context, this->env_, seq); FilePicker fp( storage_info_.files_, user_key, ikey, &storage_info_.level_files_brief_, diff --git a/util/rate_limiter.h b/util/rate_limiter.h index 91fc3c289..62ae6b5ad 100644 --- a/util/rate_limiter.h +++ b/util/rate_limiter.h @@ -60,7 +60,7 @@ class GenericRateLimiter : public RateLimiter { private: void Refill(); int64_t CalculateRefillBytesPerPeriod(int64_t rate_bytes_per_sec) { - return static_cast(rate_bytes_per_sec * refill_period_us_ / 1000000.0); + return rate_bytes_per_sec * refill_period_us_ / 1000000; } // This mutex guard all internal states