XRootD
Loading...
Searching...
No Matches
XrdCmsFinder.hh
Go to the documentation of this file.
1#ifndef __CMS_FINDER__
2#define __CMS_FINDER__
3/******************************************************************************/
4/* */
5/* X r d C m s F i n d e r . h h */
6/* */
7/* (c) 2007 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
35
37
38class XrdCmsClientMan;
39class XrdOss;
40class XrdOucEnv;
41class XrdOucErrInfo;
42class XrdOucTList;
43struct XrdCmsData;
44class XrdCmsRRData;
45struct XrdSfsPrep;
46class XrdSysLogger;
47struct XrdVersionInfo;
48
49/******************************************************************************/
50/* R e m o t e F i n d e r */
51/******************************************************************************/
52
54{
55public:
56 void Added(const char *path, int Pend=0) {}
57
58 int Configure(const char *cfn, char *Args, XrdOucEnv *EnvInfo);
59
60 int Forward(XrdOucErrInfo &Resp, const char *cmd,
61 const char *arg1=0, const char *arg2=0,
62 XrdOucEnv *Env1=0, XrdOucEnv *Env2=0);
63
64 int Locate(XrdOucErrInfo &Resp, const char *path, int flags,
65 XrdOucEnv *Info=0);
66
67XrdOucTList *Managers() {return myManList;}
68
69 int Prepare(XrdOucErrInfo &Resp, XrdSfsPrep &pargs,
70 XrdOucEnv *Info=0);
71
72 void Removed(const char *path) {}
73
74 void setSS(XrdOss *thess) {}
75
76 int Space(XrdOucErrInfo &Resp, const char *path, XrdOucEnv *Info=0);
77
78static bool VCheck(XrdVersionInfo &urVersion);
79
80 XrdCmsFinderRMT(XrdSysLogger *lp, int whoami=0, int Port=0);
82
83static const int MaxMan = 15;
84
85private:
86int Decode(char **resp);
87void Inform(XrdCmsClientMan *xman, struct iovec xmsg[], int xnum);
88int LocLocal(XrdOucErrInfo &Resp, XrdOucEnv *Env);
89XrdCmsClientMan *SelectManager(XrdOucErrInfo &Resp, const char *path);
90void SelectManFail(XrdOucErrInfo &Resp);
91int send2Man(XrdOucErrInfo &, const char *, struct iovec *, int);
92int StartManagers(XrdOucTList *);
93
94XrdCmsClientMan *myManTable[MaxMan];
95XrdCmsClientMan *myManagers;
96XrdOucTList *myManList;
97int myManCount;
98XrdSysMutex myData;
99char *CMSPath;
100int ConWait;
101int RepDelay;
102int RepNone;
103int RepWait;
104int FwdWait;
105int PrepWait;
106int isMeta;
107int isProxy;
108int isTarget;
109int myPort;
110unsigned char SMode;
111unsigned char sendID;
112unsigned char savePath;
113};
114
115/******************************************************************************/
116/* T a r g e t F i n d e r */
117/******************************************************************************/
118
119class XrdOucStream;
120class XrdOucTList;
121
123{
124public:
126
127 void Added(const char *path, int Pend=0);
128
129 int Configure(const char *cfn, char *Args, XrdOucEnv *EnvInfo);
130
131 int Locate(XrdOucErrInfo &Resp, const char *path, int flags,
132 XrdOucEnv *Info=0);
133
135 XrdOucEnv *Info=0) {return 0;}
136
137XrdOucTList *Managers() {return myManList;}
138
139 void PutInfo(XrdCmsPerfMon::PerfInfo &perfInfo, bool alert=false);
140
141 void Removed(const char *path);
142
143 void Resume (int Perm=1);
144 void Suspend(int Perm=1);
145
146 int Resource(int n);
147 int Reserve (int n);
148 int Release (int n);
149
150 int RunAdmin(char *Path, const char *vnid);
151
152 void *RunPM();
153
154 int Space(XrdOucErrInfo &Resp, const char *path, XrdOucEnv *envP=0)
155 {return 0;}
156
157 void *Start();
158
159 void Utilization(unsigned int util, bool alert=false);
160
161static bool VCheck(XrdVersionInfo &urVersion);
162
163 XrdCmsFinderTRG(XrdSysLogger *, int, int, XrdOss *theSS=0);
165
166private:
167
168void Hookup();
169int Process(XrdCmsRRData &Data);
170
171XrdOss *SS;
172char *CMSPath;
173char *Login;
174XrdOucTList *myManList;
175XrdOucStream *CMSp;
176XrdSysMutex myData;
177XrdSysMutex rrMutex;
178int resMax;
179int resCur;
180int myPort;
181int isRedir;
182int isProxy;
183int Active;
184XrdCmsPerfMon *perfMon;
185int perfInt;
186};
187#endif
XrdOucString Path
< Prepare parameters
XrdOucTList * Managers()
int Forward(XrdOucErrInfo &Resp, const char *cmd, const char *arg1=0, const char *arg2=0, XrdOucEnv *Env1=0, XrdOucEnv *Env2=0)
void setSS(XrdOss *thess)
static const int MaxMan
void Added(const char *path, int Pend=0)
void Removed(const char *path)
int Locate(XrdOucErrInfo &Resp, const char *path, int flags, XrdOucEnv *Info=0)
int Prepare(XrdOucErrInfo &Resp, XrdSfsPrep &pargs, XrdOucEnv *Info=0)
int Space(XrdOucErrInfo &Resp, const char *path, XrdOucEnv *Info=0)
int Configure(const char *cfn, char *Args, XrdOucEnv *EnvInfo)
static bool VCheck(XrdVersionInfo &urVersion)
void Resume(int Perm=1)
int Locate(XrdOucErrInfo &Resp, const char *path, int flags, XrdOucEnv *Info=0)
void PutInfo(XrdCmsPerfMon::PerfInfo &perfInfo, bool alert=false)
void Utilization(unsigned int util, bool alert=false)
int Space(XrdOucErrInfo &Resp, const char *path, XrdOucEnv *envP=0)
XrdOucTList * Managers()
int Prepare(XrdOucErrInfo &Resp, XrdSfsPrep &pargs, XrdOucEnv *Info=0)
void Removed(const char *path)
void Suspend(int Perm=1)
int RunAdmin(char *Path, const char *vnid)
void Added(const char *path, int Pend=0)
int Resource(int n)
static bool VCheck(XrdVersionInfo &urVersion)
int Configure(const char *cfn, char *Args, XrdOucEnv *EnvInfo)
virtual bool Configure(const char *cfn, char *Parms, XrdSysLogger &Logger, XrdCmsPerfMon &cmsMon, XrdOucEnv *EnvInfo, bool isCMS)
Structure used for reporting performance metrics.