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

Monitor implementation that synchronizes file commit state via multicast messages. More...

#include <monitor.h>

Inheritance diagram for capiocl::monitor::MulticastMonitor:
Collaboration diagram for capiocl::monitor::MulticastMonitor:

Public Member Functions

 MulticastMonitor (const capiocl::configuration::CapioClConfiguration &config)
 Construct a multicast-based monitor.
 ~MulticastMonitor () override
 Destructor; stops listener thread and cleans resources.
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
Public Member Functions inherited from capiocl::monitor::MonitorInterface
virtual ~MonitorInterface ()=default
 Virtual destructor for safe polymorphic deletion.

Additional Inherited Members

Protected Attributes inherited from capiocl::monitor::MonitorInterface
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

Monitor implementation that synchronizes file commit state via multicast messages.

MulticastMonitor exchanges commit events between distributed processes using multicast network messages. When one process commits a file, it broadcasts a message so that other collaborators update their commit state.

A background thread (commit_listener_thread) listens for notifications from the network to update the internal commit list.

Constructor & Destructor Documentation

◆ MulticastMonitor()

capiocl::monitor::MulticastMonitor::MulticastMonitor ( const capiocl::configuration::CapioClConfiguration & config)

Construct a multicast-based monitor.

Parameters
configconst reference to CAPIO-CL configuration

Member Function Documentation

◆ getHomeNode()

const std::string & capiocl::monitor::MulticastMonitor::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
path
Returns
the home node responsible for the given path

Reimplemented from capiocl::monitor::MonitorInterface.

◆ isCommitted()

bool capiocl::monitor::MulticastMonitor::isCommitted ( const std::filesystem::path & path) const
overridevirtual

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 from capiocl::monitor::MonitorInterface.

◆ setCommitted()

void capiocl::monitor::MulticastMonitor::setCommitted ( const std::filesystem::path & path) const
overridevirtual

Mark the given file as committed.

Parameters
pathPath to the file to mark as committed.

Reimplemented from capiocl::monitor::MonitorInterface.

◆ setHomeNode()

void capiocl::monitor::MulticastMonitor::setHomeNode ( const std::filesystem::path & path) const
overridevirtual

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

Parameters
path

Reimplemented from capiocl::monitor::MonitorInterface.


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