File metadata to be stored in and retrieved from the RocksDB database.
More...
#include <metadata.hpp>
|
template<class Archive > |
void | serialize (Archive &ar, const unsigned int version) |
| Serialize method for boost::serialize. More...
|
|
|
uintmax_t | access_count_ = 0 |
| Number of times the file was accessed since last tiering. Resets to 0 after each popularity calculation. More...
|
|
double | popularity_ = MULTIPLIER * AVG_USAGE |
| Moving average of file usage frequency in accesses per hour. Used to sort list of files to determine which tiers they belong in. More...
|
|
bool | not_found_ = false |
| Set to true when the file metadata could not be retrieved from the database. More...
|
|
bool | pinned_ = false |
| Flag to determine whether to ignore file while tiering. When true, the file stays in the tier it is in. More...
|
|
std::string | tier_path_ |
| The backend path of the tier. This + relative path is the real location of the file. More...
|
|
|
class | boost::serialization::access |
|
class | File |
|
class | MetadataViewer |
|
File metadata to be stored in and retrieved from the RocksDB database.
◆ Metadata() [1/5]
Metadata::Metadata |
( |
void |
| ) |
|
◆ Metadata() [2/5]
Metadata::Metadata |
( |
const std::string & |
serialized | ) |
|
Construct a new Metadata object from serialized string.
- Parameters
-
serialized | Serialized string representing Metadata object |
◆ Metadata() [3/5]
Metadata::Metadata |
( |
const Metadata & |
other | ) |
|
Copy construct a new Metadata object.
- Parameters
-
◆ Metadata() [4/5]
Move construct a new Metadata object.
- Parameters
-
◆ ~Metadata()
Metadata::~Metadata |
( |
void |
| ) |
|
|
default |
◆ Metadata() [5/5]
Metadata::Metadata |
( |
std::string |
path, |
|
|
std::shared_ptr< rocksdb::DB > |
db, |
|
|
Tier * |
tptr = nullptr |
|
) |
| |
Construct a new Metadata object. Try to retrieve data from db. If not found and tptr != nullptr, new metadata object is initialized and put into the database. If not found and tptr == nullptr, metadata is left undefined and not_found_ is set to true.
- Parameters
-
◆ dump_stats()
std::string Metadata::dump_stats |
( |
void |
| ) |
const |
Return metadata as formatted string.
- Returns
- std::string
◆ not_found()
bool Metadata::not_found |
( |
void |
| ) |
const |
Test if metadata was found in database.
- Returns
- true metadata was not found
-
false metadata was found
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ pinned() [1/2]
void Metadata::pinned |
( |
bool |
val | ) |
|
Set pinned flag.
- Parameters
-
◆ pinned() [2/2]
bool Metadata::pinned |
( |
void |
| ) |
const |
Test if metadata has pinned flag set.
- Returns
- true File corresponding to metadata is pinned
-
false File corresponding to metadata is not pinned
◆ popularity()
double Metadata::popularity |
( |
void |
| ) |
const |
Get popularity.
- Returns
- double Popularity of file
◆ serialize()
template<class Archive >
void Metadata::serialize |
( |
Archive & |
ar, |
|
|
const unsigned int |
version |
|
) |
| |
|
inlineprivate |
Serialize method for boost::serialize.
- Template Parameters
-
- Parameters
-
ar | Internal boost::serialize object |
version | boost::serialize version (unused) |
◆ tier_path() [1/2]
void Metadata::tier_path |
( |
const std::string & |
path | ) |
|
Set path to tier root.
- Parameters
-
◆ tier_path() [2/2]
std::string Metadata::tier_path |
( |
void |
| ) |
const |
Get path to tier root.
- Returns
- std::string
◆ touch()
void Metadata::touch |
( |
void |
| ) |
|
◆ update()
void Metadata::update |
( |
std::string |
relative_path, |
|
|
std::shared_ptr< rocksdb::DB > |
db, |
|
|
std::string * |
old_key = nullptr |
|
) |
| |
Put metadata into database with relative_path as the key.
- Parameters
-
relative_path | Database key |
db | Pointer to RocksDB database |
old_key | string pointer to old key to remove if not nullptr |
◆ access_count_
uintmax_t Metadata::access_count_ = 0 |
|
private |
Number of times the file was accessed since last tiering. Resets to 0 after each popularity calculation.
◆ not_found_
bool Metadata::not_found_ = false |
|
private |
Set to true when the file metadata could not be retrieved from the database.
◆ pinned_
bool Metadata::pinned_ = false |
|
private |
Flag to determine whether to ignore file while tiering. When true, the file stays in the tier it is in.
◆ popularity_
double Metadata::popularity_ = MULTIPLIER * AVG_USAGE |
|
private |
Moving average of file usage frequency in accesses per hour. Used to sort list of files to determine which tiers they belong in.
◆ tier_path_
std::string Metadata::tier_path_ |
|
private |
The backend path of the tier. This + relative path is the real location of the file.
The documentation for this class was generated from the following files: