diff options
author | Peter Dillinger <peterd@meta.com> | 2024-08-23 20:06:41 -0700 |
---|---|---|
committer | Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> | 2024-08-23 20:06:41 -0700 |
commit | 8ac14f525e652fc69c5664019e9a3be7a5c7f4d6 (patch) | |
tree | 00869749af216450bffdde76fb531095b546e685 | |
parent | 96340dbce2ef295a1b48fc086ff8bf4b0356531b (diff) |
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
-rw-r--r-- | include/rocksdb/advanced_options.h | 12 | ||||
-rw-r--r-- | include/rocksdb/env.h | 4 | ||||
-rw-r--r-- | include/rocksdb/types.h | 12 |
3 files changed, 16 insertions, 12 deletions
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 |