XRootD
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.

◆ configHow

Enumerator
configMeta 
configNorm 
configProxy 

Definition at line 47 of file XrdCmsClientConfig.hh.

◆ configWhat

Enumerator
configMan 
configSuper 
configServer 

Definition at line 48 of file XrdCmsClientConfig.hh.

Constructor & Destructor Documentation

◆ XrdCmsClientConfig()

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

Definition at line 76 of file XrdCmsClientConfig.hh.

77  : ConWait(10), RepWait(3), RepWaitMS(3000),
78  RepDelay(5), RepNone(8), PrepWait(33),
79  FwdWait(0), haveMeta(0), CMSPath(0),
80  myHost(0), myName(0), myVNID(0),
81  cidTag(0), ManList(0), PanList(0),
82  perfMon(0), perfInt(3*60),
84  VNID_Lib(0), VNID_Parms(0),
85  prfLib(0), prfParms(0), cmsMon(cmsmon),
86  isMeta(false), isMan(false), isServer(false) {}
XrdCmsPerfMon * perfMon

◆ ~XrdCmsClientConfig()

XrdCmsClientConfig::~XrdCmsClientConfig ( )

Definition at line 74 of file XrdCmsClientConfig.cc.

75 {
76  XrdOucTList *tp, *tpp;
77 
78  tpp = ManList;
79  while((tp = tpp)) {tpp = tp->next; delete tp;}
80  tpp = PanList;
81  while((tp = tpp)) {tpp = tp->next; delete tp;}
82 
83  if (VNID_Lib) free(VNID_Lib);
84  if (VNID_Parms) free(VNID_Parms);
85  if (prfLib) free(prfLib);
86  if (prfParms) free(prfParms);
87 }
XrdOucTList * next
Definition: XrdOucTList.hh:45

References XrdOucTList::next.

Member Function Documentation

◆ Configure()

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

Definition at line 93 of file XrdCmsClientConfig.cc.

95 {
96 /*
97  Function: Establish configuration at start up time.
98 
99  Input: None.
100 
101  Output: 0 upon success or !0 otherwise.
102 */
103  XrdOucTList *tpe, *tpl;
104  int i, NoGo = 0;
105  const char *eText = 0;
106  char buff[256], *slash, *temp, *bP, sfx;
107 
108 // Preset some values
109 //
110  myHost = getenv("XRDHOST");
111  if (!myHost) myHost = "localhost";
113  CMSPath = getenv("XRDADMINPATH");
114  if (CMSPath && *CMSPath) CMSPath = strdup(CMSPath);
116  isMeta = (How & configMeta) != 0;
117  isMan = (What& configMan) != 0;
118  isServer = What == configServer;
119 
120 // Process the configuration file
121 //
122  if (!(NoGo = ConfigProc(cfn)) && isMan)
123  {if (How & configProxy) eText = (PanList ? 0 : "Proxy manager");
124  else if (!ManList)
125  eText = (How & configMeta ? "Meta manager" : "Manager");
126  if (eText) {Say.Emsg("Config", eText, "not specified."); NoGo=1;}
127  }
128 
129 // Reset tracing options
130 //
131  if (getenv("XRDDEBUG")) Trace.What = TRACE_ALL;
132 
133 // Set proper local socket path
134 //
135  temp = XrdOucUtils::genPath(CMSPath, (const char *)0, ".olb");
136  free(CMSPath); CMSPath = temp;
137  XrdOucEnv::Export("XRDCMSPATH", temp);
138  XrdOucEnv::Export("XRDOLBPATH", temp); //Compatibility
139 
140 // Determine what type of role we are playing
141 //
142  if (What & configServer) sfx = 's';
143  else if (What & configSuper) sfx = 'u';
144  else sfx = 'm';
145 
146 // Determine which manager list we will be using
147 //
148  if (How & configProxy)
149  {sfx = toupper(sfx);
150  tpl = PanList;
151  } else tpl = ManList;
152 
153 // Generate the system ID for this configuration.
154 //
155  if (!ConfigSID(cfn, tpl, sfx)) NoGo = 1;
156 
157 // Export the manager list
158 //
159  if (tpl)
160  {i = 0; tpe = tpl;
161  while(tpe) {i += strlen(tpe->text) + 9; tpe = tpe->next;}
162  bP = temp = (char *)malloc(i);
163  while(tpl)
164  {bP += sprintf(bP, "%s:%d ", tpl->text, tpl->val);
165  tpl = tpl->next;
166  }
167  *(bP-1) = '\0';
168  XrdOucEnv::Export("XRDCMSMAN", temp); free(temp);
169  }
170 
171 // Construct proper communications path for a supervisor node
172 //
173  i = strlen(CMSPath);
174  if (What & configSuper)
175  {while((tpl = ManList)) {ManList = tpl->next; delete tpl;}
176  slash = (CMSPath[i-1] == '/' ? (char *)"" : (char *)"/");
177  sprintf(buff, "%s%solbd.super", CMSPath, slash);
178  ManList = new XrdOucTList(buff, -1, 0);
179  SMode = SModeP = FailOver;
180  }
181 
182 // Construct proper old communication path for a target node
183 //
184  temp = (What & (configMan|configSuper) ? (char *)"nimda" : (char *)"admin");
185  slash = (CMSPath[i-1] == '/' ? (char *)"" : (char *)"/");
186  sprintf(buff, "%s%solbd.%s", CMSPath, slash, temp);
187  free(CMSPath); CMSPath = strdup(buff);
188 
189  RepWaitMS = RepWait * 1000;
190 
191 // Initialize the msg queue
192 //
193  if (XrdCmsClientMsg::Init())
194  {Say.Emsg("Config", ENOMEM, "allocate initial msg objects");
195  NoGo = 1;
196  }
197 
198 // Load the performance monitor (server pre-screened) if specified.
199 //
200  if (prfLib && cmsMon)
202  if (!perfMon || !perfMon->Configure(cfn, prfParms, *Say.logger(),
203  *cmsMon, 0, false))
204  {Say.Emsg("Config","Unable to configure performance monitor plugin.");
205  NoGo = 1;
206  }
207  }
208 
209  return NoGo;
210 }
#define TRACE_ALL
Definition: XrdTrace.hh:35
static int Init()
virtual bool Configure(const char *cfn, char *Parms, XrdSysLogger &Logger, XrdCmsPerfMon &cmsMon, XrdOucEnv *EnvInfo, bool isCMS)
static XrdCmsPerfMon * loadPerfMon(XrdSysError *eDest, const char *libPath, XrdVersionInfo &urVer)
Load the performance monitor plugin.
Definition: XrdCmsUtils.cc:108
static int Export(const char *Var, const char *Val)
Definition: XrdOucEnv.cc:188
char * text
Definition: XrdOucTList.hh:46
static char * genPath(const char *path, const char *inst, const char *psfx=0)
Definition: XrdOucUtils.cc:463
static const char * InstName(int TranOpt=0)
Definition: XrdOucUtils.cc:809
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
Definition: XrdSysError.cc:95
XrdSysLogger * logger(XrdSysLogger *lp=0)
Definition: XrdSysError.hh:141
XrdVersionInfo myVersion
XrdSysError Say
XrdSysTrace Trace("cms")

