Fix CLANG build break caused by the recent Persistent Cache change

Test Plan: USE_CLANG=1 make all check -j32

Reviewers: andrewkr, IslamAbdelRahman

Reviewed By: IslamAbdelRahman

Subscribers: leveldb, andrewkr, dhruba

Differential Revision: https://reviews.facebook.net/D59313
main
sdong 8 years ago
parent 54db29b8f0
commit 098da83483
  1. 9
      utilities/persistent_cache/persistent_cache_test.h
  2. 4
      utilities/persistent_cache/volatile_tier_impl.cc

@ -58,7 +58,7 @@ class PersistentCacheTierTest : public testing::Test {
std::thread th(fn); std::thread th(fn);
threads.push_back(std::move(th)); threads.push_back(std::move(th));
} }
return std::move(threads); return threads;
} }
// Wait for threads to join // Wait for threads to join
@ -75,7 +75,7 @@ class PersistentCacheTierTest : public testing::Test {
max_keys_ = max_keys; max_keys_ = max_keys;
// spawn threads // spawn threads
auto fn = std::bind(&PersistentCacheTierTest::InsertImpl, this); auto fn = std::bind(&PersistentCacheTierTest::InsertImpl, this);
auto threads = std::move(SpawnThreads(nthreads, fn)); auto threads = SpawnThreads(nthreads, fn);
// join with threads // join with threads
Join(std::move(threads)); Join(std::move(threads));
// Flush cache // Flush cache
@ -90,7 +90,7 @@ class PersistentCacheTierTest : public testing::Test {
// spawn threads // spawn threads
auto fn = auto fn =
std::bind(&PersistentCacheTierTest::VerifyImpl, this, eviction_enabled); std::bind(&PersistentCacheTierTest::VerifyImpl, this, eviction_enabled);
auto threads = std::move(SpawnThreads(nthreads, fn)); auto threads = SpawnThreads(nthreads, fn);
// join with threads // join with threads
Join(std::move(threads)); Join(std::move(threads));
} }
@ -232,7 +232,8 @@ class PersistentCacheDBTest : public DBTestBase {
static uint32_t TestGetTickerCount(const Options& options, static uint32_t TestGetTickerCount(const Options& options,
Tickers ticker_type) { Tickers ticker_type) {
return options.statistics->getTickerCount(ticker_type); return static_cast<uint32_t>(
options.statistics->getTickerCount(ticker_type));
} }
// insert data to table // insert data to table

@ -32,7 +32,7 @@ std::vector<PersistentCacheTier::TierStats> VolatileCacheTier::Stats() {
std::vector<PersistentCacheTier::TierStats> tier_stats; std::vector<PersistentCacheTier::TierStats> tier_stats;
if (next_tier()) { if (next_tier()) {
tier_stats = std::move(next_tier()->Stats()); tier_stats = next_tier()->Stats();
} }
tier_stats.push_back(stat); tier_stats.push_back(stat);
return tier_stats; return tier_stats;
@ -49,7 +49,7 @@ std::string VolatileCacheTier::PrintStats() {
<< "pagecache.volatilecache.miss_pct: " << stats_.CacheMissPct() << "pagecache.volatilecache.miss_pct: " << stats_.CacheMissPct()
<< std::endl << std::endl
<< PersistentCacheTier::PrintStats(); << PersistentCacheTier::PrintStats();
return std::move(ss.str()); return ss.str();
} }
Status VolatileCacheTier::Insert(const Slice& page_key, const char* data, Status VolatileCacheTier::Insert(const Slice& page_key, const char* data,

Loading…
Cancel
Save