From: Peter Dillinger Date: Sat, 24 Aug 2024 03:06:41 +0000 (-0700) Subject: Add Temperature to FileAttributes (#12965) X-Git-Tag: v9.6.1~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=daa63be3d67c931fbc441aa92d77f97c8332719a;p=rocksdb.git Add Temperature to FileAttributes (#12965) Summary: .. so that appropriate implementations can return temperature information from GetChildrenFileAttributes Pull Request resolved: https://github.com/facebook/rocksdb/pull/12965 Test Plan: just an API placeholder for now Reviewed By: anand1976 Differential Revision: D61748199 Pulled By: pdillinger fbshipit-source-id: b457e324cb451e836611a0bf630c3da0f30a8abf --- diff --git a/include/rocksdb/advanced_options.h b/include/rocksdb/advanced_options.h index 3761923ce..309d0c510 100644 --- a/include/rocksdb/advanced_options.h +++ b/include/rocksdb/advanced_options.h @@ -61,18 +61,6 @@ enum CompactionPri : char { kRoundRobin = 0x4, }; -// Temperature of a file. Used to pass to FileSystem for a different -// placement and/or coding. -// Reserve some numbers in the middle, in case we need to insert new tier -// there. -enum class Temperature : uint8_t { - kUnknown = 0, - kHot = 0x04, - kWarm = 0x08, - kCold = 0x0C, - kLastTemperature, -}; - struct FileTemperatureAge { Temperature temperature = Temperature::kUnknown; uint64_t age = 0; diff --git a/include/rocksdb/env.h b/include/rocksdb/env.h index a259696b2..83f2dd605 100644 --- a/include/rocksdb/env.h +++ b/include/rocksdb/env.h @@ -30,6 +30,7 @@ #include "rocksdb/port_defs.h" #include "rocksdb/status.h" #include "rocksdb/thread_status.h" +#include "rocksdb/types.h" #ifdef _WIN32 // Windows API macro interference @@ -159,6 +160,9 @@ class Env : public Customizable { // Size of file in bytes uint64_t size_bytes; + + // EXPERIMENTAL - only provided by some implementations + Temperature temperature = Temperature::kUnknown; }; Env(); diff --git a/include/rocksdb/types.h b/include/rocksdb/types.h index dceacbbef..368736cbd 100644 --- a/include/rocksdb/types.h +++ b/include/rocksdb/types.h @@ -110,4 +110,16 @@ enum class WriteStallCondition { kNormal, }; +// Temperature of a file. Used to pass to FileSystem for a different +// placement and/or coding. +// Reserve some numbers in the middle, in case we need to insert new tier +// there. +enum class Temperature : uint8_t { + kUnknown = 0, + kHot = 0x04, + kWarm = 0x08, + kCold = 0x0C, + kLastTemperature, +}; + } // namespace ROCKSDB_NAMESPACE