Loading...
Searching...
No Matches
XrdCmsClientConfig Class Reference

`#include <XrdCmsClientConfig.hh>`

Collaboration diagram for XrdCmsClientConfig:

## Public Types

enum | { FailOver = 'f' , RoundRob = 'r' }
enum | configHow { configMeta = 1 , configNorm = 2 , configProxy = 4 }
enum | configWhat { configMan = 1 , configSuper = 2 , configServer = 4 }

## Public Member Functions

| XrdCmsClientConfig (XrdCmsPerfMon *cmsmon=0)
| ~XrdCmsClientConfig ()
int | Configure (const char *cfn, configWhat What, configHow How)

## Public Attributes

char * | cidTag
char * | CMSPath
int | ConWait
int | FwdWait
int | haveMeta
XrdOucTList * | ManList
const char * | myHost
const char * | myName
char * | myVNID
XrdOucTList * | PanList
int | perfInt
XrdCmsPerfMon * | perfMon
int | PrepWait
int | RepDelay
int | RepNone
int | RepWait
int | RepWaitMS
unsigned char | SMode
unsigned char | SModeP

## Detailed Description

Definition at line 43 of file XrdCmsClientConfig.hh.

## Member Enumeration Documentation

## anonymous enum

anonymous enum

Enumerator
FailOver |
RoundRob |

Definition at line 74 of file XrdCmsClientConfig.hh.

{FailOver = 'f', RoundRob = 'r'};
XrdCmsClientConfig::FailOver
@ FailOver
Definition XrdCmsClientConfig.hh:74
XrdCmsClientConfig::RoundRob
@ RoundRob
Definition XrdCmsClientConfig.hh:74

## configHow

enum XrdCmsClientConfig::configHow

Enumerator
configMeta |
configNorm |
configProxy |

Definition at line 47 of file XrdCmsClientConfig.hh.

{configMeta = 1, configNorm = 2, configProxy = 4};
XrdCmsClientConfig::configProxy
@ configProxy
Definition XrdCmsClientConfig.hh:47
XrdCmsClientConfig::configNorm
@ configNorm
Definition XrdCmsClientConfig.hh:47
XrdCmsClientConfig::configMeta
@ configMeta
Definition XrdCmsClientConfig.hh:47

## configWhat

enum XrdCmsClientConfig::configWhat

Enumerator
configMan |
configSuper |
configServer |

Definition at line 48 of file XrdCmsClientConfig.hh.

{configMan = 1, configSuper = 2, configServer = 4};
XrdCmsClientConfig::configSuper
@ configSuper
Definition XrdCmsClientConfig.hh:48
XrdCmsClientConfig::configMan
@ configMan
Definition XrdCmsClientConfig.hh:48
XrdCmsClientConfig::configServer
@ configServer
Definition XrdCmsClientConfig.hh:48

## Constructor & Destructor Documentation

## XrdCmsClientConfig()

XrdCmsClientConfig::XrdCmsClientConfig | ( | XrdCmsPerfMon * | cmsmon = 0 | ) |

inline

Definition at line 76 of file XrdCmsClientConfig.hh.

