]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
Add Temperature to FileAttributes (#12965)
authorPeter Dillinger <peterd@meta.com>
Sat, 24 Aug 2024 03:06:41 +0000 (20:06 -0700)
committerPeter Dillinger <peterd@meta.com>
Sat, 24 Aug 2024 15:39:51 +0000 (08:39 -0700)
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

include/rocksdb/advanced_options.h
include/rocksdb/env.h
include/rocksdb/types.h

index 3761923ce7e68dbe529a93658f83ef6aaf43a1b6..309d0c510ac00cf99636393344d22ea437dbc0ef 100644 (file)
@@ -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;
index a259696b29f44561dea72e29ac4bd5f3919596dd..83f2dd60538ad9a46283a9d8454c33849e73d63d 100644 (file)
@@ -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();
index dceacbbefc6bddfc2c789567c984b8dd8e479ed8..368736cbd09748cd056bf220b970514cfcd8255e 100644 (file)
@@ -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