XrdProofdManager.h

Go to the documentation of this file.
00001 // @(#)root/proofd:$Id: XrdProofdManager.h 33824 2010-06-10 14:43:40Z ganis $
00002 // Author: G. Ganis June 2007
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_XrdProofdManager
00013 #define ROOT_XrdProofdManager
00014 
00015 //////////////////////////////////////////////////////////////////////////
00016 //                                                                      //
00017 // XrdProofdManager                                                     //
00018 //                                                                      //
00019 // Author: G. Ganis, CERN, 2007                                         //
00020 //                                                                      //
00021 // Class mapping manager functionality.                                 //
00022 // On masters it keeps info about the available worker nodes and allows //
00023 // communication with them. In particular, it reads the proof.conf file //
00024 // when working with static resources.                                  //
00025 // On workers it handles the communication with the master              //
00026 // (to be implemented).                                                 //
00027 //                                                                      //
00028 //////////////////////////////////////////////////////////////////////////
00029 #include <list>
00030 
00031 #ifdef OLDXRDOUC
00032 #  include "XrdSysToOuc.h"
00033 #  include "XrdOuc/XrdOucPthread.hh"
00034 #else
00035 #  include "XrdSys/XrdSysPthread.hh"
00036 #endif
00037 #include "XrdOuc/XrdOucString.hh"
00038 
00039 #include "XrdProofdAux.h"
00040 #include "XrdProofdConfig.h"
00041 
00042 class XrdProofdAdmin;
00043 class XrdProofdClient;
00044 class XrdProofdClientMgr;
00045 class XrdProofdNetMgr;
00046 class XrdProofdPriorityMgr;
00047 class XrdProofdProofServMgr;
00048 class XrdProofdProtocol;
00049 class XrdProofGroupMgr;
00050 class XrdProofSched;
00051 class XrdProofdProofServ;
00052 class XrdProofWorker;
00053 class XrdROOT;
00054 class XrdROOTMgr;
00055 
00056 class XrdProofdManager : public XrdProofdConfig {
00057 
00058  public:
00059    XrdProofdManager(XrdProtocol_Config *pi, XrdSysError *edest);
00060    virtual ~XrdProofdManager();
00061 
00062    XrdSysRecMutex   *Mutex() { return &fMutex; }
00063 
00064    // Config
00065    int               Config(bool rcf = 0);
00066    int               DoDirective(XrdProofdDirective *d,
00067                                  char *val, XrdOucStream *cfg, bool rcf);
00068    void              RegisterDirectives();
00069 
00070    int               ResolveKeywords(XrdOucString &s, XrdProofdClient *pcl);
00071 
00072    int               GetWorkers(XrdOucString &workers, XrdProofdProofServ *, const char *);
00073 
00074    const char       *AdminPath() const { return fAdminPath.c_str(); }
00075    const char       *BareLibPath() const { return fBareLibPath.c_str(); }
00076    bool              ChangeOwn() const { return fChangeOwn; }
00077    void              CheckLogFileOwnership();
00078    bool              CheckMaster(const char *m);
00079    int               CheckUser(const char *usr, XrdProofUI &ui, XrdOucString &e, bool &su);
00080    int               CronFrequency() { return fCronFrequency; }
00081    const char       *Host() const { return fHost.c_str(); }
00082    const char       *Image() const { return fImage.c_str(); }
00083    bool              IsSuperMst() const { return fSuperMst; }
00084    const char       *LocalROOT() const { return fLocalroot.c_str(); }
00085    bool              MultiUser() const { return fMultiUser; }
00086    const char       *NameSpace() const { return fNamespace.c_str(); }
00087    const char       *PoolURL() const { return fPoolURL.c_str(); }
00088    int               Port() const { return fPort; }
00089    int               SrvType() const { return fSrvType; }
00090    const char       *SockPathDir() const { return fSockPathDir.c_str(); }
00091    const char       *TMPdir() const { return fTMPdir.c_str(); }
00092    const char       *WorkDir() const { return fWorkDir.c_str(); }
00093    const char       *DataDir() const { return fDataDir.c_str(); }
00094    const char       *DataDirOpts() const { return fDataDirOpts.c_str(); }
00095 
00096    std::list<XrdProofdDSInfo *> *DataSetSrcs() { return &fDataSetSrcs; }
00097 
00098    // Services
00099    XrdProofdClientMgr *ClientMgr() const { return fClientMgr; }
00100    const char       *EffectiveUser() const { return fEffectiveUser.c_str(); }
00101    XrdProofGroupMgr *GroupsMgr() const { return fGroupsMgr; }
00102    XrdProofSched    *ProofSched() const { return fProofSched; }
00103    XrdProofdProofServMgr *SessionMgr() const { return fSessionMgr; }
00104    XrdProofdNetMgr  *NetMgr() const { return fNetMgr; }
00105    XrdProofdAdmin   *Admin() const { return fAdmin; }
00106    XrdROOTMgr       *ROOTMgr() const { return fROOTMgr; }
00107    XrdProofdPriorityMgr *PriorityMgr() const { return fPriorityMgr; }
00108    XrdScheduler     *Sched() const { return fSched; }
00109 
00110    // Request processor
00111    int               Process(XrdProofdProtocol *p);
00112 
00113  private:
00114    XrdSysRecMutex    fMutex;          // Atomize this instance
00115 
00116    bool              fSuperMst;       // true if this node is a SuperMst
00117 
00118    XrdOucString      fAdminPath;      // Path to the PROOF admin area
00119 
00120    int               fSrvType;        // Master, Submaster, Worker or any
00121    XrdOucString      fEffectiveUser;  // Effective user
00122    XrdOucString      fHost;           // local host name
00123    int               fPort;           // Port for client-like connections
00124    XrdOucString      fImage;          // image name for these servers
00125    XrdOucString      fWorkDir;        // working dir for these servers
00126    int               fCronFrequency;  // Frequency of cron checks
00127 
00128    XrdOucString      fBareLibPath;    // LIBPATH cleaned from ROOT dists
00129    XrdOucString      fSockPathDir;    // directory for Unix sockets
00130    XrdOucString      fTMPdir;         // directory for temporary files
00131    XrdOucString      fPoolURL;        // Local pool URL
00132    XrdOucString      fNamespace;      // Local pool namespace
00133    XrdOucString      fLocalroot;      // Local root prefix (directive oss.localroot)
00134    XrdOucString      fDataDir;        // Directory under which to create the sub-dirs for users data
00135    XrdOucString      fDataDirOpts;    // String specifying options for fDataDir handling
00136 
00137    // Services
00138    XrdProofdClientMgr    *fClientMgr;  // Client manager
00139    XrdProofGroupMgr      *fGroupsMgr;  // Groups manager
00140    XrdProofSched         *fProofSched; // Instance of the PROOF scheduler
00141    XrdProofdProofServMgr *fSessionMgr; // Proof session manager
00142    XrdProofdNetMgr       *fNetMgr;     // Proof network manager
00143    XrdProofdAdmin        *fAdmin;      // Admin services
00144    XrdROOTMgr            *fROOTMgr;    // ROOT versions manager
00145    XrdProofdPriorityMgr  *fPriorityMgr;// Priority manager
00146 
00147    XrdScheduler          *fSched;      // System scheduler
00148 
00149    XrdOucString      fSuperUsers;     // ':' separated list of privileged users
00150    //
00151    int               fOperationMode;  // Operation mode
00152    XrdOucHash<int>   fAllowedUsers;   // UNIX users allowed in controlled mode
00153    XrdOucHash<int>   fAllowedGroups;  // UNIX groups allowed in controlled mode
00154    bool              fMultiUser;      // Allow/disallow multi-user mode
00155    bool              fChangeOwn;      // TRUE is ownership has to be changed
00156 
00157    //
00158    // Lists
00159    std::list<XrdOucString *> fMastersAllowed; // list of master (domains) allowed
00160    std::list<XrdProofdDSInfo *> fDataSetSrcs; // sources of dataset info
00161 
00162    int               DoDirectiveAllow(char *, XrdOucStream *, bool);
00163    int               DoDirectiveAllowedGroups(char *, XrdOucStream *, bool);
00164    int               DoDirectiveAllowedUsers(char *, XrdOucStream *, bool);
00165    int               DoDirectiveDataDir(char *val, XrdOucStream *cfg, bool);
00166    int               DoDirectiveDataSetSrc(char *, XrdOucStream *, bool);
00167    int               DoDirectiveGroupfile(char *, XrdOucStream *, bool);
00168    int               DoDirectiveMaxOldLogs(char *, XrdOucStream *, bool);
00169    int               DoDirectiveMultiUser(char *, XrdOucStream *, bool);
00170    int               DoDirectivePort(char *, XrdOucStream *, bool);
00171    int               DoDirectiveRole(char *, XrdOucStream *, bool);
00172    int               DoDirectiveTrace(char *, XrdOucStream *, bool);
00173 
00174    bool              ValidateLocalDataSetSrc(XrdOucString &url, bool &local);
00175 
00176    // Scheduling service
00177    XrdProofSched    *LoadScheduler();
00178 };
00179 
00180 // Aux structures
00181 typedef struct {
00182    XrdProofdClientMgr    *fClientMgr;
00183    XrdProofdProofServMgr *fSessionMgr;
00184    XrdProofSched         *fProofSched;
00185 } XpdManagerCron_t;
00186 
00187 #endif

Generated on Tue Jul 5 14:51:45 2011 for ROOT_528-00b_version by  doxygen 1.5.1