: ConWait(10), RepWait(3), RepWaitMS(3000),
RepDelay(5), RepNone(8), PrepWait(33),
FwdWait(0), haveMeta(0), CMSPath(0),
myHost(0), myName(0), myVNID(0),
cidTag(0), ManList(0), PanList(0),
perfMon(0), perfInt(3*60),
SMode(FailOver), SModeP(FailOver),
VNID_Lib(0), VNID_Parms(0),
prfLib(0), prfParms(0), cmsMon(cmsmon),
isMeta(false), isMan(false), isServer(false) {}
XrdCmsClientConfig::myName
const char * myName
Definition XrdCmsClientConfig.hh:63
XrdCmsClientConfig::RepWaitMS
int RepWaitMS
Definition XrdCmsClientConfig.hh:54
XrdCmsClientConfig::perfInt
int perfInt
Definition XrdCmsClientConfig.hh:70
XrdCmsClientConfig::RepNone
int RepNone
Definition XrdCmsClientConfig.hh:56
XrdCmsClientConfig::cidTag
char * cidTag
Definition XrdCmsClientConfig.hh:65
XrdCmsClientConfig::myHost
const char * myHost
Definition XrdCmsClientConfig.hh:62
XrdCmsClientConfig::perfMon
XrdCmsPerfMon * perfMon
Definition XrdCmsClientConfig.hh:69
XrdCmsClientConfig::FwdWait
int FwdWait
Definition XrdCmsClientConfig.hh:58
XrdCmsClientConfig::SMode
unsigned char SMode
Definition XrdCmsClientConfig.hh:71
XrdCmsClientConfig::SModeP
unsigned char SModeP
Definition XrdCmsClientConfig.hh:72
XrdCmsClientConfig::PrepWait
int PrepWait
Definition XrdCmsClientConfig.hh:57
XrdCmsClientConfig::haveMeta
int haveMeta
Definition XrdCmsClientConfig.hh:59
XrdCmsClientConfig::ManList
XrdOucTList * ManList
Definition XrdCmsClientConfig.hh:67
XrdCmsClientConfig::myVNID
char * myVNID
Definition XrdCmsClientConfig.hh:64
XrdCmsClientConfig::CMSPath
char * CMSPath
Definition XrdCmsClientConfig.hh:61
XrdCmsClientConfig::PanList
XrdOucTList * PanList
Definition XrdCmsClientConfig.hh:68
XrdCmsClientConfig::ConWait
int ConWait
Definition XrdCmsClientConfig.hh:52
XrdCmsClientConfig::RepWait
int RepWait
Definition XrdCmsClientConfig.hh:53
XrdCmsClientConfig::RepDelay
int RepDelay
Definition XrdCmsClientConfig.hh:55

References cidTag, CMSPath, ConWait, FailOver, FwdWait, haveMeta, ManList, myHost, myName, myVNID, PanList, perfInt, perfMon, PrepWait, RepDelay, RepNone, RepWait, RepWaitMS, SMode, and SModeP.

## ~XrdCmsClientConfig()

XrdCmsClientConfig::~XrdCmsClientConfig | ( |  | ) |

Definition at line 74 of file XrdCmsClientConfig.cc.

{
XrdOucTList *tp, *tpp;
tpp = ManList;
while((tp = tpp)) {tpp = tp->next; delete tp;}
tpp = PanList;
while((tp = tpp)) {tpp = tp->next; delete tp;}
if (VNID_Lib) free(VNID_Lib);
if (VNID_Parms) free(VNID_Parms);
if (prfLib) free(prfLib);
if (prfParms) free(prfParms);
}
XrdOucTList::next
XrdOucTList * next
Definition XrdOucTList.hh:45

References ManList, XrdOucTList::next, and PanList.

## Member Function Documentation

## Configure()

int XrdCmsClientConfig::Configure | ( | const char * | cfn,
|  | configWhat | What,
|  | configHow | How )

Definition at line 93 of file XrdCmsClientConfig.cc.

