TProofLite.h

Go to the documentation of this file.
00001 // @(#)root/proof:$Id: TProofLite.h 38349 2011-03-09 19:05:39Z ganis $
00002 // Author: G. Ganis March 2008
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, 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_TProofLite
00013 #define ROOT_TProofLite
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TProofLite                                                           //
00019 //                                                                      //
00020 // This class starts a PROOF session on the local machine: no daemons,  //
00021 // client and master merged, communications via UNIX-like sockets.      //
00022 // By default the number of workers started is NumberOfCores+1; a       //
00023 // different number can be forced on construction.                      //
00024 //                                                                      //
00025 //////////////////////////////////////////////////////////////////////////
00026 
00027 #ifndef ROOT_TProof
00028 #include "TProof.h"
00029 #endif
00030 
00031 class TDSet;
00032 class TList;
00033 class TQueryResultManager;
00034 class TDataSetManager;
00035 class TProofLockPath;
00036 class TProofMgr;
00037 class TProofQueryResult;
00038 class TServerSocket;
00039 class TSelector;
00040 
00041 class TProofLite : public TProof {
00042 
00043 friend class TProofPlayerLite;
00044 
00045 private:
00046    Int_t    fNWorkers;    // Number of workers
00047    TString  fSandbox;     // PROOF sandbox root dir
00048    TString  fCacheDir;    // Directory containing cache of user files
00049    TString  fQueryDir;    // Directory containing query results and status
00050    TString  fDataSetDir;  // Directory containing info about known data sets
00051    TString  fSockPath;    // UNIX socket path for communication with workers
00052    TServerSocket *fServSock; // Server socket to accept call backs
00053    Bool_t   fForkStartup; // Startup N-1 workers forking the first worker
00054 
00055    TString  fVarExp;      // Internal variable to pass drawing options
00056    TString  fSelection;   // Internal variable to pass drawing options
00057 
00058    TProofLockPath *fCacheLock; // Cache dir locker
00059    TProofLockPath *fQueryLock; // Query dir locker
00060    TQueryResultManager *fQMgr; // Query-result manager
00061 
00062    TDataSetManager *fDataSetManager; // Dataset manager
00063 
00064    static Int_t fgWrksMax; // Max number of workers
00065 
00066    TProofLite(const TProofLite &);        // not implemented
00067    void operator=(const TProofLite &);    // idem
00068 
00069    Int_t CleanupSandbox();
00070    Int_t CreateSandbox();
00071    void FindUniqueSlaves();
00072    void  NotifyStartUp(const char *action, Int_t done, Int_t tot);
00073    Int_t SetProofServEnv(const char *ord);
00074    Int_t InitDataSetManager();
00075    Int_t RegisterDataSets(TList *in, TList *out);
00076    void  ResolveKeywords(TString &s, const char *logfile);
00077 
00078    void SendInputDataFile();
00079 
00080 protected:
00081    TProofLite() : TProof() { } // For derived classes to use
00082 
00083    Int_t CreateSymLinks(TList *files);
00084    Int_t Init(const char *masterurl, const char *conffile,
00085                const char *confdir, Int_t loglevel,
00086                const char *alias = 0);
00087    TProofQueryResult *MakeQueryResult(Long64_t nent, const char *opt,
00088                                       Long64_t fst, TDSet *dset,
00089                                       const char *selec);
00090    void SetQueryRunning(TProofQueryResult *pq);
00091    Int_t SetupWorkers(Int_t opt = 0, TList *wrks = 0);
00092    Int_t CopyMacroToCache(const char *macro, Int_t headerRequired = 0,
00093                           TSelector **selector = 0, Int_t opt = 0);
00094 
00095 public:
00096    TProofLite(const char *masterurl, const char *conffile = kPROOF_ConfFile,
00097               const char *confdir = kPROOF_ConfDir, Int_t loglevel = 0,
00098               const char *alias = 0, TProofMgr *mgr = 0);
00099    virtual ~TProofLite();
00100 
00101    void Print(Option_t *option="") const;
00102 
00103    Long64_t DrawSelect(TDSet *dset, const char *varexp,
00104                        const char *selection = "",
00105                        Option_t *option = "", Long64_t nentries = -1,
00106                        Long64_t firstentry = 0);
00107    Long64_t Process(TDSet *dset, const char *sel, Option_t *o = "",
00108                     Long64_t nent = -1, Long64_t fst = 0);
00109    Long64_t Process(TFileCollection *fc, const char *sel, Option_t *o = "",
00110                     Long64_t nent = -1, Long64_t fst = 0)
00111                     { return TProof::Process(fc, sel, o, nent, fst); }
00112    Long64_t Process(const char *dsname, const char *sel, Option_t *o = "",
00113                     Long64_t nent = -1, Long64_t fst = 0, TObject *enl = 0)
00114                     { return TProof::Process(dsname, sel, o, nent, fst, enl); }
00115    Long64_t Process(const char *sel, Long64_t nent, Option_t *o = "")
00116                     { return TProof::Process(sel, nent, o); }
00117 
00118    // Cache management
00119    void  ShowCache(Bool_t all = kFALSE);
00120    void  ClearCache(const char *file = 0);
00121    Int_t Load(const char *macro, Bool_t notOnClient = kFALSE, Bool_t uniqueOnly = kTRUE,
00122               TList *wrks = 0);
00123 
00124    // Query management
00125    TList *GetListOfQueries(Option_t *opt = "");
00126    Int_t Remove(const char *ref, Bool_t all);
00127 
00128    // Dataset handling
00129    Bool_t   RegisterDataSet(const char *dsName, TFileCollection *ds, const char *opt = "");
00130    Bool_t   ExistsDataSet(const char *uri);
00131    TMap    *GetDataSets(const char *uri = "", const char * = 0);
00132    void     ShowDataSets(const char *uri = "", const char * = 0);
00133    TFileCollection *GetDataSet(const char *uri, const char * = 0);
00134    Int_t    RemoveDataSet(const char *uri, const char * = 0);
00135    Int_t    VerifyDataSet(const char *uri, const char * = 0);
00136    Int_t    SetDataSetTreeName( const char *dataset, const char *treename);
00137    void     ShowDataSetCache(const char *dataset = 0);
00138    void     ClearDataSetCache(const char *dataset = 0);
00139 
00140    // Browsing
00141    TTree *GetTreeHeader(TDSet *tdset);
00142 
00143    static Int_t GetNumberOfWorkers(const char *url = 0);
00144 
00145    ClassDef(TProofLite,0)  //PROOF-Lite control class
00146 };
00147 
00148 #endif

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