References XrdSysError::Emsg(), XrdOucEnv::Export(), XrdOucUtils::genPath(), XrdCmsClientMsg::Init(), XrdOucUtils::InstName(), XrdCmsUtils::loadPerfMon(), XrdSysError::logger(), XrdCms::myVersion, XrdOucTList::next, XrdCms::Say, XrdOucTList::text, XrdCms::Trace, TRACE_ALL, and XrdSysTrace::What.

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.

◆ CMSPath

char* XrdCmsClientConfig::CMSPath

Definition at line 61 of file XrdCmsClientConfig.hh.

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

◆ ConWait

int XrdCmsClientConfig::ConWait

Definition at line 52 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsFinderRMT::Configure().

◆ FwdWait

int XrdCmsClientConfig::FwdWait

Definition at line 58 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsFinderRMT::Configure().

◆ haveMeta

int XrdCmsClientConfig::haveMeta

Definition at line 59 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsFinderRMT::Configure().

◆ ManList

XrdOucTList* XrdCmsClientConfig::ManList

Definition at line 67 of file XrdCmsClientConfig.hh.

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

◆ myHost

const char* XrdCmsClientConfig::myHost

Definition at line 62 of file XrdCmsClientConfig.hh.

◆ myName

const char* XrdCmsClientConfig::myName

Definition at line 63 of file XrdCmsClientConfig.hh.

◆ myVNID

char* XrdCmsClientConfig::myVNID

Definition at line 64 of file XrdCmsClientConfig.hh.

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

◆ PanList

XrdOucTList* XrdCmsClientConfig::PanList

Definition at line 68 of file XrdCmsClientConfig.hh.

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

◆ perfInt

int XrdCmsClientConfig::perfInt

Definition at line 70 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsFinderTRG::Configure().

◆ perfMon

XrdCmsPerfMon* XrdCmsClientConfig::perfMon

Definition at line 69 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsFinderTRG::Configure().

◆ PrepWait

int XrdCmsClientConfig::PrepWait

Definition at line 57 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsFinderRMT::Configure().

◆ RepDelay

int XrdCmsClientConfig::RepDelay

Definition at line 55 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsFinderRMT::Configure().

◆ RepNone

int XrdCmsClientConfig::RepNone

Definition at line 56 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsFinderRMT::Configure().

◆ RepWait

int XrdCmsClientConfig::RepWait

Definition at line 53 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsFinderRMT::Configure().

◆ RepWaitMS

int XrdCmsClientConfig::RepWaitMS

Definition at line 54 of file XrdCmsClientConfig.hh.

◆ SMode

unsigned char XrdCmsClientConfig::SMode

Definition at line 71 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsFinderRMT::Configure().

◆ SModeP

unsigned char XrdCmsClientConfig::SModeP

Definition at line 72 of file XrdCmsClientConfig.hh.

Referenced by XrdCmsFinderRMT::Configure().


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