XRootD
XrdCmsClient Class Referenceabstract

#include <XrdCmsClient.hh>

+ Inheritance diagram for XrdCmsClient:
+ Collaboration diagram for XrdCmsClient:

Public Types

enum  Persona {
  amLocal ,
  amRemote ,
  amTarget
}
 

Public Member Functions

 XrdCmsClient (Persona acting)
 
virtual ~XrdCmsClient ()
 Destructor. More...
 
virtual void Added (const char *path, int Pend=0)
 
virtual int Configure (const char *cfn, char *Parms, XrdOucEnv *EnvInfo)=0
 
virtual int Forward (XrdOucErrInfo &Resp, const char *cmd, const char *arg1=0, const char *arg2=0, XrdOucEnv *Env1=0, XrdOucEnv *Env2=0)
 
virtual int isRemote ()
 
virtual int Locate (XrdOucErrInfo &Resp, const char *path, int flags, XrdOucEnv *Info=0)=0
 
virtual XrdOucTListManagers ()
 
virtual int Prepare (XrdOucErrInfo &Resp, XrdSfsPrep &pargs, XrdOucEnv *Info=0)
 
virtual int Release (int n=1)
 
virtual void Removed (const char *path)
 
virtual int Reserve (int n=1)
 
virtual int Resource (int n)
 
virtual void Resume (int Perm=1)
 
virtual int Space (XrdOucErrInfo &Resp, const char *path, XrdOucEnv *Info=0)=0
 
virtual void Suspend (int Perm=1)
 
virtual void Utilization (unsigned int util, bool alert=false)
 

Protected Attributes

Persona myPersona
 

Detailed Description

Definition at line 115 of file XrdCmsClient.hh.

Member Enumeration Documentation

◆ Persona

Constructor

Parameters
actingThe type of function this object is performing.
Enumerator
amLocal 

Not affiliated with a cluster.

amRemote 

Am a manager and issue redirects.

amTarget 

Am a server and field redirects.

Definition at line 352 of file XrdCmsClient.hh.

352  {amLocal,
353  amRemote,
354  amTarget
355  };
@ amRemote
Am a manager and issue redirects.
@ amTarget
Am a server and field redirects.
@ amLocal
Not affiliated with a cluster.

Constructor & Destructor Documentation

◆ XrdCmsClient()

XrdCmsClient::XrdCmsClient ( Persona  acting)
inline

Definition at line 357 of file XrdCmsClient.hh.

357 : myPersona(acting) {}
Persona myPersona

◆ ~XrdCmsClient()

virtual XrdCmsClient::~XrdCmsClient ( )
inlinevirtual

Destructor.

Definition at line 363 of file XrdCmsClient.hh.

363 {}

Member Function Documentation

◆ Added()

virtual void XrdCmsClient::Added ( const char *  path,
int  Pend = 0 
)
inlinevirtual

Notify the cms of a newly added file or a file whose state has changed on a data server node.

Parameters
pathThe logical file name.
PendWhen true, the file is scheduled to be present in the future (e.g. copied in).

Reimplemented in XrdCmsRedirLocal, XrdCmsFinderTRG, and XrdCmsFinderRMT.

Definition at line 128 of file XrdCmsClient.hh.

128 { (void)path; (void)Pend; }

Referenced by XrdSsiCms::Added(), XrdCmsRedirLocal::Added(), XrdOfsFile::close(), XrdOfs::mkdir(), XrdOfsFile::open(), and XrdOfs::rename().

+ Here is the caller graph for this function:

◆ Configure()

virtual int XrdCmsClient::Configure ( const char *  cfn,
char *  Parms,
XrdOucEnv EnvInfo 
)
pure virtual

Configure the client object.

Parameters
cfnThe configuration file name.
ParmsAny parameters specified in the cmslib directive. If none, the pointer may be null.
EnvInfoEnvironmental information of the caller.
Returns
Success !0 Failure =0

Implemented in XrdCmsRedirLocal, XrdCmsFinderTRG, and XrdCmsFinderRMT.

Referenced by XrdCmsRedirLocal::Configure(), and XrdOfsConfigPI::Configure().

+ Here is the caller graph for this function:

◆ Forward()

virtual int XrdCmsClient::Forward ( XrdOucErrInfo Resp,
const char *  cmd,
const char *  arg1 = 0,
const char *  arg2 = 0,
XrdOucEnv Env1 = 0,
XrdOucEnv Env2 = 0 
)
inlinevirtual

Relay a meta-operation to all nodes in the cluster.

This method is only used on manager nodes and is enabled by the ofs.forward directive.

Parameters
RespObject where messages are to be returned.
cmdThe operation being performed (see table below). If it starts with a '+' then a response (2way) is needed. Otherwise, a best-effort is all that is all that is required and success can always be returned.
arg11st argument to cmd.
arg22nd argument to cmd, which may be null if none exists.
Env1Associated environmental information for arg1 (e.g., cgi info which can be retrieved by Env1->Env(<len>)).
Env2Associated environmental information for arg2 (e.g., cgi info which can be retrieved by Env1->Env(<len>)).
     cmd       arg1    arg2           cmd       arg1    arg2
     --------  ------  ------         --------  ------  ------
     [+]chmod  <path>  <mode %o>      [+]rmdir  <path>  0
     [+]mkdir  <path>  <mode %o>      [+]mv     <oldp>  <newp>
     [+]mkpath <path>  <mode %o>      [+]trunc  <path>  <size %lld>
     [+]rm     <path>  0
