ROOT  6.06/09
Reference Guide
TProofOutputFile.cxx
Go to the documentation of this file.
1 // @(#)root/proof:$Id$
2 // Author: Long Tran-Thanh 14/09/07
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2002, 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 // //
14 // TProofOutputFile //
15 // //
16 // Small class to steer the merging of files produced on the workers //
17 // //
18 //////////////////////////////////////////////////////////////////////////
19 
20 #include "TProofOutputFile.h"
21 #include <TEnv.h>
22 #include <TError.h>
23 #include <TFileCollection.h>
24 #include <TFileInfo.h>
25 #include <TFileMerger.h>
26 #include <TFile.h>
27 #include <TList.h>
28 #include <TObjArray.h>
29 #include <TObject.h>
30 #include <TObjString.h>
31 #include <TProofDebug.h>
32 #include <TProofServ.h>
33 #include <TSystem.h>
34 #include <TUUID.h>
35 
37 
38 ////////////////////////////////////////////////////////////////////////////////
39 /// Main constructor
40 
41 TProofOutputFile::TProofOutputFile(const char *path,
42  ERunType type, UInt_t opt, const char *dsname)
43  : TNamed(path, ""), fRunType(type), fTypeOpt(opt)
44 {
45  fIsLocal = kFALSE;
46  fMerged = kFALSE;
47  fMerger = 0;
48  fDataSet = 0;
51 
52  Init(path, dsname);
53 }
54 
55 ////////////////////////////////////////////////////////////////////////////////
56 /// Constructor with the old signature, kept for convenience and backard compatibility.
57 /// Options:
58 /// 'M' merge: finally merge the created files
59 /// 'L' local: copy locally the files before merging (implies 'M')
60 /// 'D' dataset: create a TFileCollection
61 /// 'R' register: dataset run with dataset registration
62 /// 'O' overwrite: force dataset replacement during registration
63 /// 'V' verify: verify the registered dataset
64 /// 'H' merge histograms in one go (option to TFileMerger)
65 /// Special 'option' values for backward compatibility:
66 /// "" equivalent to "M"
67 /// "LOCAL" equivalent to "ML" or "L"
68 
70  const char *option, const char *dsname)
71  : TNamed(path, "")
72 {
73  fIsLocal = kFALSE;
74  fMerged = kFALSE;
75  fMerger = 0;
76  fDataSet = 0;
78 
79  // Fill the run type and option type
80  fRunType = kMerge;
81  fTypeOpt = kRemote;
82  if (option && strlen(option) > 0) {
83  TString opt(option);
84  if (opt.Contains("L") || (opt == "LOCAL")) fTypeOpt = kLocal;
85  if (opt.Contains("H")) fMergeHistosOneGo = kTRUE;
86  if (!opt.Contains("M") && opt.Contains("D")) {
87  // Dataset creation mode
89  fTypeOpt = kCreate;
90  if (opt.Contains("R")) fTypeOpt = (ETypeOpt) (fTypeOpt | kRegister);
91  if (opt.Contains("O")) fTypeOpt = (ETypeOpt) (fTypeOpt | kOverwrite);
92  if (opt.Contains("V")) fTypeOpt = (ETypeOpt) (fTypeOpt | kVerify);
93  }
94  }
95 
96  Init(path, dsname);
97 }
98 
99 ////////////////////////////////////////////////////////////////////////////////
100 /// Initializer. Called by all constructors
101 
102 void TProofOutputFile::Init(const char *path, const char *dsname)
103 {
104  fLocalHost = TUrl(gSystem->HostName()).GetHostFQDN();
105  Int_t port = gEnv->GetValue("ProofServ.XpdPort", -1);
106  if (port > -1) {
107  fLocalHost += ":";
108  fLocalHost += port;
109  }
110 
111  TString xpath(path);
112  // Resolve the relevant placeholders in fFileName (e.g. root://a.ser.ver//data/dir/<group>/<user>/file)
113  TProofServ::ResolveKeywords(xpath, 0);
114  TUrl u(xpath, kTRUE);
115  // File name
116  fFileName = u.GetFile();
117  // The name is used to identify this entity
119  // The title is the dataset name in the case such option is chosen.
120  // In the merging case it can be the final location of the file on the client if the retrieve
121  // option is chosen; if the case, this set in TProofPlayer::MergeOutputFiles.
122  if (fRunType == kDataset) {
123  if (dsname && strlen(dsname) > 0) {
124  // This is the dataset name in case such option is chosen
125  SetTitle(dsname);
126  } else {
127  // Default dataset name
128  SetTitle(GetName());
129  }
130  }
131  // Options and anchor, if any
132  if (u.GetOptions() && strlen(u.GetOptions()) > 0)
134  if (u.GetAnchor() && strlen(u.GetAnchor()) > 0)
136  // Path
137  fIsLocal = kFALSE;
138  fDir = u.GetUrl();
139  Int_t pos = fDir.Index(fFileName);
140  if (pos != kNPOS) fDir.Remove(pos);
141  fRawDir = fDir;
142 
143  if (fDir.BeginsWith("file:")) {
144  fIsLocal = kTRUE;
145  // For local files, the user is allowed to create files under the specified directory.
146  // If this is not the case, the file is rooted automatically to the assigned dir which
147  // is the datadir for dataset creation runs, and the working dir for merging runs
148  TString dirPath = gSystem->DirName(fFileName);
150  if (AssertDir(dirPath) != 0)
151  Error("Init", "problems asserting path '%s'", dirPath.Data());
152  TString dirData = (!IsMerge() && gProofServ) ? gProofServ->GetDataDir()
154  if ((dirPath[0] == '/') && gSystem->AccessPathName(dirPath, kWritePermission)) {
155  Warning("Init", "not allowed to create files under '%s' - chrooting to '%s'",
156  dirPath.Data(), dirData.Data());
157  dirPath.Insert(0, dirData);
158  } else if (dirPath.BeginsWith("..")) {
159  dirPath.Remove(0, 2);
160  if (dirPath[0] != '/') dirPath.Insert(0, "/");
161  dirPath.Insert(0, dirData);
162  } else if (dirPath[0] == '.' || dirPath[0] == '~') {
163  dirPath.Remove(0, 1);
164  if (dirPath[0] != '/') dirPath.Insert(0, "/");
165  dirPath.Insert(0, dirData);
166  } else if (dirPath.IsNull()) {
167  dirPath = dirData;
168  }
169  // Make sure that session-tag, ordinal and query sequential number are present otherwise
170  // we may override outputs from other workers
171  if (gProofServ) {
172  if (!IsMerge() || (!dirPath.BeginsWith(gProofServ->GetDataDir()) &&
173  !dirPath.BeginsWith(gSystem->WorkingDirectory()))) {
174  if (!dirPath.Contains(gProofServ->GetOrdinal())) {
175  if (!dirPath.EndsWith("/")) dirPath += "/";
176  dirPath += gProofServ->GetOrdinal();
177  }
178  }
179  if (!IsMerge()) {
180  if (!dirPath.Contains(gProofServ->GetSessionTag())) {
181  if (!dirPath.EndsWith("/")) dirPath += "/";
182  dirPath += gProofServ->GetSessionTag();
183  }
184  if (!dirPath.Contains("<qnum>")) {
185  if (!dirPath.EndsWith("/")) dirPath += "/";
186  dirPath += "<qnum>";
187  }
188  // Resolve the relevant placeholders
189  TProofServ::ResolveKeywords(dirPath, 0);
190  }
191  }
192  // Save the raw directory
193  fRawDir = dirPath;
194  // Make sure the the path exists
195  if (AssertDir(dirPath) != 0)
196  Error("Init", "problems asserting path '%s'", dirPath.Data());
197  // Take into account local server settings
200  // The path to be used to address the file
201  fDir += dirPath;
202  }
203  // Notify
204  Info("Init", "dir: %s (raw: %s)", fDir.Data(), fRawDir.Data());
205 
206  // Default output file name
208  fOutputFileName = "<file>";
209  if (gEnv->Lookup("Proof.OutputFile")) {
210  fOutputFileName = gEnv->GetValue("Proof.OutputFile", "<file>");
212  }
213  // Add default file name
214  TString fileName = path;
215  if (!fileName.EndsWith(".root")) fileName += ".root";
216  // Make sure that the file name was inserted (may not happen if the placeholder <file> is missing)
217  if (!fOutputFileName.IsNull() && !fOutputFileName.Contains("<file>")) {
218  if (!fOutputFileName.EndsWith("/")) fOutputFileName += "/";
219  fOutputFileName += fileName;
220  }
221  // Resolve placeholders
222  fileName.ReplaceAll("<ord>",""); // No ordinal in the final merged file
224  Info("Init", "output file url: %s", fOutputFileName.Data());
225  // Fill ordinal
226  fWorkerOrdinal = "<ord>";
227  TProofServ::ResolveKeywords(fWorkerOrdinal, 0);
228 }
229 
230 ////////////////////////////////////////////////////////////////////////////////
231 /// Main destructor
232 
234 {
235  if (fDataSet) delete fDataSet;
236  if (fMerger) delete fMerger;
237 }
238 
239 ////////////////////////////////////////////////////////////////////////////////
240 /// Set the name of the output file; in the form of an Url.
241 
243 {
244  if (name && strlen(name) > 0) {
247  PDB(kOutput,1) Info("SetOutputFileName", "output file url: %s", fOutputFileName.Data());
248  } else {
249  fOutputFileName = "";
250  }
252 }
253 
254 ////////////////////////////////////////////////////////////////////////////////
255 /// Open the file using the unique temporary name
256 
258 {
259  if (fFileName.IsNull()) return 0;
260 
261  // Create the path
262  TString fileLoc;
263  fileLoc.Form("%s/%s%s", fRawDir.Data(), fFileName.Data(), fOptionsAnchor.Data());
264 
265  // Open the file
266  TFile *retFile = TFile::Open(fileLoc, opt);
267 
268  return retFile;
269 }
270 
271 ////////////////////////////////////////////////////////////////////////////////
272 /// Adopt a file already open.
273 /// Return 0 if OK, -1 in case of failure
274 
276 {
277  if (!f || (f && f->IsZombie())) {
278  Error("AdoptFile", "file is undefined or zombie!");
279  return -1;
280  }
281  const TUrl *u = f->GetEndpointUrl();
282  if (!u) {
283  Error("AdoptFile", "file end-point url is undefined!");
284  return -1;
285  }
286 
287  // Set the name and dir
288  fIsLocal = kFALSE;
289  if (!strcmp(u->GetProtocol(), "file")) {
290  fIsLocal = kTRUE;
291  fDir = u->GetFile();
292  } else {
293  fDir = u->GetUrl();
294  }
297  fRawDir = fDir;
298 
299  // If local remove prefix, if any
300  if (fIsLocal) {
301  TString localDS;
303  if (!localDS.IsNull()) {
305  fDir.Insert(0, localDS);
306  }
307  }
308 
309  return 0;
310 }
311 
312 ////////////////////////////////////////////////////////////////////////////////
313 /// Merge objects from the list into this object
314 
316 {
317  PDB(kOutput,2) Info("Merge","enter: merge? %d", IsMerge());
318 
319  // Needs somethign to merge
320  if(!list || list->IsEmpty()) return 0;
321 
322  if (IsMerge()) {
323  // Build-up the merger
324  TString fileLoc;
325  TString outputFileLoc = (fOutputFileName.IsNull()) ? fFileName : fOutputFileName;
326  // Get the file merger instance
327  Bool_t localMerge = (fRunType == kMerge && fTypeOpt == kLocal) ? kTRUE : kFALSE;
328  TFileMerger *merger = GetFileMerger(localMerge);
329  if (!merger) {
330  Error("Merge", "could not instantiate the file merger");
331  return -1;
332  }
333 
334  if (!fMerged) {
335  merger->OutputFile(outputFileLoc);
336  fileLoc.Form("%s/%s", fDir.Data(), GetFileName());
337  AddFile(merger, fileLoc);
338  fMerged = kTRUE;
339  }
340 
341  TIter next(list);
342  TObject *o = 0;
343  while((o = next())) {
344  TProofOutputFile *pFile = dynamic_cast<TProofOutputFile *>(o);
345  if (pFile) {
346  fileLoc.Form("%s/%s", pFile->GetDir(), pFile->GetFileName());
347  AddFile(merger, fileLoc);
348  }
349  }
350  } else {
351  // Get the reference MSS url, if any
352  TUrl mssUrl(gEnv->GetValue("ProofServ.PoolUrl",""));
353  // Build-up the TFileCollection
354  TFileCollection *dataset = GetFileCollection();
355  if (!dataset) {
356  Error("Merge", "could not instantiate the file collection");
357  return -1;
358  }
359  fMerged = kTRUE;
360  TString path;
361  TFileInfo *fi = 0;
362  // If new, add ourseelves
363  dataset->Update();
364  PDB(kOutput,2) Info("Merge","dataset: %s (nfiles: %lld)", dataset->GetName(), dataset->GetNFiles());
365  if (dataset->GetNFiles() == 0) {
366  // Save the export and raw urls
367  path.Form("%s/%s%s", GetDir(), GetFileName(), GetOptionsAnchor());
368  fi = new TFileInfo(path);
369  // Add also an URL with the redirector path, if any
370  if (mssUrl.IsValid()) {
371  TUrl ur(fi->GetFirstUrl()->GetUrl());
372  ur.SetProtocol(mssUrl.GetProtocol());
373  ur.SetHost(mssUrl.GetHost());
374  ur.SetPort(mssUrl.GetPort());
375  if (mssUrl.GetUser() && strlen(mssUrl.GetUser()) > 0)
376  ur.SetUser(mssUrl.GetUser());
377  fi->AddUrl(ur.GetUrl());
378  }
379  // Add special local URL to keep track of the file
380  path.Form("%s/%s?node=%s", GetDir(kTRUE), GetFileName(), GetLocalHost());
381  fi->AddUrl(path);
382  PDB(kOutput,2) fi->Print();
383  // Now add to the dataset
384  dataset->Add(fi);
385  }
386 
387  TIter next(list);
388  TObject *o = 0;
389  while((o = next())) {
390  TProofOutputFile *pFile = dynamic_cast<TProofOutputFile *>(o);
391  if (pFile) {
392  // Save the export and raw urls
393  path.Form("%s/%s%s", pFile->GetDir(), pFile->GetFileName(), pFile->GetOptionsAnchor());
394  fi = new TFileInfo(path);
395  // Add also an URL with the redirector path, if any
396  if (mssUrl.IsValid()) {
397  TUrl ur(fi->GetFirstUrl()->GetUrl());
398  ur.SetProtocol(mssUrl.GetProtocol());
399  ur.SetHost(mssUrl.GetHost());
400  ur.SetPort(mssUrl.GetPort());
401  if (mssUrl.GetUser() && strlen(mssUrl.GetUser()) > 0)
402  ur.SetUser(mssUrl.GetUser());
403  fi->AddUrl(ur.GetUrl());
404  }
405  // Add special local URL to keep track of the file
406  path.Form("%s/%s?node=%s", pFile->GetDir(kTRUE), pFile->GetFileName(), pFile->GetLocalHost());
407  fi->AddUrl(path);
408  PDB(kOutput,2) fi->Print();
409  // Now add to the dataset
410  dataset->Add(fi);
411  }
412  }
413  }
414  PDB(kOutput,2) Info("Merge","Done");
415 
416  // Done
417  return 0;
418 }
419 
420 ////////////////////////////////////////////////////////////////////////////////
421 /// Dump the class content
422 
424 {
425  Info("Print","-------------- %s : start (%s) ------------", GetName(), fLocalHost.Data());
426  Info("Print"," dir: %s", fDir.Data());
427  Info("Print"," raw dir: %s", fRawDir.Data());
428  Info("Print"," file name: %s%s", fFileName.Data(), fOptionsAnchor.Data());
429  if (IsMerge()) {
430  Info("Print"," run type: create a merged file");
431  Info("Print"," merging option: %s",
432  (fTypeOpt == kLocal) ? "local copy" : "keep remote");
433  } else {
434  TString opt;
435  if ((fTypeOpt & kRegister)) opt += "R";
436  if ((fTypeOpt & kOverwrite)) opt += "O";
437  if ((fTypeOpt & kVerify)) opt += "V";
438  Info("Print"," run type: create dataset (name: '%s', opt: '%s')",
439  GetTitle(), opt.Data());
440  }
441  Info("Print"," output file name: %s", fOutputFileName.Data());
442  Info("Print"," ordinal: %s", fWorkerOrdinal.Data());
443  Info("Print","-------------- %s : done -------------", GetName());
444 
445  return;
446 }
447 
448 ////////////////////////////////////////////////////////////////////////////////
449 /// Notify error message
450 
451 void TProofOutputFile::NotifyError(const char *msg)
452 {
453  if (msg) {
454  if (gProofServ)
456  else
457  Printf("%s", msg);
458  } else {
459  Info("NotifyError","called with empty message");
460  }
461 
462  return;
463 }
464 
465 ////////////////////////////////////////////////////////////////////////////////
466 /// Add file to merger, checking the result
467 
468 void TProofOutputFile::AddFile(TFileMerger *merger, const char *path)
469 {
470  if (merger && path) {
471  if (!merger->AddFile(path))
472  NotifyError(Form("TProofOutputFile::AddFile:"
473  " error from TFileMerger::AddFile(%s)", path));
474  }
475 }
476 
477 ////////////////////////////////////////////////////////////////////////////////
478 /// Unlink path
479 
480 void TProofOutputFile::Unlink(const char *path)
481 {
482  if (path) {
483  if (!gSystem->AccessPathName(path)) {
484  if (gSystem->Unlink(path) != 0)
485  NotifyError(Form("TProofOutputFile::Unlink:"
486  " error from TSystem::Unlink(%s)", path));
487  }
488  }
489 }
490 
491 ////////////////////////////////////////////////////////////////////////////////
492 /// Get instance of the file collection to be used in 'dataset' mode
493 
495 {
496  if (!fDataSet)
498  return fDataSet;
499 }
500 
501 ////////////////////////////////////////////////////////////////////////////////
502 /// Get instance of the file merger to be used in 'merge' mode
503 
505 {
506  if (!fMerger)
507  fMerger = new TFileMerger(local, fMergeHistosOneGo);
508  return fMerger;
509 }
510 
511 ////////////////////////////////////////////////////////////////////////////////
512 /// Assert directory path 'dirpath', with the ownership of the last already
513 /// existing subpath.
514 /// Return 0 on success, -1 on error
515 
516 Int_t TProofOutputFile::AssertDir(const char *dirpath)
517 {
518  TString existsPath(dirpath);
519  TList subPaths;
520  while (existsPath != "/" && existsPath != "." && gSystem->AccessPathName(existsPath)) {
521  subPaths.AddFirst(new TObjString(gSystem->BaseName(existsPath)));
522  existsPath = gSystem->DirName(existsPath);
523  }
524  subPaths.SetOwner(kTRUE);
525  FileStat_t st;
526  if (gSystem->GetPathInfo(existsPath, st) == 0) {
527  TString xpath = existsPath;
528  TIter nxp(&subPaths);
529  TObjString *os = 0;
530  while ((os = (TObjString *) nxp())) {
531  xpath += TString::Format("/%s", os->GetName());
532  if (gSystem->mkdir(xpath, kTRUE) == 0) {
533  if (gSystem->Chmod(xpath, (UInt_t) st.fMode) != 0)
534  ::Warning("TProofOutputFile::AssertDir", "problems setting mode on '%s'", xpath.Data());
535  } else {
536  ::Error("TProofOutputFile::AssertDir", "problems creating path '%s'", xpath.Data());
537  return -1;
538  }
539  }
540  } else {
541  ::Warning("TProofOutputFile::AssertDir", "could not get info for path '%s': will only try to create"
542  " the full path w/o trying to set the mode", existsPath.Data());
543  if (gSystem->mkdir(existsPath, kTRUE) != 0) {
544  ::Error("TProofOutputFile::AssertDir", "problems creating path '%s'", existsPath.Data());
545  return -1;
546  }
547  }
548  // Done
549  return 0;
550 }
const char * GetName() const
Returns name of object.
Definition: TObjString.h:42
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition: TSystem.cxx:928
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:52
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
Definition: TSystem.cxx:1265
long long Long64_t
Definition: RtypesCore.h:69
void Print(Option_t *options="") const
Print information about this object.
Definition: TFileInfo.cxx:475
virtual const char * WorkingDirectory()
Return working directory.
Definition: TSystem.cxx:865
void SetProtocol(const char *proto, Bool_t setDefaultPort=kFALSE)
Set protocol and, optionally, change the port accordingly.
Definition: TUrl.cxx:518
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
void Print(Option_t *option="") const
Dump the class content.
Collectable string class.
Definition: TObjString.h:32
const char Option_t
Definition: RtypesCore.h:62
void NotifyError(const char *errmsg)
Notify error message.
This class represents a WWW compatible URL.
Definition: TUrl.h:41
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:635
const char * GetDataDir() const
Definition: TProofServ.h:262
static void FilterLocalroot(TString &path, const char *url="root://dum/")
If 'path' is local and 'dsrv' is Xrootd, apply 'path.Localroot' settings, if any. ...
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
Definition: TSystem.cxx:1363
virtual void SetName(const char *name)
Change (i.e.
Definition: TNamed.cxx:128
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
const char * GetProtocol() const
Definition: TUrl.h:73
const char * GetSessionTag() const
Definition: TProofServ.h:257
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:892
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition: TFile.h:45
virtual void AddFirst(TObject *obj)
Add object at the beginning of the list.
Definition: TList.cxx:92
Int_t AdoptFile(TFile *f)
Adopt a file already open.
const char * GetFileName() const
Bool_t IsZombie() const
Definition: TObject.h:141
virtual const TUrl * GetEndpointUrl() const
Definition: TFile.h:195
Basic string class.
Definition: TString.h:137
static Int_t AssertDir(const char *dirpath)
Assert directory path 'dirpath', with the ownership of the last already existing subpath.
int Int_t
Definition: RtypesCore.h:41
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
Definition: TSystem.cxx:996
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
ClassImp(TProofOutputFile) TProofOutputFile
Main constructor.
Bool_t AddUrl(const char *url, Bool_t infront=kFALSE)
Add a new URL.
Definition: TFileInfo.cxx:293
const char * GetOptions() const
Definition: TUrl.h:80
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Definition: TString.h:558
TFileMerger * fMerger
static void ResolveKeywords(TString &fname, const char *path=0)
Replace , , , , , , , and placeholders in fname...
TString & Insert(Ssiz_t pos, const char *s)
Definition: TString.h:592
TUrl * GetFirstUrl() const
Definition: TFileInfo.h:83
virtual int mkdir(const char *name, Bool_t recursive=kFALSE)
Make a file system directory.
Definition: TSystem.cxx:900
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:732
TFile * OpenFile(const char *opt)
Open the file using the unique temporary name.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
Definition: TFile.cxx:3851
Int_t fMode
Definition: TSystem.h:138
const char * Data() const
Definition: TString.h:349
virtual int Unlink(const char *name)
Unlink, i.e. remove, a file.
Definition: TSystem.cxx:1346
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
Definition: TString.cxx:2334
#define PDB(mask, level)
Definition: TProofDebug.h:58
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
virtual Bool_t IsEmpty() const
Definition: TCollection.h:99
void Init(TClassEdit::TInterpreterLookupHelper *helper)
Definition: TClassEdit.cxx:118
void SetOutputFileName(const char *name)
Set the name of the output file; in the form of an Url.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:918
virtual Bool_t OutputFile(const char *url, Bool_t force)
Open merger output file.
virtual Int_t SendAsynMessage(const char *msg, Bool_t lf=kTRUE)
Send an asychronous message to the master / client .
TFileMerger * GetFileMerger(Bool_t local=kFALSE)
Get instance of the file merger to be used in 'merge' mode.
A doubly linked list.
Definition: TList.h:47
virtual Bool_t AddFile(TFile *source, Bool_t own, Bool_t cpProgress)
Add the TFile to this file merger and give ownership of the TFile to this object (unless kFALSE is re...
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
Definition: TString.cxx:2220
R__EXTERN TSystem * gSystem
Definition: TSystem.h:549
static void GetLocalServer(TString &dsrv)
Extract LOCALDATASERVER info in 'dsrv'.
This class provides file copy and merging services.
Definition: TFileMerger.h:30
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
Definition: TEnv.cxx:494
virtual TEnvRec * Lookup(const char *n)
Loop over all resource records and return the one with name.
Definition: TEnv.cxx:550
Collection abstract base class.
Definition: TCollection.h:48
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2321
unsigned int UInt_t
Definition: RtypesCore.h:42
char * Form(const char *fmt,...)
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:51
const char * GetAnchor() const
Definition: TUrl.h:79
Bool_t IsNull() const
Definition: TString.h:387
#define Printf
Definition: TGeoToOCC.h:18
void Unlink(const char *path)
Unlink path.
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
Definition: TUrl.cxx:385
Long64_t Merge(TCollection *list)
Merge objects from the list into this object.
TString & Remove(Ssiz_t pos)
Definition: TString.h:616
virtual int Chmod(const char *file, UInt_t mode)
Set the file permission bits. Returns -1 in case or error, 0 otherwise.
Definition: TSystem.cxx:1471
double f(double x)
virtual ~TProofOutputFile()
Main destructor.
virtual const char * HostName()
Return the system's host name.
Definition: TSystem.cxx:307
const char * GetOptionsAnchor() const
int type
Definition: TGX11.cxx:120
R__EXTERN TEnv * gEnv
Definition: TEnv.h:174
const char * GetOrdinal() const
Definition: TProofServ.h:265
#define name(a, b)
Definition: linkTestLib0.cpp:5
Mother of all ROOT objects.
Definition: TObject.h:58
const char * GetLocalHost() const
R__EXTERN TProofServ * gProofServ
Definition: TProofServ.h:359
const Ssiz_t kNPOS
Definition: Rtypes.h:115
Class that contains a list of TFileInfo's and accumulated meta data information about its entries...
TFileCollection * GetFileCollection()
Get instance of the file collection to be used in 'dataset' mode.
TFileCollection * fDataSet
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:567
const char * GetDir(Bool_t raw=kFALSE) const
Class describing a generic file including meta information.
Definition: TFileInfo.h:50
Bool_t IsMerge() const
void ResetBit(UInt_t f)
Definition: TObject.h:172
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:582
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual void SetTitle(const char *title="")
Change (i.e. set) the title of the TNamed.
Definition: TNamed.cxx:152
void Init(const char *path, const char *dsname)
Initializer. Called by all constructors.
const char * GetFile() const
Definition: TUrl.h:78
void AddFile(TFileMerger *merger, const char *path)
Add file to merger, checking the result.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:904