diff --git a/db/db_impl.cc b/db/db_impl.cc index 0708c49a89..f6634b6c4e 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -3449,10 +3449,10 @@ Status DBImpl::GetImpl(const ReadOptions& options, LookupKey lkey(key, snapshot); PERF_TIMER_STOP(get_snapshot_time); - if (sv->mem->Get(lkey, value, &s, merge_context)) { + if (sv->mem->Get(lkey, value, &s, &merge_context)) { // Done RecordTick(stats_, MEMTABLE_HIT); - } else if (sv->imm->Get(lkey, value, &s, merge_context)) { + } else if (sv->imm->Get(lkey, value, &s, &merge_context)) { // Done RecordTick(stats_, MEMTABLE_HIT); } else { @@ -3537,9 +3537,9 @@ std::vector DBImpl::MultiGet( assert(mgd_iter != multiget_cf_data.end()); auto mgd = mgd_iter->second; auto super_version = mgd->super_version; - if (super_version->mem->Get(lkey, value, &s, merge_context)) { + if (super_version->mem->Get(lkey, value, &s, &merge_context)) { // Done - } else if (super_version->imm->Get(lkey, value, &s, merge_context)) { + } else if (super_version->imm->Get(lkey, value, &s, &merge_context)) { // Done } else { super_version->current->Get(options, lkey, value, &s, &merge_context); diff --git a/db/db_impl_readonly.cc b/db/db_impl_readonly.cc index b1fae82cf9..8cea58736f 100644 --- a/db/db_impl_readonly.cc +++ b/db/db_impl_readonly.cc @@ -61,7 +61,7 @@ Status DBImplReadOnly::Get(const ReadOptions& read_options, SuperVersion* super_version = cfd->GetSuperVersion(); MergeContext merge_context; LookupKey lkey(key, snapshot); - if (super_version->mem->Get(lkey, value, &s, merge_context)) { + if (super_version->mem->Get(lkey, value, &s, &merge_context)) { } else { super_version->current->Get(read_options, lkey, value, &s, &merge_context); } diff --git a/db/memtable.cc b/db/memtable.cc index d7923711ac..23cc622704 100644 --- a/db/memtable.cc +++ b/db/memtable.cc @@ -430,7 +430,7 @@ static bool SaveValue(void* arg, const char* entry) { } bool MemTable::Get(const LookupKey& key, std::string* value, Status* s, - MergeContext& merge_context) { + MergeContext* merge_context) { // The sequence number is updated synchronously in version_set.h if (IsEmpty()) { // Avoiding recording stats for speed. @@ -454,7 +454,7 @@ bool MemTable::Get(const LookupKey& key, std::string* value, Status* s, saver.value = value; saver.status = s; saver.mem = this; - saver.merge_context = &merge_context; + saver.merge_context = merge_context; saver.merge_operator = ioptions_.merge_operator; saver.logger = ioptions_.info_log; saver.inplace_update_support = moptions_.inplace_update_support; diff --git a/db/memtable.h b/db/memtable.h index 26772e0f54..0371dc3cf9 100644 --- a/db/memtable.h +++ b/db/memtable.h @@ -118,7 +118,7 @@ class MemTable { // store MergeInProgress in s, and return false. // Else, return false. bool Get(const LookupKey& key, std::string* value, Status* s, - MergeContext& merge_context); + MergeContext* merge_context); // Attempts to update the new_value inplace, else does normal Add // Pseudocode diff --git a/db/memtable_list.cc b/db/memtable_list.cc index ced03dc829..728b1c0a09 100644 --- a/db/memtable_list.cc +++ b/db/memtable_list.cc @@ -62,7 +62,7 @@ int MemTableList::size() const { // Return the most recent value found, if any. // Operands stores the list of merge operations to apply, so far. bool MemTableListVersion::Get(const LookupKey& key, std::string* value, - Status* s, MergeContext& merge_context) { + Status* s, MergeContext* merge_context) { for (auto& memtable : memlist_) { if (memtable->Get(key, value, s, merge_context)) { return true; diff --git a/db/memtable_list.h b/db/memtable_list.h index 042ffc5cf2..92688825a2 100644 --- a/db/memtable_list.h +++ b/db/memtable_list.h @@ -46,7 +46,7 @@ class MemTableListVersion { // Search all the memtables starting from the most recent one. // Return the most recent value found, if any. bool Get(const LookupKey& key, std::string* value, Status* s, - MergeContext& merge_context); + MergeContext* merge_context); void AddIterators(const ReadOptions& options, std::vector* iterator_list, Arena* arena);