Returns
As explained under "return conventions".

Reimplemented in XrdCmsRedirLocal, and XrdCmsFinderRMT.

Definition at line 173 of file XrdCmsClient.hh.

176 {
177  (void)Resp; (void)cmd; (void)arg1; (void)arg2; (void)Env1; (void)Env2;
178  return 0;
179 }

Referenced by XrdCmsRedirLocal::Forward().

+ Here is the caller graph for this function:

◆ isRemote()

virtual int XrdCmsClient::isRemote ( )
inlinevirtual

Check if this client is configured for a manager node.

Returns
!0 Yes, configured as a manager. =0 No.

Reimplemented in XrdCmsRedirLocal.

Definition at line 188 of file XrdCmsClient.hh.

References amRemote, and myPersona.

Referenced by XrdOfs::chksum(), XrdOfs::chmod(), XrdOfs::exists(), XrdOfs::FAttr(), XrdOfs::fsctl(), XrdCmsRedirLocal::isRemote(), XrdOfs::mkdir(), XrdOfsDirectory::open(), XrdOfs::rename(), XrdOfs::stat(), and XrdOfs::truncate().

+ Here is the caller graph for this function:

◆ Locate()

virtual int XrdCmsClient::Locate ( XrdOucErrInfo Resp,
const char *  path,
int  flags,
XrdOucEnv Info = 0 
)
pure virtual

Retrieve file location information.

Parameters
RespObject where message or response is to be returned.
pathThe logical path whise location is wanted.
flagsOne or more of the following:
     SFS_O_LOCATE  - return the list of servers that have the file.
                     Otherwise, redirect to the best server for the file.
     SFS_O_NOWAIT  - w/ SFS_O_LOCATE return readily available info.
                     Otherwise, select online files only.
     SFS_O_CREAT   - file will be created.
     SFS_O_NOWAIT  - select server if file is online.
     SFS_O_REPLICA - a replica of the file will be made.
     SFS_O_STAT    - only stat() information wanted.
     SFS_O_TRUNC   - file will be truncated.

     For any the the above, additional flags are passed:
     SFS_O_META    - data will not change (inode operation only)
     SFS_O_RESET   - reset cached info and recaculate the location(s).
     SFS_O_WRONLY  - file will be only written    (o/w RDWR   or RDONLY).
     SFS_O_RDWR    - file may be read and written (o/w WRONLY or RDONLY).
InfoAssociated environmental information for arg2 (e.g., cgi info which can be retrieved by Env1->Env(<len>)).
Returns
As explained under "return conventions".

Implemented in XrdCmsFinderTRG, XrdCmsFinderRMT, and XrdCmsRedirLocal.

Referenced by XrdOfs::chksum(), XrdOfs::chmod(), XrdOfs::exists(), XrdOfs::FAttr(), XrdOfs::fsctl(), XrdCmsRedirLocal::Locate(), XrdOfs::mkdir(), XrdOfsDirectory::open(), XrdOfsFile::open(), XrdOfs::rename(), XrdOfs::stat(), and XrdOfs::truncate().

+ Here is the caller graph for this function:

◆ Managers()

virtual XrdOucTList* XrdCmsClient::Managers ( )
inlinevirtual

Obtain the list of cmsd's being used by a manager node along with their associated index numbers, origin 1.

Returns
The list of cmsd's being used. The list is considered permanent and is not deleted.

Reimplemented in XrdCmsRedirLocal, XrdCmsFinderTRG, and XrdCmsFinderRMT.

Definition at line 232 of file XrdCmsClient.hh.

232 {return 0;}

Referenced by XrdSsiCms::XrdSsiCms(), and XrdCmsRedirLocal::Managers().

+ Here is the caller graph for this function:

◆ Prepare()

virtual int XrdCmsClient::Prepare ( XrdOucErrInfo Resp,
XrdSfsPrep pargs,
XrdOucEnv Info = 0 
)
inlinevirtual

Start the preparation of a file for future processing.

Parameters
RespObject where message or response is to be returned.
pargsInformation on which and how to prepare the file.
InfoAssociated environmental information.
Returns
As explained under "return conventions".

Reimplemented in XrdCmsRedirLocal, XrdCmsFinderTRG, and XrdCmsFinderRMT.

Definition at line 244 of file XrdCmsClient.hh.

246 {
247  (void)Resp; (void)pargs; (void)Info;
248  return 0;
249 }
@ Info

References Info.

Referenced by XrdCmsRedirLocal::Prepare(), and XrdOfs::prepare().

+ Here is the caller graph for this function:

◆ Release()

virtual int XrdCmsClient::Release ( int  n = 1)
inlinevirtual

Increases the amount of resource available. When transitioning from a a non-positive to a positive resource amount, perform a resume so that additional clients may be dispatched to this data server.

