#include <XrdSsiCms.hh>
Public Member Functions | |
void | Added (const char *name, bool pend=false) |
bool | DataContext () |
const char *const * | Managers (int &mNum) |
void | Removed (const char *name) |
void | Resume (bool perm=true) |
void | Suspend (bool perm=true) |
int | Resource (int n) |
int | Reserve (int n=1) |
int | Release (int n=1) |
void | Utilization (unsigned int util, bool alert=false) |
XrdSsiCms () | |
XrdSsiCms (XrdCmsClient *cmsP) | |
virtual | ~XrdSsiCms () |
Private Attributes | |
XrdCmsClient * | theCms |
char ** | manList |
int | manNum |
XrdSsiCms::XrdSsiCms | ( | ) | [inline] |
XrdSsiCms::XrdSsiCms | ( | XrdCmsClient * | cmsP | ) |
virtual XrdSsiCms::~XrdSsiCms | ( | ) | [virtual] |
void XrdSsiCms::Added | ( | const char * | name, | |
bool | pend = false | |||
) | [virtual] |
Notify the cluster of a newly added endpoint name or whose state has changed on on this server node.
name | The logical name. | |
pend | When true, the name is scheduled to be present in the future. |
Implements XrdSsiCluster.
bool XrdSsiCms::DataContext | ( | ) | [inline, virtual] |
Determine whether or not the SSI plug-in is running in a data context.
Implements XrdSsiCluster.
const char* const* XrdSsiCms::Managers | ( | int & | mNum | ) | [inline, virtual] |
Obtain the list of nodes that are managing this cluster.
mNum | Place to put the number of managers in the returned array. |
Implements XrdSsiCluster.
int XrdSsiCms::Release | ( | int | n = 1 |
) | [inline, virtual] |
Increase 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 server.
n | The value to add to the resources available (default 1). The total amount is capped by the amount specified by Resource(). |
Implements XrdSsiCluster.
References XrdCmsClient::Release(), and theCms.
void XrdSsiCms::Removed | ( | const char * | name | ) | [virtual] |
Notify the cluster that a name is no longer available on this server node.
name | The logical name that is no longer available. |
Implements XrdSsiCluster.
int XrdSsiCms::Reserve | ( | int | n = 1 |
) | [inline, virtual] |
Decrease 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 server.
n | The value by which resources are decreased (default 1). |
Implements XrdSsiCluster.
References XrdCmsClient::Reserve(), and theCms.
int XrdSsiCms::Resource | ( | int | n | ) | [inline, virtual] |
Enable the Reserve() & Release() methods.
n | a positive integer that specifies the amount of resource units that are available. It may be reset at any time. |
Implements XrdSsiCluster.
References XrdCmsClient::Resource(), and theCms.
void XrdSsiCms::Resume | ( | bool | perm = true |
) | [inline, virtual] |
Resume service after a suspension.
perm | When true the resume persist across server restarts. Otherwise, it is treated as a temporary request. |
Implements XrdSsiCluster.
References XrdCmsClient::Resume(), and theCms.
void XrdSsiCms::Suspend | ( | bool | perm = true |
) | [inline, virtual] |
Suspend service.
perm | When true the suspend persist across server restarts. Otherwise, it is treated as a temporary request. |
Implements XrdSsiCluster.
References XrdCmsClient::Suspend(), and theCms.
void XrdSsiCms::Utilization | ( | unsigned int | util, | |
bool | alert = false | |||
) | [inline, virtual] |
Report utilization of this server. This may be used in lieu of general performance metric reporting. For consistent results use only one method.
util | A value from 0 to 100 representing utilization. Values greater than 100 are set to be 100. | |
alert | When true the utilization is forcibly report to the cluster managers. Otherwise, reporting is done only when it will significantly change server selection. |
Implements XrdSsiCluster.
References theCms, and XrdCmsClient::Utilization().
char** XrdSsiCms::manList [private] |
Referenced by Managers().
int XrdSsiCms::manNum [private] |
Referenced by Managers().
XrdCmsClient* XrdSsiCms::theCms [private] |
Referenced by Release(), Reserve(), Resource(), Resume(), Suspend(), and Utilization().