{
/*
Function: Establish configuration at start up time.
Input: None.
Output: 0 upon success or !0 otherwise.
*/
XrdOucTList *tpe, *tpl;
int i, NoGo = 0;
const char *eText = 0;
char buff[256], *slash, *temp, *bP, sfx;
// Preset some values
//
myHost = getenv("XRDHOST");
if (!myHost) myHost = "localhost";
myName = XrdOucUtils::InstName(1);
CMSPath = getenv("XRDADMINPATH");
if (CMSPath && *CMSPath) CMSPath = strdup(CMSPath);
else CMSPath = XrdOucUtils::genPath("/tmp/",XrdOucUtils::InstName(myName,0));
isMeta = (How & configMeta) != 0;
isMan = (What& configMan) != 0;
isServer = What == configServer;
// Process the configuration file
//
if (!(NoGo = ConfigProc(cfn)) && isMan)
{if (How & configProxy) eText = (PanList ? 0 : "Proxy manager");
else if (!ManList)
eText = (How & configMeta ? "Meta manager" : "Manager");
if (eText) {Say.Emsg("Config", eText, "not specified."); NoGo=1;}
}
// Reset tracing options
//
if (getenv("XRDDEBUG")) Trace.What = TRACE_ALL;
// Set proper local socket path
//
temp = XrdOucUtils::genPath(CMSPath, (const char *)0, ".olb");
free(CMSPath); CMSPath = temp;
XrdOucEnv::Export("XRDCMSPATH", temp);
XrdOucEnv::Export("XRDOLBPATH", temp); //Compatibility
// Determine what type of role we are playing
//
if (What & configServer) sfx = 's';
else if (What & configSuper) sfx = 'u';
else sfx = 'm';
// Determine which manager list we will be using
//
if (How & configProxy)
{sfx = toupper(sfx);
tpl = PanList;
} else tpl = ManList;
// Generate the system ID for this configuration.
//
if (!ConfigSID(cfn, tpl, sfx)) NoGo = 1;
// Export the manager list
//
if (tpl)
{i = 0; tpe = tpl;
while(tpe) {i += strlen(tpe->text) + 9; tpe = tpe->next;}
bP = temp = (char *)malloc(i);
while(tpl)
{bP += sprintf(bP, "%s:%d ", tpl->text, tpl->val);
tpl = tpl->next;
}
*(bP-1) = '\0';
XrdOucEnv::Export("XRDCMSMAN", temp); free(temp);
}
// Construct proper communications path for a supervisor node
//
i = strlen(CMSPath);
if (What & configSuper)
{while((tpl = ManList)) {ManList = tpl->next; delete tpl;}
slash = (CMSPath[i-1] == '/' ? (char *)"" : (char *)"/");
sprintf(buff, "%s%solbd.super", CMSPath, slash);
ManList = new XrdOucTList(buff, -1, 0);
SMode = SModeP = FailOver;
}
// Construct proper old communication path for a target node
//
temp = (What & (configMan|configSuper) ? (char *)"nimda" : (char *)"admin");
slash = (CMSPath[i-1] == '/' ? (char *)"" : (char *)"/");
sprintf(buff, "%s%solbd.%s", CMSPath, slash, temp);
free(CMSPath); CMSPath = strdup(buff);
RepWaitMS = RepWait * 1000;
// Initialize the msg queue
//
if (XrdCmsClientMsg::Init())
{Say.Emsg("Config", ENOMEM, "allocate initial msg objects");
NoGo = 1;
}
// Load the performance monitor (server pre-screened) if specified.
//
if (prfLib && cmsMon)
{perfMon = XrdCmsUtils::loadPerfMon(&Say, prfLib, XrdCms::myVersion);
if (!perfMon || !perfMon->Configure(cfn, prfParms, *Say.logger(),
*cmsMon, 0, false))
{Say.Emsg("Config","Unable to configure performance monitor plugin.");
NoGo = 1;
}
}
return NoGo;
}
TRACE_ALL
#define TRACE_ALL
Definition XrdTrace.hh:35
XrdCmsClientMsg::Init
static int Init()
Definition XrdCmsClientMsg.cc:91
XrdCmsUtils::loadPerfMon
static XrdCmsPerfMon * loadPerfMon(XrdSysError *eDest, const char *libPath, XrdVersionInfo &urVer)
Load the performance monitor plugin.
Definition XrdCmsUtils.cc:108
XrdOucEnv::Export
static int Export(const char *Var, const char *Val)
Definition XrdOucEnv.cc:170
XrdOucTList::text
char * text
Definition XrdOucTList.hh:46
XrdOucUtils::genPath
static char * genPath(const char *path, const char *inst, const char *psfx=0)
Definition XrdOucUtils.cc:463
XrdOucUtils::InstName
static const char * InstName(int TranOpt=0)
Definition XrdOucUtils.cc:809
XrdSysError::Emsg
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
Definition XrdSysError.cc:95
XrdSysError::logger
XrdSysLogger * logger(XrdSysLogger *lp=0)
Definition XrdSysError.hh:141
XrdSysTrace::What
int What
Definition XrdSysTrace.hh:64
XrdCms::myVersion
XrdVersionInfo myVersion
XrdCms::Say
XrdSysError Say
Definition XrdCmsManager.cc:62
XrdCms::Trace
XrdSysTrace Trace("cms")
Definition XrdCmsManager.cc:64