Parameters
nThe value to add to the resources available (default 1). The total amount is capped by the amount specified by Resource().
Returns
The amount of resource left.

Reimplemented in XrdCmsRedirLocal, and XrdCmsFinderTRG.

Definition at line 316 of file XrdCmsClient.hh.

316 { (void)n; return 0;}

Referenced by XrdCmsRedirLocal::Release(), and XrdSsiCms::Release().

+ Here is the caller graph for this function:

◆ Removed()

virtual void XrdCmsClient::Removed ( const char *  path)
inlinevirtual

Notify the cmsd that a file or directory has been deleted. It is only called called on a data server node.

Parameters
pathThe logical file name that was removed.

Reimplemented in XrdCmsRedirLocal, XrdCmsFinderTRG, and XrdCmsFinderRMT.

Definition at line 258 of file XrdCmsClient.hh.

258 { (void)path; }

Referenced by XrdOfsFile::open(), XrdSsiCms::Removed(), XrdCmsRedirLocal::Removed(), XrdOfs::rename(), and XrdOfs::Unpersist().

+ Here is the caller graph for this function:

◆ Reserve()

virtual int XrdCmsClient::Reserve ( int  n = 1)
inlinevirtual

Decreases the amount of resources available. When the available resources becomes non-positive, perform a temporary suspend to prevent additional clients from being dispatched to this data server.

Parameters
nThe value by which resources are decreased (default 1).
Returns
The amount of resource left.

Reimplemented in XrdCmsRedirLocal, and XrdCmsFinderTRG.

Definition at line 303 of file XrdCmsClient.hh.

303 { (void)n; return 0;}

Referenced by XrdCmsRedirLocal::Reserve(), and XrdSsiCms::Reserve().

+ Here is the caller graph for this function:

◆ Resource()

virtual int XrdCmsClient::Resource ( int  n)
inlinevirtual

Enables the Reserve() & Release() methods.

Parameters
na positive integer that specifies the amount of resource units that are available. It may be reset at any time.
Returns
The previous resource value. This first call returns 0.

Reimplemented in XrdCmsRedirLocal, and XrdCmsFinderTRG.

Definition at line 291 of file XrdCmsClient.hh.

291 { (void)n; return 0;}

Referenced by XrdCmsRedirLocal::Resource(), and XrdSsiCms::Resource().

+ Here is the caller graph for this function:

◆ Resume()

virtual void XrdCmsClient::Resume ( int  Perm = 1)
inlinevirtual

Resume service after a suspension.

Parameters
PermWhen true the resume persist across server restarts. Otherwise, it is treated as a temporary request.

Reimplemented in XrdCmsRedirLocal, and XrdCmsFinderTRG.

Definition at line 267 of file XrdCmsClient.hh.

267 { (void)Perm; }

Referenced by XrdSsiCms::Resume(), and XrdCmsRedirLocal::Resume().

+ Here is the caller graph for this function:

◆ Space()

virtual int XrdCmsClient::Space ( XrdOucErrInfo Resp,
const char *  path,
XrdOucEnv Info = 0 
)
pure virtual

Obtain the overall space usage of a cluster. Called only on manager nodes.

Parameters
RespObject to hold response or error message.
pathAssociated logical path for the space request.
InfoAssociated cgi information for path.
Returns
Space information as defined by the response to kYR_statfs. For a typical implementation see XrdCmsNode::do_StatFS().

Implemented in XrdCmsFinderRMT, XrdCmsFinderTRG, and XrdCmsRedirLocal.

Referenced by XrdOfs::fsctl(), and XrdCmsRedirLocal::Space().

+ Here is the caller graph for this function:

◆ Suspend()

virtual void XrdCmsClient::Suspend ( int  Perm = 1)
inlinevirtual

Suspend service.

Parameters
PermWhen true the suspend persist across server restarts. Otherwise, it is treated as a temporary request.

Reimplemented in XrdCmsRedirLocal, and XrdCmsFinderTRG.

Definition at line 276 of file XrdCmsClient.hh.

276 { (void)Perm; }

Referenced by XrdSsiCms::Suspend(), and XrdCmsRedirLocal::Suspend().

+ Here is the caller graph for this function:

◆ Utilization()

virtual void XrdCmsClient::Utilization ( unsigned int  util,
bool  alert = false 
)
inlinevirtual

Report utilization of this server. This may be used in lieu of general performance metric reporting. For consistent results use only one method.

Parameters
utilA value from 0 to 100 representing utilization. Values greater than 100 are set to be 100.
alertWhen true the utilization is forcibly report to the cluster managers. Otherwise, reporting is done only when it will significantly change server selection.

Reimplemented in XrdCmsFinderTRG.

Definition at line 343 of file XrdCmsClient.hh.

344  {(void)util; (void)alert;}

Referenced by XrdSsiCms::Utilization().

+ Here is the caller graph for this function:

Member Data Documentation

◆ myPersona

Persona XrdCmsClient::myPersona
protected

Definition at line 367 of file XrdCmsClient.hh.

Referenced by isRemote().


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