00001 #ifndef __OLB_PREPARE__H 00002 #define __OLB_PREPARE__H 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d O l b P r e p a r e . h h */ 00006 /* */ 00007 /* (c) 2007 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* All Rights Reserved */ 00009 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00010 /* DE-AC02-76-SFO0515 with the Department of Energy */ 00011 /******************************************************************************/ 00012 00013 // $Id: XrdOlbPrepare.hh,v 1.6 2007/07/26 15:18:24 ganis Exp $ 00014 00015 #include "Xrd/XrdJob.hh" 00016 #include "Xrd/XrdScheduler.hh" 00017 #include "XrdOlb/XrdOlbPrepArgs.hh" 00018 #include "XrdOuc/XrdOucHash.hh" 00019 #include "XrdSys/XrdSysPthread.hh" 00020 #include "XrdOuc/XrdOucStream.hh" 00021 00022 class XrdOucMsubs; 00023 class XrdOucName2Name; 00024 00025 class XrdOlbPrepare : public XrdJob 00026 { 00027 public: 00028 00029 int Add(XrdOlbPrepArgs &pargs); 00030 00031 int Del(char *reqid); 00032 00033 int Exists(char *path); 00034 00035 void Gone(char *path); 00036 00037 void DoIt() {Scrub(); 00038 if (prepif) 00039 SchedP->Schedule((XrdJob *)this, scrubtime+time(0)); 00040 } 00041 00042 int Pending() {return NumFiles;} 00043 00044 void Queue(XrdOlbPrepArgs *parg); 00045 00046 int Reset(); 00047 00048 int setParms(int rcnt, int stime, int deco=0); 00049 00050 int setParms(char *ifpgm, char *ifmsg=0); 00051 00052 int setParms(XrdScheduler *sp) {SchedP = sp; return 0;} 00053 00054 int setParms(XrdOucName2Name *n2n) {N2N = n2n; return 0;} 00055 00056 XrdOlbPrepare(); 00057 ~XrdOlbPrepare() {} // Never gets deleted 00058 00059 private: 00060 00061 void Scrub(); 00062 int startIF(); 00063 00064 XrdSysMutex PTMutex; 00065 XrdOucHash<char> PTable; 00066 XrdOucStream prepSched; 00067 XrdScheduler *SchedP; 00068 XrdOucName2Name *N2N; 00069 XrdOucMsubs *prepMsg; 00070 time_t lastemsg; 00071 pid_t preppid; 00072 int NumFiles; 00073 int doEcho; 00074 int resetcnt; 00075 int scrub2rst; 00076 int scrubtime; 00077 char *prepif; 00078 }; 00079 00080 namespace XrdOlb 00081 { 00082 extern XrdOlbPrepare PrepQ; 00083 } 00084 #endif
1.7.1