Fix -Werror=shadow (#5546)

Summary:
This PR fixes shadow errors.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5546

Test Plan: make clean && make check -j32 && make clean && USE_CLANG=1 make check -j32 && make clean && COMPILE_WITH_ASAN=1 make check -j32

Differential Revision: D16147841

Pulled By: HaoyuHuang

fbshipit-source-id: 1043500d70c134185f537ab4c3900452752f1534
main
haoyuhuang 5 years ago committed by Facebook Github Bot
parent 7c76a7fba2
commit 6ca3feed5c
  1. 4
      table/block_based/block_based_table_reader.cc
  2. 2
      table/get_context.h
  3. 4
      utilities/simulator_cache/cache_simulator.cc

@ -3341,7 +3341,7 @@ Status BlockBasedTable::Get(const ReadOptions& read_options, const Slice& key,
CachableEntry<FilterBlockReader> filter_entry;
bool may_match;
FilterBlockReader* filter = nullptr;
uint64_t tracing_get_id = get_context->tracing_get_id();
uint64_t tracing_get_id = get_context->get_tracing_get_id();
BlockCacheLookupContext lookup_context{TableReaderCaller::kUserGet,
tracing_get_id};
{
@ -3517,7 +3517,7 @@ void BlockBasedTable::MultiGet(const ReadOptions& read_options,
mget_range->end());
uint64_t tracing_mget_id = BlockCacheTraceHelper::kReservedGetId;
if (!sst_file_range.empty() && sst_file_range.begin()->get_context) {
tracing_mget_id = sst_file_range.begin()->get_context->tracing_get_id();
tracing_mget_id = sst_file_range.begin()->get_context->get_tracing_get_id();
}
BlockCacheLookupContext lookup_context{TableReaderCaller::kUserMultiGet,
tracing_mget_id};

@ -136,7 +136,7 @@ class GetContext {
void ReportCounters();
uint64_t tracing_get_id() const { return tracing_get_id_; }
uint64_t get_tracing_get_id() const { return tracing_get_id_; }
private:
const Comparator* ucmp_;

@ -34,8 +34,8 @@ void PrioritizedCacheSimulator::Access(const BlockCacheTraceRecord& access) {
double CacheSimulator::miss_ratio() {
uint64_t hits = sim_cache_->get_hit_counter();
uint64_t misses = sim_cache_->get_miss_counter();
uint64_t total_accesses = hits + misses;
return static_cast<double>(misses * 100.0 / total_accesses);
uint64_t accesses = hits + misses;
return static_cast<double>(misses * 100.0 / accesses);
}
uint64_t CacheSimulator::total_accesses() {

Loading…
Cancel
Save