xrootd
XrdCmsPrepare.hh
Go to the documentation of this file.
1 #ifndef __CMS_PREPARE__H
2 #define __CMS_PREPARE__H
3 /******************************************************************************/
4 /* */
5 /* X r d C m s P r e p a r e . 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 
33 #include "Xrd/XrdJob.hh"
34 #include "Xrd/XrdScheduler.hh"
35 
36 #include "XrdCms/XrdCmsPrepArgs.hh"
37 #include "XrdOuc/XrdOucHash.hh"
38 #include "XrdOuc/XrdOucStream.hh"
39 #include "XrdSys/XrdSysPthread.hh"
40 
41 class XrdFrcProxy;
42 class XrdNetMsg;
43 class XrdOucMsubs;
44 class XrdOucName2Name;
45 
46 class XrdCmsPrepare : public XrdJob
47 {
48 public:
49 
50 int Add(XrdCmsPrepArgs &pargs);
51 
52 int Del(char *reqid);
53 
54 int Exists(char *path);
55 
56 void Gone(char *path);
57 
58 void DoIt();
59 
60 void Init();
61 
62 void Inform(const char *cmd, XrdCmsPrepArgs *pargs);
63 
64 int isOK() {return prepOK;}
65 
66 int Pending() {return NumFiles;}
67 
68 void Prepare(XrdCmsPrepArgs *pargs);
69 
70 void Reset(const char *iName, const char *aPath, int aMode);
71 
72 int setParms(int rcnt, int stime, int deco=0);
73 
74 int setParms(const char *ifpgm, char *ifmsg=0);
75 
76 int setParms(XrdOucName2Name *n2n) {N2N = n2n; return 0;}
77 
78  XrdCmsPrepare();
79  ~XrdCmsPrepare() {} // Never gets deleted
80 
81 private:
82 
83 int isOnline(char *path);
84 void Reset();
85 void Scrub();
86 int startIF();
87 
95 char *prepif;
96 time_t lastemsg;
97 pid_t preppid;
98 int prepOK;
100 int doEcho;
104 };
105 
106 namespace XrdCms
107 {
108 extern XrdCmsPrepare PrepQ;
109 }
110 #endif
Definition: XrdCmsPrepArgs.hh:40
Definition: YProtocol.hh:77
int Exists(char *path)
XrdOucMsubs * prepMsg
Definition: XrdCmsPrepare.hh:92
Definition: XrdOucMsubs.hh:90
int isOnline(char *path)
XrdOucHash< char > PTable
Definition: XrdCmsPrepare.hh:89
Definition: XrdOucStream.hh:46
Definition: XrdOucName2Name.hh:48
Definition: XrdNetMsg.hh:48
void Gone(char *path)
void Prepare(XrdCmsPrepArgs *pargs)
int doEcho
Definition: XrdCmsPrepare.hh:100
int prepOK
Definition: XrdCmsPrepare.hh:98
int Add(XrdCmsPrepArgs &pargs)
XrdCmsPrepare PrepQ
Definition: XrdSysPthread.hh:165
void Inform(const char *cmd, XrdCmsPrepArgs *pargs)
int resetcnt
Definition: XrdCmsPrepare.hh:101
XrdOucStream prepSched
Definition: XrdCmsPrepare.hh:90
char * prepif
Definition: XrdCmsPrepare.hh:95
int Pending()
Definition: XrdCmsPrepare.hh:66
Definition: XrdCmsPrepare.hh:46
int NumFiles
Definition: XrdCmsPrepare.hh:99
time_t lastemsg
Definition: XrdCmsPrepare.hh:96
int isOK()
Definition: XrdCmsPrepare.hh:64
int scrubtime
Definition: XrdCmsPrepare.hh:103
XrdSysMutex PTMutex
Definition: XrdCmsPrepare.hh:88
pid_t preppid
Definition: XrdCmsPrepare.hh:97
int setParms(int rcnt, int stime, int deco=0)
XrdFrcProxy * PrepFrm
Definition: XrdCmsPrepare.hh:94
int Del(char *reqid)
int setParms(XrdOucName2Name *n2n)
Definition: XrdCmsPrepare.hh:76
XrdOucName2Name * N2N
Definition: XrdCmsPrepare.hh:91
~XrdCmsPrepare()
Definition: XrdCmsPrepare.hh:79
Definition: XrdFrcProxy.hh:39
int scrub2rst
Definition: XrdCmsPrepare.hh:102
XrdNetMsg * Relay
Definition: XrdCmsPrepare.hh:93
Definition: XrdJob.hh:42