xrootd
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
34
36
37class XrdCmsClientMan;
38class XrdOss;
39class XrdOucEnv;
40class XrdOucErrInfo;
41class XrdOucTList;
42struct XrdCmsData;
43class XrdCmsRRData;
44struct XrdSfsPrep;
45class XrdSysLogger;
46struct XrdVersionInfo;
47
48/******************************************************************************/
49/* R e m o t e F i n d e r */
50/******************************************************************************/
51
53{
54public:
55 void Added(const char *path, int Pend=0) {}
56
57 int Configure(const char *cfn, char *Args, XrdOucEnv *EnvInfo);
58
59 int Forward(XrdOucErrInfo &Resp, const char *cmd,
60 const char *arg1=0, const char *arg2=0,
61 XrdOucEnv *Env1=0, XrdOucEnv *Env2=0);
62
63 int Locate(XrdOucErrInfo &Resp, const char *path, int flags,
64 XrdOucEnv *Info=0);
65
67
68 int Prepare(XrdOucErrInfo &Resp, XrdSfsPrep &pargs,
69 XrdOucEnv *Info=0);
70
71 void Removed(const char *path) {}
72
73 void setSS(XrdOss *thess) {}
74
75 int Space(XrdOucErrInfo &Resp, const char *path, XrdOucEnv *Info=0);
76
77static bool VCheck(XrdVersionInfo &urVersion);
78
79 XrdCmsFinderRMT(XrdSysLogger *lp, int whoami=0, int Port=0);
81
82static const int MaxMan = 15;
83
84private:
85int Decode(char **resp);
86void Inform(XrdCmsClientMan *xman, struct iovec xmsg[], int xnum);
90int send2Man(XrdOucErrInfo &, const char *, struct iovec *, int);
92
98char *CMSPath;
109unsigned char SMode;
110unsigned char sendID;
111unsigned char savePath;
112};
113
114/******************************************************************************/
115/* T a r g e t F i n d e r */
116/******************************************************************************/
117
118class XrdOucStream;
119class XrdOucTList;
120
122{
123public:
124 void Added(const char *path, int Pend=0);
125
126 int Configure(const char *cfn, char *Args, XrdOucEnv *EnvInfo);
127
128 int Locate(XrdOucErrInfo &Resp, const char *path, int flags,
129 XrdOucEnv *Info=0);
130
132 XrdOucEnv *Info=0) {return 0;}
133
135
136 void Removed(const char *path);
137
138 void Resume (int Perm=1);
139 void Suspend(int Perm=1);
140
141 int Resource(int n);
142 int Reserve (int n);
143 int Release (int n);
144
145 int RunAdmin(char *Path, const char *vnid);
146
147 int Space(XrdOucErrInfo &Resp, const char *path, XrdOucEnv *envP=0)
148 {return 0;}
149
150 void *Start();
151
152static bool VCheck(XrdVersionInfo &urVersion);
153
154 XrdCmsFinderTRG(XrdSysLogger *, int, int, XrdOss *theSS=0);
156
157private:
158
159void Hookup();
161
164char *Login;
175};
176#endif
#define Info(lvl, where, what)
Definition: XrdClientDebug.hh:52
Definition: XrdCmsClientMan.hh:48
Definition: XrdCmsClient.hh:116
Definition: XrdCmsFinder.hh:53
XrdCmsClientMan * SelectManager(XrdOucErrInfo &Resp, const char *path)
int isMeta
Definition: XrdCmsFinder.hh:105
unsigned char SMode
Definition: XrdCmsFinder.hh:109
int send2Man(XrdOucErrInfo &, const char *, struct iovec *, int)
XrdOucTList * Managers()
Definition: XrdCmsFinder.hh:66
int RepNone
Definition: XrdCmsFinder.hh:101
int LocLocal(XrdOucErrInfo &Resp, XrdOucEnv *Env)
int isTarget
Definition: XrdCmsFinder.hh:107
int myPort
Definition: XrdCmsFinder.hh:108
XrdOucTList * myManList
Definition: XrdCmsFinder.hh:95
int Forward(XrdOucErrInfo &Resp, const char *cmd, const char *arg1=0, const char *arg2=0, XrdOucEnv *Env1=0, XrdOucEnv *Env2=0)
XrdCmsClientMan * myManTable[MaxMan]
Definition: XrdCmsFinder.hh:93
void Inform(XrdCmsClientMan *xman, struct iovec xmsg[], int xnum)
void setSS(XrdOss *thess)
Definition: XrdCmsFinder.hh:73
int ConWait
Definition: XrdCmsFinder.hh:99
int Decode(char **resp)
XrdSysMutex myData
Definition: XrdCmsFinder.hh:97
XrdCmsClientMan * myManagers
Definition: XrdCmsFinder.hh:94
static const int MaxMan
Definition: XrdCmsFinder.hh:82
void Added(const char *path, int Pend=0)
Definition: XrdCmsFinder.hh:55
unsigned char savePath
Definition: XrdCmsFinder.hh:111
void Removed(const char *path)
Definition: XrdCmsFinder.hh:71
int Locate(XrdOucErrInfo &Resp, const char *path, int flags, XrdOucEnv *Info=0)
int PrepWait
Definition: XrdCmsFinder.hh:104
int isProxy
Definition: XrdCmsFinder.hh:106
int RepDelay
Definition: XrdCmsFinder.hh:100
int Prepare(XrdOucErrInfo &Resp, XrdSfsPrep &pargs, XrdOucEnv *Info=0)
static bool VCheck(XrdVersionInfo &urVersion)
int Space(XrdOucErrInfo &Resp, const char *path, XrdOucEnv *Info=0)
int Configure(const char *cfn, char *Args, XrdOucEnv *EnvInfo)
unsigned char sendID
Definition: XrdCmsFinder.hh:110
XrdCmsFinderRMT(XrdSysLogger *lp, int whoami=0, int Port=0)
char * CMSPath
Definition: XrdCmsFinder.hh:98
int myManCount
Definition: XrdCmsFinder.hh:96
int RepWait
Definition: XrdCmsFinder.hh:102
int FwdWait
Definition: XrdCmsFinder.hh:103
int StartManagers(XrdOucTList *)
void SelectManFail(XrdOucErrInfo &Resp)
Definition: XrdCmsFinder.hh:122
XrdCmsFinderTRG(XrdSysLogger *, int, int, XrdOss *theSS=0)
void Resume(int Perm=1)
int Process(XrdCmsRRData &Data)
int Release(int n)
XrdOss * SS
Definition: XrdCmsFinder.hh:162
int Locate(XrdOucErrInfo &Resp, const char *path, int flags, XrdOucEnv *Info=0)
int myPort
Definition: XrdCmsFinder.hh:171
XrdOucStream * CMSp
Definition: XrdCmsFinder.hh:166
int resCur
Definition: XrdCmsFinder.hh:170
char * Login
Definition: XrdCmsFinder.hh:164
int Space(XrdOucErrInfo &Resp, const char *path, XrdOucEnv *envP=0)
Definition: XrdCmsFinder.hh:147
XrdOucTList * Managers()
Definition: XrdCmsFinder.hh:134
int Prepare(XrdOucErrInfo &Resp, XrdSfsPrep &pargs, XrdOucEnv *Info=0)
Definition: XrdCmsFinder.hh:131
void Removed(const char *path)
XrdSysMutex myData
Definition: XrdCmsFinder.hh:167
int isRedir
Definition: XrdCmsFinder.hh:172
XrdSysMutex rrMutex
Definition: XrdCmsFinder.hh:168
int isProxy
Definition: XrdCmsFinder.hh:173
char * CMSPath
Definition: XrdCmsFinder.hh:163
static bool VCheck(XrdVersionInfo &urVersion)
void Suspend(int Perm=1)
int Reserve(int n)
XrdOucTList * myManList
Definition: XrdCmsFinder.hh:165
int Active
Definition: XrdCmsFinder.hh:174
int RunAdmin(char *Path, const char *vnid)
void Added(const char *path, int Pend=0)
int Resource(int n)
int resMax
Definition: XrdCmsFinder.hh:169
int Configure(const char *cfn, char *Args, XrdOucEnv *EnvInfo)
Definition: XrdCmsRRData.hh:52
Definition: XrdOss.hh:174
Definition: XrdOucEnv.hh:42
Definition: XrdOucErrInfo.hh:100
Definition: XrdOucStream.hh:46
Definition: XrdOucTList.hh:42
Definition: XrdSysLogger.hh:53
Definition: XrdSysPthread.hh:166
< Prepare parameters
Definition: XrdSfsInterface.hh:161