References CMSPath, configMan, configMeta, configProxy, configServer, configSuper, XrdOucEnv::Export(), FailOver, XrdOucUtils::genPath(), XrdCmsClientMsg::Init(), XrdOucUtils::InstName(), XrdCmsUtils::loadPerfMon(), ManList, myHost, myName, XrdCms::myVersion, XrdOucTList::next, PanList, perfMon, RepWait, RepWaitMS, XrdCms::Say, SMode, SModeP, XrdOucTList::text, XrdCms::Trace, and TRACE_ALL.

Referenced by XrdCmsFinderRMT::Configure(), and XrdCmsFinderTRG::Configure().

Here is the call graph for this function:
Here is the caller graph for this function:

## Member Data Documentation

## cidTag

char* XrdCmsClientConfig::cidTag

Definition at line 65 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsClientConfig().

## CMSPath

char* XrdCmsClientConfig::CMSPath

Definition at line 61 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsClientConfig(), Configure(), XrdCmsFinderRMT::Configure(), and XrdCmsFinderTRG::Configure().

## ConWait

int XrdCmsClientConfig::ConWait

Definition at line 52 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsClientConfig(), and XrdCmsFinderRMT::Configure().

## FwdWait

int XrdCmsClientConfig::FwdWait

Definition at line 58 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsClientConfig(), and XrdCmsFinderRMT::Configure().

## haveMeta

int XrdCmsClientConfig::haveMeta

Definition at line 59 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsClientConfig(), and XrdCmsFinderRMT::Configure().

## ManList

XrdOucTList* XrdCmsClientConfig::ManList

Definition at line 67 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsClientConfig(), ~XrdCmsClientConfig(), Configure(), XrdCmsFinderRMT::Configure(), and XrdCmsFinderTRG::Configure().

## myHost

const char* XrdCmsClientConfig::myHost

Definition at line 62 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsClientConfig(), and Configure().

## myName

const char* XrdCmsClientConfig::myName

Definition at line 63 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsClientConfig(), and Configure().

## myVNID

char* XrdCmsClientConfig::myVNID

Definition at line 64 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsClientConfig(), XrdCmsFinderRMT::Configure(), and XrdCmsFinderTRG::Configure().

## PanList

XrdOucTList* XrdCmsClientConfig::PanList

Definition at line 68 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsClientConfig(), ~XrdCmsClientConfig(), Configure(), XrdCmsFinderRMT::Configure(), and XrdCmsFinderTRG::Configure().

## perfInt

int XrdCmsClientConfig::perfInt

Definition at line 70 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsClientConfig(), and XrdCmsFinderTRG::Configure().

## perfMon

XrdCmsPerfMon* XrdCmsClientConfig::perfMon

Definition at line 69 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsClientConfig(), Configure(), and XrdCmsFinderTRG::Configure().

## PrepWait

int XrdCmsClientConfig::PrepWait

Definition at line 57 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsClientConfig(), and XrdCmsFinderRMT::Configure().

## RepDelay

int XrdCmsClientConfig::RepDelay

Definition at line 55 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsClientConfig(), and XrdCmsFinderRMT::Configure().

## RepNone

int XrdCmsClientConfig::RepNone

Definition at line 56 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsClientConfig(), and XrdCmsFinderRMT::Configure().

## RepWait

int XrdCmsClientConfig::RepWait

Definition at line 53 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsClientConfig(), Configure(), and XrdCmsFinderRMT::Configure().

## RepWaitMS

int XrdCmsClientConfig::RepWaitMS

Definition at line 54 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsClientConfig(), and Configure().

## SMode

unsigned char XrdCmsClientConfig::SMode

Definition at line 71 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsClientConfig(), Configure(), and XrdCmsFinderRMT::Configure().

## SModeP

unsigned char XrdCmsClientConfig::SModeP

Definition at line 72 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsClientConfig(), Configure(), and XrdCmsFinderRMT::Configure().

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

- XrdCmsClientConfig.hh
- XrdCmsClientConfig.cc