TierEngine component for ensuring only one instance of autotier runs for a given run path.
More...
#include <mutex.hpp>
|
| int | lock_mutex (void) |
| | Opens file at mutex_path such that if the file already exists, opening fails. Uses this as a mutex lock - if the file exists, the critical section is locked. To unlock, delete the file. More...
|
| |
| void | unlock_mutex (void) |
| | Deletes mutex lock file, unlocking the critical section. More...
|
| |
| virtual void | exit (int status) const |
| | Virtual exit function that can be overridden by other components for cleanup. More...
|
| |
|
| std::mutex | lock_file_mt_ |
| | Used to ensure currently_tiering_ is set atomically with locking the file mutex. More...
|
| |
| bool | stop_flag_ |
| | Set to false to make thread exit. Used to continue or cancel sleeping after being woken to do ad hoc command work. More...
|
| |
|
std::list< Tier > | tiers_ |
| | List of tiers built from configuration file.
|
| |
|
Config | config_ |
| | Configuration read from config_file path.
|
| |
|
fs::path | run_path_ |
| | Path to mutex lock file, ad hoc FIFO, and database. Defaults to /var/lib/autotier/<hash of config path>, can be overridden in config.
|
| |
|
fs::path | mount_point_ |
| | Where autotier filesystem is mounted, set by mount_point().
|
| |
| ConcurrentQueue< AdHoc > | adhoc_work_ |
| |
| std::condition_variable | sleep_cv_ |
| | Condition variable to use wait_until to sleep between tiering, used for the ad hoc server thread or the main thread to wake the tiering thread from sleep. More...
|
| |
|
std::shared_ptr< rocksdb::DB > | db_ |
| | Nosql database holding file metadata.
|
| |
|
|
int | mutex_ |
| | File handle for mutexing tiering of files.
|
| |
TierEngine component for ensuring only one instance of autotier runs for a given run path.
◆ TierEngineMutex()
| TierEngineMutex::TierEngineMutex |
( |
const fs::path & |
config_path, |
|
|
const ConfigOverrides & |
config_overrides |
|
) |
| |
Construct a new Tier Engine Mutex object.
- Parameters
-
| config_path | Path to config file |
| config_overrides | Config Overrides from main() |
◆ ~TierEngineMutex()
| TierEngineMutex::~TierEngineMutex |
( |
void |
| ) |
|
◆ lock_mutex()
| int TierEngineMutex::lock_mutex |
( |
void |
| ) |
|
|
protected |
Opens file at mutex_path such that if the file already exists, opening fails. Uses this as a mutex lock - if the file exists, the critical section is locked. To unlock, delete the file.
- Returns
- int 0 if locked, -1 if failed to lock.
◆ unlock_mutex()
| void TierEngineMutex::unlock_mutex |
( |
void |
| ) |
|
|
protected |
Deletes mutex lock file, unlocking the critical section.
◆ lock_file_mt_
| std::mutex TierEngineMutex::lock_file_mt_ |
|
protected |
Used to ensure currently_tiering_ is set atomically with locking the file mutex.
The documentation for this class was generated from the following files:
- src/incl/TierEngine/components/mutex.hpp
- src/impl/autotierfs/TierEngine/components/mutex.cpp