Skip to content

Commit

Permalink
Add Temperature to FileAttributes (#12965)
Browse files Browse the repository at this point in the history
Summary:
.. so that appropriate implementations can return temperature information from GetChildrenFileAttributes

Pull Request resolved: #12965

Test Plan: just an API placeholder for now

Reviewed By: anand1976

Differential Revision: D61748199

Pulled By: pdillinger

fbshipit-source-id: b457e324cb451e836611a0bf630c3da0f30a8abf
  • Loading branch information
pdillinger committed Aug 24, 2024
1 parent aaa570b commit daa63be
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
12 changes: 0 additions & 12 deletions include/rocksdb/advanced_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions include/rocksdb/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down
12 changes: 12 additions & 0 deletions include/rocksdb/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit daa63be

Please sign in to comment.