DP3
Public Types | Public Member Functions | List of all members
dp3::common::NodeDesc Class Reference

Description of a node in a cluster. More...

#include <NodeDesc.h>

Public Types

enum  NodeType { Compute , Storage , Head , Any }
 Define the node types. More...
 

Public Member Functions

 NodeDesc ()
 
 NodeDesc (const ParameterSet &)
 Construct from the given parameterset. More...
 
void addFileSys (const std::string &fsName, const std::string &mountPoint)
 
std::string findFileSys (const std::string &fileName) const
 
const std::vector< std::string > & getFileSys () const
 Get the file systems it has access to. More...
 
const std::vector< std::string > & getMountPoints () const
 Get the mount points of the file systems. More...
 
const std::string & getName () const
 Get the name. More...
 
NodeType getType () const
 Get the type. More...
 
void setName (const std::string &name)
 Set node name. More...
 
void setType (NodeType type)
 Set node type. More...
 
void write (std::ostream &os, const std::string &prefix) const
 Write it in parset format. More...
 

Detailed Description

Description of a node in a cluster.

This class holds the basic description of a node. It tells the name of the node and which file systems it has access to.

Currently the information is made persistent in a LOFAR .parset file. In the future it needs to use the Central Processor Resource Manager.

Member Enumeration Documentation

◆ NodeType

Define the node types.

Enumerator
Compute 
Storage 
Head 
Any 

Constructor & Destructor Documentation

◆ NodeDesc() [1/2]

dp3::common::NodeDesc::NodeDesc ( )
inline

Construct an empty object. By default its type is Any.

◆ NodeDesc() [2/2]

dp3::common::NodeDesc::NodeDesc ( const ParameterSet )
explicit

Construct from the given parameterset.

Member Function Documentation

◆ addFileSys()

void dp3::common::NodeDesc::addFileSys ( const std::string &  fsName,
const std::string &  mountPoint 
)

Add a file system the node has access to. A possible leading /auto is removed from the mountPoint.

◆ findFileSys()

std::string dp3::common::NodeDesc::findFileSys ( const std::string &  fileName) const

Find the file system a file is on. The file must be given with its absolute file name. It does it by comparing the mount points with the leading part of the file name.

◆ getFileSys()

const std::vector<std::string>& dp3::common::NodeDesc::getFileSys ( ) const
inline

Get the file systems it has access to.

◆ getMountPoints()

const std::vector<std::string>& dp3::common::NodeDesc::getMountPoints ( ) const
inline

Get the mount points of the file systems.

◆ getName()

const std::string& dp3::common::NodeDesc::getName ( ) const
inline

Get the name.

◆ getType()

NodeType dp3::common::NodeDesc::getType ( ) const
inline

Get the type.

◆ setName()

void dp3::common::NodeDesc::setName ( const std::string &  name)
inline

Set node name.

◆ setType()

void dp3::common::NodeDesc::setType ( NodeType  type)
inline

Set node type.

◆ write()

void dp3::common::NodeDesc::write ( std::ostream &  os,
const std::string &  prefix 
) const

Write it in parset format.


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