Monitor implementation that represents commit state using the filesystem.
More...
#include <monitor.h>
|
|
| FileSystemMonitor () |
| | Construct a filesystem-based commit monitor.
|
|
| ~FileSystemMonitor () override=default |
| | Destructor for FileSystemMonitor.
|
| bool | isCommitted (const std::filesystem::path &path) const override |
| | Check whether the given file has been committed.
|
| void | setCommitted (const std::filesystem::path &path) const override |
| | Mark the given file as committed.
|
| void | setHomeNode (const std::filesystem::path &path) const override |
| const std::string & | getHomeNode (const std::filesystem::path &path) const override |
|
virtual | ~MonitorInterface ()=default |
| | Virtual destructor for safe polymorphic deletion.
|
|
|
std::mutex | committed_lock |
| | Mutex protecting access to the committed file list.
|
|
std::mutex | home_node_lock |
| | Mutex protecting access to the home nodes list.
|
|
std::vector< std::string > | _committed_files |
| | List of committed file paths stored as strings.
|
|
std::unordered_map< std::string, std::string > | _home_nodes |
| | Lookup table to get home node staring from path. Key = file path; Value = hostname of home node.
|
|
char | _hostname [HOST_NAME_MAX] = {0} |
| | hostname of the current instance
|
Monitor implementation that represents commit state using the filesystem.
FileSystemMonitor uses token files on disk to record when a file is committed. A committed file <path> is associated with a token file whose name is computed from the path. Existence of the token file implies commit state.
◆ getHomeNode()
| const std::string & capiocl::monitor::FileSystemMonitor::getHomeNode |
( |
const std::filesystem::path & | path | ) |
const |
|
overridevirtual |
Get the home node for a given path as reported by the implementation of this interface
- Parameters
-
- Returns
- the home node responsible for the given path
Reimplemented from capiocl::monitor::MonitorInterface.
◆ isCommitted()
| bool capiocl::monitor::FileSystemMonitor::isCommitted |
( |
const std::filesystem::path & | path | ) |
const |
|
overridevirtual |
Check whether the given file has been committed.
- Parameters
-
| path | Path to the file being queried. |
- Returns
- true if the file is recorded as committed, false otherwise.
Reimplemented from capiocl::monitor::MonitorInterface.
◆ setCommitted()
| void capiocl::monitor::FileSystemMonitor::setCommitted |
( |
const std::filesystem::path & | path | ) |
const |
|
overridevirtual |
◆ setHomeNode()
| void capiocl::monitor::FileSystemMonitor::setHomeNode |
( |
const std::filesystem::path & | path | ) |
const |
|
overridevirtual |
The documentation for this class was generated from the following file:
- /home/runner/work/CAPIO-CL/CAPIO-CL/capiocl/monitor.h