Logo ROOT  
Reference Guide
TQueryResultManager.h
Go to the documentation of this file.
1// @(#)root/proof:$Id$
2// Author: G. Ganis Mar 2008
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12
13#ifndef ROOT_TQueryResultManager
14#define ROOT_TQueryResultManager
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TQueryResultManager //
19// //
20// This class manages the query-result area. //
21// //
22//////////////////////////////////////////////////////////////////////////
23
24#include "TObject.h"
25#include "TStopwatch.h"
26#include "TString.h"
27
28class TList;
29class TProof;
30class TProofLockPath;
32class TQueryResult;
34
36
37private:
38 TString fQueryDir; //directory containing query results and status
39 TString fSessionTag; //tag for the session
40 TString fSessionDir; //directory containing session dependent files
41 Int_t fSeqNum; //sequential number of last processed query
42 Int_t fDrawQueries; //number of draw queries processed
43 Int_t fKeptQueries; //number of queries fully in memory and in dir
44 TList *fQueries; //list of TProofQueryResult objects
45 TList *fPreviousQueries; //list of TProofQueryResult objects from previous sections
46 TProofLockPath *fLock; //dir locker
47 FILE *fLogFile; //log file
48 TStopwatch fCompute; //measures time spend processing a query on the master
49
51
52public:
53 TQueryResultManager(const char *qdir, const char *stag, const char *sdir,
54 TProofLockPath *lck, FILE *logfile = 0);
55 virtual ~TQueryResultManager();
56
57 const char *QueryDir() const { return fQueryDir.Data(); }
58 Int_t SeqNum() const { return fSeqNum; }
59 Int_t DrawQueries() const { return fDrawQueries; }
60 Int_t KeptQueries() const { return fKeptQueries; }
61 TList *Queries() const { return fQueries; }
63
66
70 TProof *proof, TVirtualProofPlayer *player);
73 TProofQueryResult *LocateQuery(TString queryref, Int_t &qry, TString &qdir);
74 void RemoveQuery(TQueryResult *qr, Bool_t soft = kFALSE);
75 void RemoveQuery(const char *queryref, TList *otherlist = 0);
76 void ResetTime() { fCompute.Start(); }
77 void SaveQuery(TProofQueryResult *qr, const char *fout = 0);
78 void SaveQuery(TProofQueryResult *qr, Int_t mxq);
79
80 Int_t LockSession(const char *sessiontag, TProofLockPath **lck);
81 Int_t CleanupSession(const char *sessiontag);
82 void ScanPreviousQueries(const char *dir);
83
84 ClassDef(TQueryResultManager,0) //PROOF query result manager
85};
86
87#endif
88
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
float Float_t
Definition: RtypesCore.h:53
#define ClassDef(name, id)
Definition: Rtypes.h:326
A doubly linked list.
Definition: TList.h:44
Mother of all ROOT objects.
Definition: TObject.h:37
TQueryResult version adapted to PROOF neeeds.
This class controls a Parallel ROOT Facility, PROOF, cluster.
Definition: TProof.h:316
Class managing the query-result area.
void SaveQuery(TProofQueryResult *qr, const char *fout=0)
Save current status of query 'qr' to file name fout.
Bool_t FinalizeQuery(TProofQueryResult *pq, TProof *proof, TVirtualProofPlayer *player)
Final steps after Process() to complete the TQueryResult instance.
void RemoveQuery(TQueryResult *qr, Bool_t soft=kFALSE)
Remove everything about query qr.
TList * PreviousQueries() const
virtual ~TQueryResultManager()
Cleanup.
Int_t CleanupQueriesDir()
Remove all queries results referring to previous sessions.
Int_t ApplyMaxQueries(Int_t mxq)
Scan the queries directory and remove the oldest ones (and relative dirs, if empty) in such a way onl...
TProofQueryResult * LocateQuery(TString queryref, Int_t &qry, TString &qdir)
Locate query referenced by queryref.
Int_t CleanupSession(const char *sessiontag)
Cleanup query dir qdir.
TQueryResultManager(const char *qdir, const char *stag, const char *sdir, TProofLockPath *lck, FILE *logfile=0)
Constructor.
Int_t LockSession(const char *sessiontag, TProofLockPath **lck)
Try locking query area of session tagged sessiontag.
TProofLockPath * fLock
const char * QueryDir() const
TList * Queries() const
void AddLogFile(TProofQueryResult *pq)
Add part of log file concerning TQueryResult pq to its macro container.
void ScanPreviousQueries(const char *dir)
Scan the queries directory for the results of previous queries.
A container class for query results.
Definition: TQueryResult.h:36
Stopwatch class.
Definition: TStopwatch.h:28
Double_t RealTime()
Stop the stopwatch (if it is running) and return the realtime (in seconds) passed between the start a...
Definition: TStopwatch.cxx:110
void Start(Bool_t reset=kTRUE)
Start the stopwatch.
Definition: TStopwatch.cxx:58
Double_t CpuTime()
Stop the stopwatch (if it is running) and return the cputime (in seconds) passed between the start an...
Definition: TStopwatch.cxx:125
Basic string class.
Definition: TString.h:131
const char * Data() const
Definition: TString.h:364
Abstract interface for the PROOF player.