CAPIO-CL 1.2.0
CAPIO-CL: Cross Application Programmable I/O - Coordination Language
Loading...
Searching...
No Matches
capiocl::monitor::MonitorInterface Class Reference

Abstract interface for monitoring the commit state of files in CAPIO-CL. More...

#include <monitor.h>

Inheritance diagram for capiocl::monitor::MonitorInterface:

Public Member Functions

virtual ~MonitorInterface ()=default
 Virtual destructor for safe polymorphic deletion.
virtual bool isCommitted (const std::filesystem::path &path) const
 Check whether the given file has been committed.
virtual void setCommitted (const std::filesystem::path &path) const
 Mark the given file as committed.
virtual void setHomeNode (const std::filesystem::path &path) const
virtual const std::string & getHomeNode (const std::filesystem::path &path) const

Protected Attributes

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

Detailed Description

Abstract interface for monitoring the commit state of files in CAPIO-CL.

This class defines a common API for components that track whether files have been marked as "committed" in the CAPIO-CL runtime. Implementations may monitor commit state using different backends (e.g., filesystem signals or multicast synchronization).

The class is thread-safe through committed_lock, protecting _committed_files which stores the list of committed file paths.

Member Function Documentation

◆ getHomeNode()

virtual const std::string & capiocl::monitor::MonitorInterface::getHomeNode ( const std::filesystem::path & path) const
virtual

Get the home node for a given path as reported by the implementation of this interface

Parameters
path
Returns
the home node responsible for the given path

Reimplemented in capiocl::monitor::FileSystemMonitor, and capiocl::monitor::MulticastMonitor.

◆ isCommitted()

virtual bool capiocl::monitor::MonitorInterface::isCommitted ( const std::filesystem::path & path) const
virtual

Check whether the given file has been committed.

Parameters
pathPath to the file being queried.
Returns
true if the file is recorded as committed, false otherwise.

Reimplemented in capiocl::monitor::FileSystemMonitor, and capiocl::monitor::MulticastMonitor.

◆ setCommitted()

virtual void capiocl::monitor::MonitorInterface::setCommitted ( const std::filesystem::path & path) const
virtual

Mark the given file as committed.

Parameters
pathPath to the file to mark as committed.

Reimplemented in capiocl::monitor::FileSystemMonitor, and capiocl::monitor::MulticastMonitor.

◆ setHomeNode()

virtual void capiocl::monitor::MonitorInterface::setHomeNode ( const std::filesystem::path & path) const
virtual

Set the current hostname as the home node for a given path

Parameters
path

Reimplemented in capiocl::monitor::FileSystemMonitor, and capiocl::monitor::MulticastMonitor.


The documentation for this class was generated from the following file: