Logo ROOT   6.12/07
Reference Guide
TQueryResult.h
Go to the documentation of this file.
1 // @(#)root/tree:$Id$
2 // Author: G Ganis Sep 2005
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2005, 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 #ifndef ROOT_TQueryResult
13 #define ROOT_TQueryResult
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TQueryResult //
19 // //
20 // A container class for the results of a query. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TNamed.h"
25 #include "TDatime.h"
26 #include "TMacro.h"
27 #include "TString.h"
28 
29 class TBrowser;
30 class TTreePlayer;
31 class TQueryResult;
32 
33 Bool_t operator==(const TQueryResult &qr1, const TQueryResult &qr2);
34 
35 
36 class TQueryResult : public TNamed {
37 
38 friend class TTreePlayer;
39 friend class TProofPlayerLite;
40 friend class TProofPlayerRemote;
41 friend class TProof;
42 friend class TProofLite;
43 friend class TProofServ;
44 friend class TQueryResultManager;
45 
46 public:
47  enum EQueryStatus {
49  };
50 
51 protected:
52  Int_t fSeqNum; ///< query unique sequential number
53  Bool_t fDraw; ///< true if draw action query
54  EQueryStatus fStatus; ///< query status
55  TDatime fStart; ///< time when processing started
56  TDatime fEnd; ///< time when processing ended
57  Float_t fUsedCPU; ///< real CPU time used (seconds)
58  TString fOptions; ///< processing options + aclic mode (< opt >#< aclic_mode >)
59  TList *fInputList; ///< input list; contains also data sets, entry list, ...
60  Long64_t fEntries; ///< number of entries processed
61  Long64_t fFirst; ///< first entry processed
62  Long64_t fBytes; ///< number of bytes processed
63  TMacro *fLogFile; ///< file with log messages from the query
64  TMacro *fSelecHdr; ///< selector header file
65  TMacro *fSelecImp; ///< selector implementation file
66  TString fLibList; ///< blank-separated list of libs loaded at fStart
67  TString fParList; ///< colon-separated list of PAR loaded at fStart
68  TList *fOutputList; ///< output list
69  Bool_t fFinalized; ///< whether Terminate has been run
70  Bool_t fArchived; ///< whether the query has been archived
71  TString fResultFile; ///< URL of the file where results have been archived
72  Float_t fPrepTime; ///< Prepare time (seconds) (millisec precision)
73  Float_t fInitTime; ///< Initialization time (seconds) (millisec precision)
74  Float_t fProcTime; ///< Processing time (seconds) (millisec precision)
75  Float_t fMergeTime; ///< Merging time (seconds) (millisec precision)
76  Float_t fRecvTime; ///< Transfer-to-client time (seconds) (millisec precision)
77  Float_t fTermTime; ///< Terminate time (seconds) (millisec precision)
78  Int_t fNumWrks; ///< Number of workers at start
79  Int_t fNumMergers; ///< Number of submergers
80 
81  TQueryResult(Int_t seqnum, const char *opt, TList *inlist,
82  Long64_t entries, Long64_t first,
83  const char *selec);
84 
85  void AddInput(TObject *obj);
86  void AddLogLine(const char *logline);
88  virtual void RecordEnd(EQueryStatus status, TList *outlist = 0);
89  void SaveSelector(const char *selec);
90  void SetArchived(const char *archfile);
91  virtual void SetFinalized() { fFinalized = kTRUE; }
92  virtual void SetInputList(TList *in, Bool_t adopt = kTRUE);
93  virtual void SetOutputList(TList *out, Bool_t adopt = kTRUE);
94  virtual void SetProcessInfo(Long64_t ent, Float_t cpu = 0.,
95  Long64_t siz = -1,
96  Float_t inittime = 0., Float_t proctime = 0.);
97  void SetPrepTime(Float_t preptime) { fPrepTime = preptime; }
98  void SetMergeTime(Float_t mergetime) { fMergeTime = mergetime; }
99  void SetRecvTime(Float_t recvtime) { fRecvTime = recvtime; }
100  void SetTermTime(Float_t termtime) { fTermTime = termtime; }
101  void SetNumMergers(Int_t nmergers) { fNumMergers = nmergers; }
102 
103 public:
104  TQueryResult() : fSeqNum(-1), fDraw(0), fStatus(kSubmitted), fUsedCPU(0.),
105  fInputList(0), fEntries(-1), fFirst(-1), fBytes(0),
106  fLogFile(0), fSelecHdr(0), fSelecImp(0),
107  fLibList("-"), fOutputList(0),
108  fFinalized(kFALSE), fArchived(kFALSE), fPrepTime(0.),
109  fInitTime(0.), fProcTime(0.), fMergeTime(0.),
110  fRecvTime(-1), fTermTime(0.), fNumWrks(-1), fNumMergers(-1) { }
111  virtual ~TQueryResult();
112 
113  void Browse(TBrowser *b = 0);
114 
115  Int_t GetSeqNum() const { return fSeqNum; }
116  EQueryStatus GetStatus() const { return fStatus; }
117  TDatime GetStartTime() const { return fStart; }
118  TDatime GetEndTime() const { return fEnd; }
119  const char *GetOptions() const { return fOptions; }
121  TObject *GetInputObject(const char *classname) const;
122  Long64_t GetEntries() const { return fEntries; }
123  Long64_t GetFirst() const { return fFirst; }
124  Long64_t GetBytes() const { return fBytes; }
125  Float_t GetUsedCPU() const { return fUsedCPU; }
126  TMacro *GetLogFile() const { return fLogFile; }
127  TMacro *GetSelecHdr() const { return fSelecHdr; }
128  TMacro *GetSelecImp() const { return fSelecImp; }
129  const char *GetLibList() const { return fLibList; }
130  const char *GetParList() const { return fParList; }
132  const char *GetResultFile() const { return fResultFile; }
133  Float_t GetPrepTime() const { return fPrepTime; }
134  Float_t GetInitTime() const { return fInitTime; }
135  Float_t GetProcTime() const { return fProcTime; }
136  Float_t GetMergeTime() const { return fMergeTime; }
137  Float_t GetRecvTime() const { return fRecvTime; }
138  Float_t GetTermTime() const { return fTermTime; }
139  Int_t GetNumWrks() const { return fNumWrks; }
140  Int_t GetNumMergers() const { return fNumMergers; }
141 
142  Bool_t IsArchived() const { return fArchived; }
143  virtual Bool_t IsDone() const { return (fStatus > kRunning); }
144  Bool_t IsDraw() const { return fDraw; }
145  Bool_t IsFinalized() const { return fFinalized; }
146 
147  Bool_t Matches(const char *ref);
148 
149  void Print(Option_t *opt = "") const;
150 
151  ClassDef(TQueryResult,5) //Class describing a query
152 };
153 
154 inline Bool_t operator!=(const TQueryResult &qr1, const TQueryResult &qr2)
155  { return !(qr1 == qr2); }
156 
157 #endif
TList * GetOutputList()
Definition: TQueryResult.h:131
Long64_t GetEntries() const
Definition: TQueryResult.h:122
This class starts a PROOF session on the local machine: no daemons, client and master merged...
Definition: TProofLite.h:40
void Browse(TBrowser *b=0)
To support browsing of the results.
Float_t fRecvTime
Transfer-to-client time (seconds) (millisec precision)
Definition: TQueryResult.h:76
void SaveSelector(const char *selec)
Save the selector header and implementation into the dedicated TMacro instances.
long long Long64_t
Definition: RtypesCore.h:69
void SetNumMergers(Int_t nmergers)
Definition: TQueryResult.h:101
void Print(Option_t *opt="") const
Print query content. Use opt = "F" for a full listing.
float Float_t
Definition: RtypesCore.h:53
Float_t fUsedCPU
real CPU time used (seconds)
Definition: TQueryResult.h:57
const char Option_t
Definition: RtypesCore.h:62
void SetPrepTime(Float_t preptime)
Definition: TQueryResult.h:97
EQueryStatus fStatus
query status
Definition: TQueryResult.h:54
TDatime GetStartTime() const
Definition: TQueryResult.h:117
TObject * GetInputObject(const char *classname) const
Return first instance of class &#39;classname&#39; in the input list.
void AddLogLine(const char *logline)
Fill log file.
Class supporting a collection of lines with C++ code.
Definition: TMacro.h:31
Basic string class.
Definition: TString.h:125
Int_t GetNumWrks() const
Definition: TQueryResult.h:139
Float_t GetInitTime() const
Definition: TQueryResult.h:134
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TQueryResult * CloneInfo()
Return an instance of TQueryResult containing only the local info fields, i.e.
Float_t fTermTime
Terminate time (seconds) (millisec precision)
Definition: TQueryResult.h:77
Int_t GetSeqNum() const
Definition: TQueryResult.h:115
virtual Bool_t IsDone() const
Definition: TQueryResult.h:143
void SetRecvTime(Float_t recvtime)
Definition: TQueryResult.h:99
TMacro * GetLogFile() const
Definition: TQueryResult.h:126
TDatime fEnd
time when processing ended
Definition: TQueryResult.h:56
Int_t fNumMergers
Number of submergers.
Definition: TQueryResult.h:79
TMacro * fSelecHdr
selector header file
Definition: TQueryResult.h:64
const char * GetOptions() const
Definition: TQueryResult.h:119
Bool_t fFinalized
whether Terminate has been run
Definition: TQueryResult.h:69
TMacro * fLogFile
file with log messages from the query
Definition: TQueryResult.h:63
TString fResultFile
URL of the file where results have been archived.
Definition: TQueryResult.h:71
TDatime fStart
time when processing started
Definition: TQueryResult.h:55
#define ClassDef(name, id)
Definition: Rtypes.h:320
Float_t GetProcTime() const
Definition: TQueryResult.h:135
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
TMacro * GetSelecHdr() const
Definition: TQueryResult.h:127
Long64_t GetBytes() const
Definition: TQueryResult.h:124
const char * GetLibList() const
Definition: TQueryResult.h:129
void SetMergeTime(Float_t mergetime)
Definition: TQueryResult.h:98
Long64_t fFirst
first entry processed
Definition: TQueryResult.h:61
Bool_t operator==(const TQueryResult &qr1, const TQueryResult &qr2)
Compare two query result instances for equality.
TMacro * fSelecImp
selector implementation file
Definition: TQueryResult.h:65
virtual void SetOutputList(TList *out, Bool_t adopt=kTRUE)
Set / change the output list.
Version of TProofPlayerRemote merges the functionality needed by clients and masters.
A container class for query results.
Definition: TQueryResult.h:36
Bool_t operator!=(const TQueryResult &qr1, const TQueryResult &qr2)
Definition: TQueryResult.h:154
virtual void SetProcessInfo(Long64_t ent, Float_t cpu=0., Long64_t siz=-1, Float_t inittime=0., Float_t proctime=0.)
Set processing info.
void SetTermTime(Float_t termtime)
Definition: TQueryResult.h:100
TList * fOutputList
output list
Definition: TQueryResult.h:68
void AddInput(TObject *obj)
Add obj to the input list.
A doubly linked list.
Definition: TList.h:44
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
Float_t GetMergeTime() const
Definition: TQueryResult.h:136
Bool_t fArchived
whether the query has been archived
Definition: TQueryResult.h:70
Class managing the query-result area.
Class providing the PROOF server.
Definition: TProofServ.h:66
TList * fInputList
input list; contains also data sets, entry list, ...
Definition: TQueryResult.h:59
Bool_t IsDraw() const
Definition: TQueryResult.h:144
TList * GetInputList()
Definition: TQueryResult.h:120
Float_t GetRecvTime() const
Definition: TQueryResult.h:137
virtual void RecordEnd(EQueryStatus status, TList *outlist=0)
End of query settings.
Int_t fNumWrks
Number of workers at start.
Definition: TQueryResult.h:78
Int_t fSeqNum
query unique sequential number
Definition: TQueryResult.h:52
Float_t GetPrepTime() const
Definition: TQueryResult.h:133
virtual void SetFinalized()
Definition: TQueryResult.h:91
Float_t GetUsedCPU() const
Definition: TQueryResult.h:125
Long64_t GetFirst() const
Definition: TQueryResult.h:123
Bool_t Matches(const char *ref)
Return TRUE if reference ref matches.
EQueryStatus GetStatus() const
Definition: TQueryResult.h:116
const Bool_t kFALSE
Definition: RtypesCore.h:88
Float_t fPrepTime
Prepare time (seconds) (millisec precision)
Definition: TQueryResult.h:72
TMacro * GetSelecImp() const
Definition: TQueryResult.h:128
Bool_t IsFinalized() const
Definition: TQueryResult.h:145
Float_t fProcTime
Processing time (seconds) (millisec precision)
Definition: TQueryResult.h:74
This class controls a Parallel ROOT Facility, PROOF, cluster.
Definition: TProof.h:316
virtual void SetInputList(TList *in, Bool_t adopt=kTRUE)
Set / change the input list.
Bool_t IsArchived() const
Definition: TQueryResult.h:142
virtual ~TQueryResult()
Destructor.
TString fLibList
blank-separated list of libs loaded at fStart
Definition: TQueryResult.h:66
void SetArchived(const char *archfile)
Set (or update) query in archived state.
const char * GetParList() const
Definition: TQueryResult.h:130
Mother of all ROOT objects.
Definition: TObject.h:37
Int_t GetNumMergers() const
Definition: TQueryResult.h:140
TDatime GetEndTime() const
Definition: TQueryResult.h:118
Float_t fMergeTime
Merging time (seconds) (millisec precision)
Definition: TQueryResult.h:75
Long64_t fEntries
number of entries processed
Definition: TQueryResult.h:60
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
Definition: TRolke.cxx:630
Long64_t fBytes
number of bytes processed
Definition: TQueryResult.h:62
Definition: first.py:1
Float_t GetTermTime() const
Definition: TQueryResult.h:138
Implement some of the functionality of the class TTree requiring access to extra libraries (Histogram...
Definition: TTreePlayer.h:37
const char * GetResultFile() const
Definition: TQueryResult.h:132
const Bool_t kTRUE
Definition: RtypesCore.h:87
TString fParList
colon-separated list of PAR loaded at fStart
Definition: TQueryResult.h:67
Bool_t fDraw
true if draw action query
Definition: TQueryResult.h:53
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
Definition: TDatime.h:37
TString fOptions
processing options + aclic mode (< opt >#< aclic_mode >)
Definition: TQueryResult.h:58
Float_t fInitTime
Initialization time (seconds) (millisec precision)
Definition: TQueryResult.h:73