TQueryResultManager.h

Go to the documentation of this file.
00001 // @(#)root/proof:$Id: TQueryResultManager.h 25902 2008-10-21 08:42:10Z ganis $
00002 // Author: G. Ganis Mar 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 
00013 #ifndef ROOT_TQueryResultManager
00014 #define ROOT_TQueryResultManager
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TQueryResultManager                                                  //
00019 //                                                                      //
00020 // This class manages the query-result area.                            //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 #ifndef ROOT_TObject
00025 #include "TObject.h"
00026 #endif
00027 #ifndef ROOT_TStopwatch
00028 #include "TStopwatch.h"
00029 #endif
00030 #ifndef ROOT_TString
00031 #include "TString.h"
00032 #endif
00033 
00034 class TList;
00035 class TProof;
00036 class TProofLockPath;
00037 class TProofQueryResult;
00038 class TQueryResult;
00039 class TVirtualProofPlayer;
00040 
00041 class TQueryResultManager : public TObject {
00042 
00043 private:
00044    TString       fQueryDir;         //directory containing query results and status
00045    TString       fSessionTag;       //tag for the session
00046    TString       fSessionDir;       //directory containing session dependent files
00047    Int_t         fSeqNum;           //sequential number of last processed query
00048    Int_t         fDrawQueries;      //number of draw queries processed
00049    Int_t         fKeptQueries;      //number of queries fully in memory and in dir
00050    TList        *fQueries;          //list of TProofQueryResult objects
00051    TList        *fPreviousQueries;  //list of TProofQueryResult objects from previous sections
00052    TProofLockPath *fLock;           //dir locker
00053    FILE         *fLogFile;          //log file
00054    TStopwatch    fCompute;          //measures time spend processing a query on the master
00055 
00056    void          AddLogFile(TProofQueryResult *pq);
00057 
00058 public:
00059    TQueryResultManager(const char *qdir, const char *stag, const char *sdir,
00060                        TProofLockPath *lck, FILE *logfile = 0);
00061    virtual ~TQueryResultManager();
00062 
00063    const char   *QueryDir() const { return fQueryDir.Data(); }
00064    Int_t         SeqNum() const { return fSeqNum; }
00065    Int_t         DrawQueries() const { return fDrawQueries; }
00066    Int_t         KeptQueries() const { return fKeptQueries; }
00067    TList        *Queries() const { return fQueries; }
00068    TList        *PreviousQueries() const { return fPreviousQueries; }
00069 
00070    void          IncrementSeqNum() { fSeqNum++; }
00071    void          IncrementDrawQueries() { fDrawQueries++; }
00072 
00073    Int_t         ApplyMaxQueries(Int_t mxq);
00074    Int_t         CleanupQueriesDir();
00075    Bool_t        FinalizeQuery(TProofQueryResult *pq,
00076                                TProof *proof, TVirtualProofPlayer *player);
00077    Float_t       GetCpuTime() { return fCompute.CpuTime(); }
00078    Float_t       GetRealTime() { return fCompute.RealTime(); }
00079    TProofQueryResult *LocateQuery(TString queryref, Int_t &qry, TString &qdir);
00080    void          RemoveQuery(TQueryResult *qr, Bool_t soft = kFALSE);
00081    void          RemoveQuery(const char *queryref, TList *otherlist = 0);
00082    void          ResetTime() { fCompute.Start(); }
00083    void          SaveQuery(TProofQueryResult *qr, const char *fout = 0);
00084    void          SaveQuery(TProofQueryResult *qr, Int_t mxq);
00085 
00086    Int_t         LockSession(const char *sessiontag, TProofLockPath **lck);
00087    Int_t         CleanupSession(const char *sessiontag);
00088    void          ScanPreviousQueries(const char *dir);
00089 
00090    ClassDef(TQueryResultManager,0)  //PROOF query result manager
00091 };
00092 
00093 #endif
00094 

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