Add kLastTemperature as temperature high bound (#10044)

Summary:
Only used as temperature high bound for current code, may
increase with more temperatures added.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/10044

Test Plan: ci

Reviewed By: siying

Differential Revision: D36633410

Pulled By: jay-zhuang

fbshipit-source-id: eecdfa7623c31778c31d789902eacf78aad7b482
main
Jay Zhuang 3 years ago committed by Facebook GitHub Bot
parent 3dc6ebaf74
commit a020031552
  1. 5
      db/db_test2.cc
  2. 1
      include/rocksdb/advanced_options.h

@ -6883,6 +6883,11 @@ TEST_F(DBTest2, BottommostTemperatureUniversal) {
ASSERT_EQ(size, 0); ASSERT_EQ(size, 0);
size = GetSstSizeHelper(Temperature::kCold); size = GetSstSizeHelper(Temperature::kCold);
ASSERT_GT(size, 0); ASSERT_GT(size, 0);
// kLastTemperature is an invalid temperature
options.bottommost_temperature = Temperature::kLastTemperature;
s = TryReopen(options);
ASSERT_TRUE(s.IsIOError());
} }
TEST_F(DBTest2, LastLevelStatistics) { TEST_F(DBTest2, LastLevelStatistics) {

@ -223,6 +223,7 @@ enum class Temperature : uint8_t {
kHot = 0x04, kHot = 0x04,
kWarm = 0x08, kWarm = 0x08,
kCold = 0x0C, kCold = 0x0C,
kLastTemperature,
}; };
// The control option of how the cache tiers will be used. Currently rocksdb // The control option of how the cache tiers will be used. Currently rocksdb

Loading…
Cancel
Save