XRootD
Loading...
Searching...
No Matches
XrdCmsConfig.hh
Go to the documentation of this file.
1#ifndef _CMS_CONFIG_H_
2#define _CMS_CONFIG_H_
3/******************************************************************************/
4/* */
5/* X r d C m s C o n f i g . h h */
6/* */
7/* (c) 2011 by the Board of Trustees of the Leland Stanford, Jr., University */
8/* All Rights Reserved */
9/* Produced by Andrew Hanushevsky for Stanford University under contract */
10/* DE-AC02-76-SFO0515 with the Department of Energy */
11/* */
12/* This file is part of the XRootD software suite. */
13/* */
14/* XRootD is free software: you can redistribute it and/or modify it under */
15/* the terms of the GNU Lesser General Public License as published by the */
16/* Free Software Foundation, either version 3 of the License, or (at your */
17/* option) any later version. */
18/* */
19/* XRootD is distributed in the hope that it will be useful, but WITHOUT */
20/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
21/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
22/* License for more details. */
23/* */
24/* You should have received a copy of the GNU Lesser General Public License */
25/* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
26/* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
27/* */
28/* The copyright holder's institutional names and contributor's names may not */
29/* be used to endorse or promote products derived from this software without */
30/* specific prior written permission of the institution or contributor. */
31/******************************************************************************/
32
33#include <cstdlib>
34
35#include "Xrd/XrdJob.hh"
36#include "XrdCms/XrdCmsPList.hh"
37#include "XrdCms/XrdCmsTypes.hh"
38#include "XrdOuc/XrdOucPList.hh"
39#include "XrdOuc/XrdOucTList.hh"
40
41class XrdInet;
43class XrdScheduler;
44class XrdNetSecurity;
45class XrdNetSocket;
46class XrdOss;
47class XrdSysError;
48class XrdOucEnv;
49class XrdOucName2Name;
50class XrdOucProg;
51class XrdOucStream;
52class XrdCmsAdmin;
53
54struct XrdVersionInfo;
55
56class XrdCmsConfig : public XrdJob
57{
58public:
59
61int Configure1(int argc, char **argv, char *cfn);
62int Configure2();
63int ConfigXeq(char *var, XrdOucStream &CFile, XrdSysError *eDest);
64void DoIt();
65int GenLocalPath(const char *oldp, char *newp);
66int asManager() {return isManager;}
67int asMetaMan() {return isManager && isMeta;}
68int asPeer() {return isPeer;}
69int asProxy() {return isProxy;}
70int asServer() {return isServer;}
71int asSolo() {return isSolo;}
72
73int LUPDelay; // Maximum delay at look-up
74int LUPHold; // Maximum hold at look-up (in millisconds)
75int DELDelay; // Maximum delay for deleting an offline server
76int DRPDelay; // Maximum delay for dropping an offline server
77int PSDelay; // Maximum delay time before peer is selected
78int RWDelay; // R/W lookup delay handling (0 | 1 | 2)
79int QryDelay; // Query Response Deadline
80int QryMinum; // Query Response Deadline Minimum Available
81int SRVDelay; // Minimum delay at startup
82int SUPCount; // Minimum server count
83int SUPLevel; // Minimum server count as floating percentage
84int SUPDelay; // Maximum delay when server count falls below min
85int SUSDelay; // Maximum delay when suspended
86int MaxLoad; // Maximum load
87int MaxDelay; // Maximum load delay
88int MaxRetries; // Maximum number of non-DFS select retries
89int MsgTTL; // Maximum msg lifetime
90int RefReset; // Min seconds before a global ref count reset
91int RefTurn; // Min references before a global ref count reset
92int AskPerf; // Seconds between perf queries
93int AskPing; // Number of ping requests per AskPerf window
94int PingTick; // Ping clock value
95int LogPerf; // AskPerf intervals before logging perf
96
97int PortTCP; // TCP Port to listen on
98int PortSUP; // TCP Port to listen on (supervisor)
99XrdInet *NetTCP; // -> Network Object
100
101int P_cpu; // % CPU Capacity in load factor
102int P_dsk; // % DSK Capacity in load factor
103int P_fuzz; // % Capacity to fuzz when comparing
104int P_gsdf; // % Global share default (0 -> no default)
105int P_gshr; // % Global share of requests allowed
106int P_io; // % I/O Capacity in load factor
107int P_load; // % MSC Capacity in load factor
108int P_mem; // % MEM Capacity in load factor
109int P_pag; // % PAG Capacity in load factor
110
111char DoMWChk; // When true (default) perform multiple write check
112char DoHnTry; // When true (default) use hostnames for try redirs
113char nbSQ; // Non-blocking send queue handling option
114char MultiSrc; // Allow retries via 'tried=' and 'cms.sadd' cgi
115
116int DiskMin; // Minimum MB needed of space in a partition
117int DiskHWM; // Minimum MB needed of space to requalify
118short DiskMinP; // Minimum MB needed of space in a partition as %
119short DiskHWMP; // Minimum MB needed of space to requalify as %
120int DiskLinger; // Manager Only
121int DiskAsk; // Seconds between disk space reclaculations
122int DiskWT; // Seconds to defer client while waiting for space
123bool DiskSS; // This is a staging server
124bool DiskOK; // This configuration has data
125
126char rsvd[5];
127
128char sched_RR; // 1 -> Simply do round robin scheduling
129char sched_Pack; // 1 -> Pick with affinity (>1 same but wait for resps)
130char sched_AffPC; // Affinity path component count (-255 <= n <= 255)
131char sched_Level; // 1 -> Use load-based level for "pack" selection
132char sched_Force; // 1 -> Client cannot select mode
133char sched_LoadR; // 1 -> Use randomized load-based weighting for selection
134int doWait; // 1 -> Wait for a data end-point
135
136int adsPort; // Alternate server port
137int adsMon; // Alternate server monitoring
138char *adsProt; // Alternate server protocol
139
140char *mrRdrHost; // Maxretries redirect target
143char *msRdrHost; // Nomultisrc redirect target
146
147XrdVersionInfo *myVInfo; // xrootd version used in compilation
148
149XrdOucName2Name *xeq_N2N; // Server or Manager (non-null if library loaded)
150XrdOucName2Name *lcl_N2N; // Server Only
151
153char *ossLib; // -> oss library
154char *ossParms; // -> oss library parameters
155char *prfLib; // ->perf library
156char *prfParms; // ->perf library parameters
157char *VNID_Lib; // Server Only
158char *VNID_Parms; // Server Only
159char *N2N_Lib; // Server Only
160char *N2N_Parms; // Server Only
161char *LocalRoot; // Server Only
162char *RemotRoot; // Manager
163char *myPaths; // Exported paths
164short RepStats; // Statistics to report (see RepStat_xxx below)
165char TimeZone; // Time zone we are in (|0x80 -> east of UTC)
167char myRType[4];
168char *myRole;
169const char *myProg;
170const char *myName;
171const char *myDomain;
172const char *myInsName;
173const char *myInstance;
174const char *mySID;
175const char *myVNID;
176const char *mySite;
177 char *envCGI;
178 char *cidTag;
179const char *ifList;
180XrdOucTList *ManList; // From manager directive
181XrdOucTList *NanList; // From manager directive (managers only)
182XrdOucTList *SanList; // From subcluster directive (managers only)
183
184XrdOss *ossFS; // The filsesystem interface
185XrdOucProg *ProgCH; // Server only chmod
186XrdOucProg *ProgMD; // Server only mkdir
187XrdOucProg *ProgMP; // Server only mkpath
188XrdOucProg *ProgMV; // Server only mv
189XrdOucProg *ProgRD; // Server only rmdir
190XrdOucProg *ProgRM; // Server only rm
191XrdOucProg *ProgTR; // Server only trunc
192
193unsigned long long DirFlags;
200
201 XrdCmsConfig() : XrdJob("cmsd startup") {ConfigDefaults();}
203
204// RepStats value via 'cms.repstats" directive
205//
206static const int RepStat_frq = 0x0001; // Fast Response Queue
207static const int RepStat_shr = 0x0002; // Share
208static const int RepStat_All = 0xffff; // All
209
210private:
211
212void ConfigDefaults(void);
213int ConfigN2N(void);
214int ConfigOSS(void);
215int ConfigProc(int getrole=0);
216int isExec(XrdSysError *eDest, const char *ptype, char *prog);
217int Manifest();
218int MergeP(void);
219int setupManager(void);
220int setupServer(void);
221char *setupSid();
222void Usage(int rc);
223int xapath(XrdSysError *edest, XrdOucStream &CFile);
224int xallow(XrdSysError *edest, XrdOucStream &CFile);
225int xaltds(XrdSysError *edest, XrdOucStream &CFile);
226int Fsysadd(XrdSysError *edest, int chk, char *fn);
227int xblk(XrdSysError *edest, XrdOucStream &CFile, bool iswl=false);
228int xcid(XrdSysError *edest, XrdOucStream &CFile);
229int xdelay(XrdSysError *edest, XrdOucStream &CFile);
230int xdefs(XrdSysError *edest, XrdOucStream &CFile);
231int xdfs(XrdSysError *edest, XrdOucStream &CFile);
232int xexpo(XrdSysError *edest, XrdOucStream &CFile);
233int xfsxq(XrdSysError *edest, XrdOucStream &CFile);
234int xfxhld(XrdSysError *edest, XrdOucStream &CFile);
235int xlclrt(XrdSysError *edest, XrdOucStream &CFile);
236int xmang(XrdSysError *edest, XrdOucStream &CFile);
237int xnbsq(XrdSysError *edest, XrdOucStream &CFile);
238int xperf(XrdSysError *edest, XrdOucStream &CFile);
239int xping(XrdSysError *edest, XrdOucStream &CFile);
240int xprep(XrdSysError *edest, XrdOucStream &CFile);
241int xprepm(XrdSysError *edest, XrdOucStream &CFile);
242int xreps(XrdSysError *edest, XrdOucStream &CFile);
243int xrmtrt(XrdSysError *edest, XrdOucStream &CFile);
244int xrole(XrdSysError *edest, XrdOucStream &CFile);
245int xsched(XrdSysError *edest, XrdOucStream &CFile);
246int xschedm(char *val, XrdSysError *eDest, XrdOucStream &CFile);
247int xschedp(char *val, XrdSysError *eDest, XrdOucStream &CFile);
248int xschedx(char *val, XrdSysError *eDest, XrdOucStream &CFile);
249bool xschedy(char *val, XrdSysError *eDest, char *&host, int &hlen, int &port);
250int xsecl(XrdSysError *edest, XrdOucStream &CFile);
251int xspace(XrdSysError *edest, XrdOucStream &CFile);
252int xsubc(XrdSysError *edest, XrdOucStream &CFile);
253int xsupp(XrdSysError *edest, XrdOucStream &CFile);
254int xtrace(XrdSysError *edest, XrdOucStream &CFile);
255int xvnid(XrdSysError *edest, XrdOucStream &CFile);
256
257XrdInet *NetTCPr; // Network for supervisors
258XrdOucEnv *xrdEnv;
259char *AdminPath;
260int AdminMode;
261char **inArgv;
262int inArgc;
263char *SecLib;
264char *blkList;
265int blkChk;
266int isManager;
267int isMeta;
268int isPeer;
269int isProxy;
270int isServer;
271int isSolo;
272char *perfpgm;
273int perfint;
274int cachelife;
275int emptylife;
276int pendplife;
277int FSlim;
278};
279namespace XrdCms
280{
281extern XrdCmsAdmin Admin;
282extern XrdCmsConfig Config;
283extern XrdScheduler *Sched;
284}
285#endif
static XrdSysError eDest(0,"crypto_")
static const int RepStat_shr
static const int RepStat_frq
XrdOucProg * ProgMP
int GenLocalPath(const char *oldp, char *newp)
const char * myDomain
XrdNetSocket * RedirSock
XrdNetSocket * AdminSock
XrdOucProg * ProgRM
XrdCmsPList_Anchor PathList
const char * myInsName
XrdInet * NetTCP
XrdOucTList * SanList
const char * mySite
static const int RepStat_All
unsigned long long DirFlags
const char * myName
XrdOucTList * NanList
XrdNetSecurity * Police
XrdOucPListAnchor PexpList
XrdNetSocket * AnoteSock
XrdVersionInfo * myVInfo
XrdOucProg * ProgRD
XrdOucProg * ProgCH
const char * ifList
const char * myInstance
XrdOucProg * ProgMV
XrdOucProg * ProgMD
int Configure1(int argc, char **argv, char *cfn)
int ConfigXeq(char *var, XrdOucStream &CFile, XrdSysError *eDest)
XrdOucTList * ManList
const char * mySID
XrdOucName2Name * xeq_N2N
const char * myProg
XrdOucName2Name * lcl_N2N
int Configure0(XrdProtocol_Config *pi)
XrdOucProg * ProgTR
const char * myVNID
XrdCmsAdmin Admin
XrdScheduler * Sched
XrdCmsConfig Config