Logo ROOT  
Reference Guide
TFileCollection.cxx
Go to the documentation of this file.
1 // @(#)root/base:$Id$
2 // Author: Gerhard Erich Bruckner, Jan Fiete Grosse-Oetringhaus 04/06/07
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, 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 /** \class TFileCollection
13 \ingroup Base
14 
15 Class that contains a list of TFileInfo's and accumulated meta
16 data information about its entries. This class is used to describe
17 file sets as stored by Grid file catalogs, by PROOF or any other
18 collection of TFile names.
19 */
20 
21 #include "TFileCollection.h"
22 #include "THashList.h"
23 #include "TFileInfo.h"
24 #include "TIterator.h"
25 #include "TMap.h"
26 #include "TObjString.h"
27 #include "TUri.h"
28 #include "TUrl.h"
29 #include "TUUID.h"
30 #include "TMD5.h"
31 #include "TSystem.h"
32 #include "TRegexp.h"
33 #include "TPRegexp.h"
34 #include "TError.h"
35 
36 #include <iostream>
37 #include <fstream>
38 
39 
41 
42 ////////////////////////////////////////////////////////////////////////////////
43 /// TFileCollection constructor. Specify a name and title describing
44 /// the list. If textfile is specified the file is opened and a
45 /// TFileCollection is created containing the files in the textfile.
46 
47 TFileCollection::TFileCollection(const char *name, const char *title,
48  const char *textfile, Int_t nfiles, Int_t firstfile)
49  : TNamed(name, title), fList(0), fMetaDataList(0), fDefaultTree(),
50  fTotalSize(0), fNFiles(0), fNStagedFiles(0), fNCorruptFiles(0)
51 {
52  fList = new THashList();
53  fList->SetOwner();
54 
55  fMetaDataList = new TList;
57 
58  AddFromFile(textfile, nfiles, firstfile);
59 }
60 
61 ////////////////////////////////////////////////////////////////////////////////
62 /// Cleanup.
63 
65 {
66  delete fList;
67  delete fMetaDataList;
68 }
69 
70 ////////////////////////////////////////////////////////////////////////////////
71 /// Add TFileInfo to the collection.
72 
74 {
75  if (fList && info) {
76  if (!fList->FindObject(info->GetName())) {
77  fList->Add(info);
78  if (info->GetIndex() < 0) info->SetIndex(fList->GetSize());
79  Update();
80  return 1;
81  } else {
82  Warning("Add", "file: '%s' already in the list - ignoring",
83  info->GetCurrentUrl()->GetUrl());
84  }
85  }
86  return 0;
87 }
88 
89 ////////////////////////////////////////////////////////////////////////////////
90 /// Add content of the TFileCollection to this collection.
91 
93 {
94  if (fList && coll && coll->GetList()) {
95  TIter nxfi(coll->GetList());
96  TFileInfo *fi = 0;
97  while ((fi = (TFileInfo *) nxfi())) {
98  TFileInfo *info = new TFileInfo(*fi);
99  fList->Add(info);
100  if (fi->GetIndex() < 0) info->SetIndex(fList->GetSize());
101  }
102  Update();
103  return 1;
104  } else {
105  return 0;
106  }
107 }
108 
109 ////////////////////////////////////////////////////////////////////////////////
110 /// Add file names contained in the specified text file.
111 /// The file should contain one url per line; empty lines or lines starting with '#'
112 /// (commented lines) are ignored.
113 /// If nfiles > 0 only nfiles files are added, starting from file 'firstfile' (>= 1).
114 /// The method returns the number of added files.
115 
116 Int_t TFileCollection::AddFromFile(const char *textfile, Int_t nfiles, Int_t firstfile)
117 {
118  if (!fList)
119  return 0;
120 
121  Int_t nf = 0;
122  TString fn(textfile);
123  if (!fn.IsNull() && !gSystem->ExpandPathName(fn)) {
124  std::ifstream f;
125  f.open(fn);
126  if (f.is_open()) {
127  Bool_t all = (nfiles <= 0) ? kTRUE : kFALSE;
128  Int_t ff = (!all && (firstfile < 1)) ? 1 : firstfile;
129  Int_t nn = 0;
130  while (f.good() && (all || nf < nfiles)) {
131  TString line;
132  line.ReadToDelim(f);
133  // Skip commented or empty lines
134  if (!line.IsWhitespace() && !line.BeginsWith("#")) {
135  nn++;
136  if (all || nn >= ff) {
137  TFileInfo *info = new TFileInfo(line);
138  fList->Add(info);
139  if (info->GetIndex() < 0) info->SetIndex(fList->GetSize());
140  nf++;
141  }
142  }
143  }
144  f.close();
145  Update();
146  } else
147  Error("AddFromFile", "unable to open file %s (%s)", textfile, fn.Data());
148  }
149  return nf;
150 }
151 
152 ////////////////////////////////////////////////////////////////////////////////
153 /// Add all files matching the specified pattern to the collection.
154 /// 'dir' can include wildcards after the last slash, which causes all
155 /// matching files in that directory to be added.
156 /// If dir is the full path of a file, only one element is added.
157 /// Return value is the number of added files.
158 
159 Int_t TFileCollection::Add(const char *dir)
160 {
161  Int_t nf = 0;
162 
163  if (!fList)
164  return nf;
165 
166  if (!dir || !*dir) {
167  Error("Add", "input dir undefined");
168  return nf;
169  }
170 
171  FileStat_t st;
172  FileStat_t tmp;
173  TString baseDir = gSystem->GetDirName(dir);
174  // if the 'dir' or its base dir exist
175  if (gSystem->GetPathInfo(dir, st) == 0 ||
176  gSystem->GetPathInfo(baseDir, tmp) == 0) {
177  // If 'dir' points to a single file, add to the list and exit
178  if (R_ISREG(st.fMode)) {
179  // regular, single file
180  TFileInfo *info = new TFileInfo(dir);
181  info->SetBit(TFileInfo::kStaged);
182  Add(info);
183  nf++;
184  Update();
185  return nf;
186  } else {
187  void *dataSetDir = gSystem->OpenDirectory(gSystem->GetDirName(dir).Data());
188  if (!dataSetDir) {
189  // directory cannot be opened
190  Error("Add", "directory %s cannot be opened",
191  gSystem->GetDirName(dir).Data());
192  } else {
193  const char *ent;
194  TString filesExp(TString("^") + gSystem->BaseName(dir) + "$");
195  filesExp.ReplaceAll("*",".*");
196  TRegexp rg(filesExp);
197  while ((ent = gSystem->GetDirEntry(dataSetDir))) {
198  TString entryString(ent);
199  if (entryString.Index(rg) != kNPOS) {
200  // matching dir entry
201  TString fn = gSystem->GetDirName(dir);
202  fn += "/";
203  fn += ent;
204  gSystem->GetPathInfo(fn, st);
205  if (R_ISREG(st.fMode)) {
206  // regular file
207  TFileInfo *info = new TFileInfo(fn);
208  info->SetBit(TFileInfo::kStaged);
209  Add(info);
210  nf++;
211  }
212  }
213  }
214  // close the directory
215  gSystem->FreeDirectory(dataSetDir);
216  Update();
217  }
218  }
219  }
220  return nf;
221 }
222 
223 ////////////////////////////////////////////////////////////////////////////////
224 /// Remove duplicates based on the UUID, typically after a verification.
225 /// Return the number of entries removed.
226 
228 {
229  THashList *hl = new THashList;
230  hl->SetOwner();
231 
232  Int_t n0 = fList->GetSize();
233  TIter nxfi(fList);
234  TFileInfo *fi = 0;
235  while ((fi = (TFileInfo *)nxfi())) {
236  if (!(hl->FindObject(fi->GetUUID()->AsString()))) {
237  // We hash on the UUID
238  fList->Remove(fi);
239  fi->SetName(fi->GetUUID()->AsString());
240  hl->Add(fi);
241  }
242  }
243  delete fList;
244  fList = hl;
245  // How many removed?
246  Int_t nr = n0 - fList->GetSize();
247  if (nr > 0)
248  Info("RemoveDuplicates", "%d duplicates found and removed", nr);
249  // Done
250  return nr;
251 }
252 
253 ////////////////////////////////////////////////////////////////////////////////
254 /// Creates a subset of the files that have the kStaged & !kCorrupted bit set.
255 
257 {
258  if (!fList)
259  return 0;
260 
261  TFileCollection *subset = new TFileCollection(GetName(), GetTitle());
262 
263  TIter iter(fList);
264  TFileInfo *fileInfo = 0;
265  while ((fileInfo = dynamic_cast<TFileInfo*>(iter.Next()))) {
266  if (fileInfo->TestBit(TFileInfo::kStaged) && !fileInfo->TestBit(TFileInfo::kCorrupted))
267  subset->Add(fileInfo);
268  }
269 
270  subset->Update();
271 
272  return subset;
273 }
274 
275 ////////////////////////////////////////////////////////////////////////////////
276 /// Merge all TFileCollection objects in li into this TFileCollection object.
277 /// Updates counters at the end.
278 /// Returns the number of merged collections or -1 in case of error.
279 
281 {
282 
283  if (!li) return 0;
284  if (li->IsEmpty()) return 0;
285 
286  Long64_t nentries=0;
287  TIter next(li);
288  while (TObject *o = next()) {
289  TFileCollection* coll = dynamic_cast<TFileCollection*> (o);
290  if (!coll) {
291  Error("Add", "attempt to add object of class: %s to a %s",
292  o->ClassName(),this->ClassName());
293  return -1;
294  }
295  Add(coll);
296  nentries++;
297  }
298  Update();
299 
300  return nentries;
301 }
302 
303 ////////////////////////////////////////////////////////////////////////////////
304 /// Update accumulated information about the elements of the collection
305 /// (e.g. fTotalSize). If 'avgsize' > 0, use an average file size of 'avgsize'
306 /// bytes when the size info is not available.
307 /// Also updates the meta data information by summarizing
308 /// the meta data of the contained objects.
309 /// Return -1 in case of any failure, 0 if the total size is exact, 1 if
310 /// incomplete, 2 if complete but (at least partially) estimated.
311 
313 {
314  if (!fList)
315  return -1;
316 
317  Int_t rc = 0;
318 
319  fTotalSize = 0;
320  fNStagedFiles = 0;
321  fNCorruptFiles = 0;
322 
323  // Clear internal meta information which is going to be rebuilt in this
324  // function
325  TIter nxm(fMetaDataList);
326  TFileInfoMeta *m = 0;
327  while ((m = (TFileInfoMeta *)nxm())) {
328  if (!(m->TestBit(TFileInfoMeta::kExternal))) {
330  delete m;
331  }
332  }
333 
334  fNFiles = fList->GetEntries();
335 
336  TIter iter(fList);
337  TFileInfo *fileInfo = 0;
338  while ((fileInfo = dynamic_cast<TFileInfo*> (iter.Next()))) {
339 
340  if (fileInfo->GetSize() > 0) {
341  fTotalSize += fileInfo->GetSize();
342  } else {
343  rc = 1;
344  if (avgsize > 0) {
345  rc = 2;
346  fTotalSize += avgsize;
347  }
348  }
349 
350  if (fileInfo->TestBit(TFileInfo::kStaged) && !fileInfo->TestBit(TFileInfo::kCorrupted)) {
351  fNStagedFiles++;
352 
353  if (fileInfo->GetMetaDataList()) {
354  TIter metaDataIter(fileInfo->GetMetaDataList());
355  // other than TFileInfoMeta is also allowed in list
356  TObject *obj = 0;
357  while ((obj = metaDataIter.Next())) {
358  TFileInfoMeta *metaData = dynamic_cast<TFileInfoMeta*>(obj);
359  if (!metaData)
360  continue;
361  if (!metaData->IsTree())
362  continue;
363 
364  // find corresponding entry in TFileCollection's meta data
365  TFileInfoMeta *metaDataSum = dynamic_cast<TFileInfoMeta*>(fMetaDataList->FindObject(metaData->GetName()));
366  Bool_t newObj = kFALSE;
367  if (!metaDataSum) {
368  // create explicitly, there are some values that do not make sense for the sum
369  metaDataSum = new TFileInfoMeta(metaData->GetName(), metaData->GetTitle());
370  fMetaDataList->Add(metaDataSum);
371  newObj = kTRUE;
372  }
373 
374  // sum the values
375  if (newObj)
376  metaDataSum->SetEntries(metaData->GetEntries());
377  else
378  metaDataSum->SetEntries(metaDataSum->GetEntries() + metaData->GetEntries());
379  }
380  }
381  }
382  if (fileInfo->TestBit(TFileInfo::kCorrupted))
383  fNCorruptFiles++;
384  }
385 
386  // Done
387  return rc;
388 }
389 
390 ////////////////////////////////////////////////////////////////////////////////
391 /// Prints the contents of the TFileCollection.
392 /// If option contains:
393 ///
394 /// - 'M' print global meta information
395 /// - 'F' print all the files in the collection in compact form
396 /// (current url, default tree name|class|entries, md5)
397 /// - 'L' together with 'F', print all the files in the collection
398 /// in long form (uuid, md5, all URLs, all meta objects; on
399 /// many lines)
400 /// - "filter:[SsCc]" invokes PrintDetailed() which prints out dataset
401 /// content in a formatted fashion by filtering on files
402 /// which are (S)taged or not (s), (C)orrupted or not (c)
403 
404 void TFileCollection::Print(Option_t *option) const
405 {
406  TString opt(option);
407  TPMERegexp re("(^|;| )filter:([SsCc]+)( |;|$)", 4);
408  if (re.Match(option) == 4) {
409  TString showOnly = re[2];
410  PrintDetailed(showOnly);
411  return;
412  }
413 
414  Printf("TFileCollection %s - %s contains: %lld files with a size of"
415  " %lld bytes, %.1f %% staged - default tree name: '%s'",
418 
419  if (opt.Contains("M", TString::kIgnoreCase)) {
420  Printf("The files contain the following trees:");
421 
422  TIter metaDataIter(fMetaDataList);
423  TFileInfoMeta* metaData = 0;
424  while ((metaData = dynamic_cast<TFileInfoMeta*>(metaDataIter.Next()))) {
425  if (!metaData->IsTree())
426  continue;
427 
428  Printf("Tree %s: %lld events", metaData->GetName(), metaData->GetEntries());
429  }
430  }
431 
432  if (fList && opt.Contains("F", TString::kIgnoreCase)) {
433  Printf("The collection contains the following files:");
434  if (!opt.Contains("L") && !fDefaultTree.IsNull())
435  opt += TString::Format(" T:%s", fDefaultTree.Data());
436  fList->Print(opt);
437  }
438 }
439 
440 ////////////////////////////////////////////////////////////////////////////////
441 /// Print detailed.
442 
444 {
445  Bool_t bS, bs, bC, bc;
446  bS = bs = bC = bc = kFALSE;
447 
448  if (showOnly.Index('S') >= 0) bS = kTRUE;
449  if (showOnly.Index('s') >= 0) bs = kTRUE;
450  if (showOnly.Index('C') >= 0) bC = kTRUE;
451  if (showOnly.Index('c') >= 0) bc = kTRUE;
452 
453  // If Ss (or Cc) omitted, show both Ss (or Cc)
454  if (!bc && !bC) bc = bC = kTRUE;
455  if (!bs && !bS) bs = bS = kTRUE;
456 
457  TIter it(fList);
458  TFileInfo *info;
459  UInt_t countAll = 0;
460  UInt_t countMatch = 0;
461 
462  Printf("\033[1m #. SC | Entries | Size | URL\033[m");
463 
464  TString um;
465  Double_t sz;
466 
467  while ((info = dynamic_cast<TFileInfo *>(it.Next()))) {
468 
471 
472  TUrl *url;
473 
474  countAll++;
475 
476  if ( ((s && bS) || (!s && bs)) && ((c && bC) || (!c && bc)) ) {
477 
478  TFileInfoMeta *meta = info->GetMetaData(); // gets the first one
479  Int_t entries = -1;
480 
481  if (meta) entries = meta->GetEntries();
482 
483  FormatSize(info->GetSize(), um, sz);
484 
485  // First line: current URL with all information
486  info->ResetUrl();
487  TUrl *curUrl = info->GetCurrentUrl();
488  const char *curUrlStr = curUrl ? curUrl->GetUrl() : "n.a.";
489  Printf("\033[1m%4u.\033[m %c%c | %-7s | %6.1lf %s | %s",
490  ++countMatch,
491  (s ? 'S' : 's'), (c ? 'C' : 'c'),
492  ((entries > 0) ? Form("% 7d", entries) : "n.a."),
493  sz, um.Data(), curUrlStr);
494  info->NextUrl();
495 
496  // Every other URL shown below current one
497  while ((url = info->NextUrl())) {
498  Printf(" | | | %s", url->GetUrl());
499  }
500  info->ResetUrl();
501 
502  } // end match filters
503 
504  } // end loop over entries
505 
506  if (countAll) {
507 
508  Printf(">> There are \033[1m%u\033[m file(s) in dataset: "
509  "\033[1m%u (%5.1f%%)\033[m matched your criteria (%s)",
510  countAll, countMatch,
511  100.*(Float_t)countMatch/(Float_t)countAll, showOnly.Data());
512 
513  FormatSize(fTotalSize, um, sz);
514  Printf(">> Total size : \033[1m%.1f %s\033[m", sz, um.Data());
515  Printf(">> Staged (S) : \033[1m%5.1f %%\033[m", GetStagedPercentage());
516  Printf(">> Corrupted (C) : \033[1m%5.1f %%\033[m",
518 
519  }
520  else {
521  Printf(">> No files in dataset");
522  }
523 
524  const char *treeName = GetDefaultTreeName();
525  Printf(">> Default tree : \033[1m%s\033[m",
526  (treeName ? treeName : "(no default tree)"));
527 
528 }
529 
530 ////////////////////////////////////////////////////////////////////////////////
531 /// Format size.
532 
534  Double_t &size) const
535 {
536  static const char *ums[] = { "byt", "KiB", "MiB", "GiB", "TiB" };
537  Int_t maxDiv = sizeof(ums)/sizeof(const char *);
538  Int_t nDiv = 0;
539  Double_t b = bytes;
540 
541  while ((b >= 1024.) && (nDiv+1 < maxDiv)) {
542  b /= 1024.;
543  nDiv++;
544  }
545 
546  um = ums[nDiv];
547  size = b;
548 }
549 
550 ////////////////////////////////////////////////////////////////////////////////
551 /// Calls TUrl::SetAnchor() for all URLs contained in all TFileInfos.
552 
553 void TFileCollection::SetAnchor(const char *anchor)
554 {
555  if (!fList)
556  return;
557 
558  TIter iter(fList);
559  TFileInfo *fileInfo = 0;
560  while ((fileInfo = dynamic_cast<TFileInfo*>(iter.Next()))) {
561  fileInfo->ResetUrl();
562  TUrl *url = 0;
563  while ((url = fileInfo->NextUrl()))
564  url->SetAnchor(anchor);
565  fileInfo->ResetUrl();
566  }
567 }
568 
569 ////////////////////////////////////////////////////////////////////////////////
570 /// Set the bit for all TFileInfos
571 
573 {
574  if (!fList)
575  return;
576 
577  TIter iter(fList);
578  TFileInfo *fileInfo = 0;
579  while ((fileInfo = dynamic_cast<TFileInfo*>(iter.Next())))
580  fileInfo->SetBit(f);
581 }
582 
583 ////////////////////////////////////////////////////////////////////////////////
584 /// Reset the bit for all TFileInfos
585 
587 {
588  if (!fList)
589  return;
590 
591  TIter iter(fList);
592  TFileInfo *fileInfo = 0;
593  while ((fileInfo = dynamic_cast<TFileInfo*>(iter.Next())))
594  fileInfo->ResetBit(f);
595 }
596 
597 ////////////////////////////////////////////////////////////////////////////////
598 /// Returns the tree set with SetDefaultTreeName if set
599 /// Returns the name of the first tree in the meta data list.
600 /// Returns 0 in case no trees are found in the meta data list.
601 
603 {
604  if (fDefaultTree.Length() > 0)
605  return fDefaultTree;
606 
607  TIter metaDataIter(fMetaDataList);
608  TFileInfoMeta *metaData = 0;
609  while ((metaData = dynamic_cast<TFileInfoMeta*>(metaDataIter.Next()))) {
610  if (!metaData->IsTree())
611  continue;
612  return metaData->GetName();
613  }
614  return 0;
615 }
616 
617 ////////////////////////////////////////////////////////////////////////////////
618 /// Returns the number of entries for the specified tree (retrieved from meta data).
619 /// If tree is not specified, use the default tree name.
620 /// Returns -1 in case the specified tree is not found.
621 
623 {
624  if (!tree || !*tree) {
626  if (!tree)
627  return -1;
628  }
629 
630  TFileInfoMeta *metaData = dynamic_cast<TFileInfoMeta*>(fMetaDataList->FindObject(tree));
631  if (!metaData)
632  return -1;
633 
634  return metaData->GetEntries();
635 }
636 
637 ////////////////////////////////////////////////////////////////////////////////
638 /// Returns the meta data object with the specified meta name.
639 /// Returns 0 in case specified meta data is not found.
640 
642 {
643  if (!meta || !*meta)
644  return 0;
645 
646  return dynamic_cast<TFileInfoMeta*>(fMetaDataList->FindObject(meta));
647 }
648 
649 ////////////////////////////////////////////////////////////////////////////////
650 /// Moves the indicated meta data in the first position, so that
651 /// it becomes effectively the default.
652 
654 {
655  TFileInfoMeta *fim = GetMetaData(meta);
656  if (fim) {
657  fMetaDataList->Remove(fim);
658  fMetaDataList->AddFirst(fim);
659  }
660 }
661 
662 ////////////////////////////////////////////////////////////////////////////////
663 /// Removes the indicated meta data object in all TFileInfos and this object
664 /// If no name is given all metadata is removed
665 
666 void TFileCollection::RemoveMetaData(const char *meta)
667 {
668  if (fList) {
669  TIter iter(fList);
670  TFileInfo *fileInfo = 0;
671  while ((fileInfo = dynamic_cast<TFileInfo*>(iter.Next())))
672  fileInfo->RemoveMetaData(meta);
673  }
674 
675  if (meta) {
676  TObject* obj = fMetaDataList->FindObject("meta");
677  if (obj) {
678  fMetaDataList->Remove(obj);
679  delete obj;
680  }
681  } else
682  fMetaDataList->Clear();
683 }
684 
685 ////////////////////////////////////////////////////////////////////////////////
686 /// Sort the collection.
687 
689 {
690  if (!fList)
691  return;
692 
693  // Make sure the relevant bit has the wanted value
694  if (useindex) {
696  } else {
698  }
699 
700  fList->Sort();
701 }
702 
703 ////////////////////////////////////////////////////////////////////////////////
704 /// Export the relevant info as a string; use 'name' as collection name,
705 /// if defined, else use GetName().
706 /// The output object must be destroyed by the caller
707 
709 {
710  TString treeInfo;
711  if (GetDefaultTreeName()) {
713  if (popt == 1) {
714  treeInfo = GetDefaultTreeName();
715  if (meta)
716  treeInfo += TString::Format(", %lld entries", meta->GetEntries());
717  TFileInfoMeta *frac = GetMetaData("/FractionOfTotal");
718  if (frac)
719  treeInfo += TString::Format(", %3.1f %% of total", frac->GetEntries() / 10.);
720  } else {
721  treeInfo.Form(" %s ", GetDefaultTreeName());
722  if (treeInfo.Length() > 14) treeInfo.Replace(13, 1, '>');
723  treeInfo.Resize(14);
724  if (meta) {
725  if (meta->GetEntries() > 99999999) {
726  treeInfo += TString::Format("| %8lld ", meta->GetEntries());
727  } else {
728  treeInfo += TString::Format("| %8.4g ", (Double_t) meta->GetEntries());
729  }
730  }
731  }
732  } else {
733  treeInfo = " N/A";
734  }
735  if (popt == 0) treeInfo.Resize(25);
736 
737  // Renormalize the size to kB, MB or GB
738  const char *unit[4] = {"kB", "MB", "GB", "TB"};
739  Int_t k = 0;
740  Long64_t refsz = 1024;
741  Long64_t xsz = (Long64_t) (GetTotalSize() / refsz);
742  while (xsz > 1024 && k < 3) {
743  k++;
744  refsz *= 1024;
745  xsz = (Long64_t) (GetTotalSize() / refsz);
746  }
747 
748  // The name
749  TString dsname(name);
750  if (dsname.IsNull()) dsname = GetName();
751 
752  // Create the output string
753  TObjString *outs = 0;
754  if (popt == 1) {
755  outs = new TObjString(Form("%s %lld files, %lld %s, staged %d %%, tree: %s", dsname.Data(),
756  GetNFiles(), xsz, unit[k],
757  (Int_t)GetStagedPercentage(), treeInfo.Data()));
758  } else {
759  outs = new TObjString(Form("%s| %7lld |%s| %5lld %s | %3d %%", dsname.Data(),
760  GetNFiles(), treeInfo.Data(), xsz, unit[k],
762  }
763  // Done
764  return outs;
765 }
766 
767 ////////////////////////////////////////////////////////////////////////////////
768 /// Return the subset of files served by 'server'. The syntax for 'server' is
769 /// the standard URI one, i.e. `[<scheme>://]<host>[:port]`
770 
772 {
774 
775  // Server specification is mandatory
776  if (!server || strlen(server) <= 0) {
777  Info("GetFilesOnServer", "server undefined - do nothing");
778  return fc;
779  }
780 
781  // Nothing to do for empty lists
782  if (!fList || fList->GetSize() <= 0) {
783  Info("GetFilesOnServer", "the list is empty - do nothing");
784  return fc;
785  }
786 
787  // Define the server reference string
788  TUri uri(server);
789  TString srv, scheme("root"), port;
790  if (uri.GetScheme() != "") scheme = uri.GetScheme();
791  if (uri.GetPort() != "") port.Form(":%s", uri.GetPort().Data());
792  srv.Form("%s://%s%s", scheme.Data(), TUrl(server).GetHostFQDN(), port.Data());
793  if (gDebug > 0)
794  Info("GetFilesOnServer", "searching for files on server: '%s' (input: '%s')",
795  srv.Data(), server);
796 
797  // Prepare the output
798  fc = new TFileCollection(GetName());
799  TString title;
800  if (GetTitle() && strlen(GetTitle()) > 0) {
801  title.Form("%s (subset on server %s)", GetTitle(), srv.Data());
802  } else {
803  title.Form("subset of '%s' on server %s", GetName(), srv.Data());
804  }
805  fc->SetTitle(title.Data());
806  // The default tree name
807  fc->SetDefaultTreeName(GetDefaultTreeName());
808 
809  // We look for URL starting with srv
810  srv.Insert(0, "^");
811 
812  // Go through the list
813  TIter nxf(fList);
814  TFileInfo *fi = 0;
815  while ((fi = (TFileInfo *)nxf())) {
816  TUrl *xu = 0;
817  if ((xu = fi->FindByUrl(srv.Data()))) {
818  // Create a new TFileInfo object
819  TFileInfo *nfi = new TFileInfo(xu->GetUrl(), fi->GetSize(),
820  fi->GetUUID() ? fi->GetUUID()->AsString() : 0,
821  fi->GetMD5() ? fi->GetMD5()->AsString() : 0);
822  if (fi->GetMetaDataList()) {
823  TIter nxm(fi->GetMetaDataList());
824  TFileInfoMeta *md = 0;
825  while ((md = (TFileInfoMeta *) nxm())) {
826  nfi->AddMetaData(new TFileInfoMeta(*md));
827  }
828  }
831  if (gDebug > 1)
832  Info("GetFilesOnServer", "adding: %s", xu->GetUrl());
833  fc->Add(nfi);
834  }
835  }
836 
837  // If nothing found, delete the object
838  if (fc->GetList()->GetSize() <= 0) {
839  delete fc;
840  fc = 0;
841  Info("GetFilesOnServer", "dataset '%s' has no files on server: '%s' (searched for: '%s')",
842  GetName(), server, srv.Data());
843  }
844 
845  // Fill up sums on the sub file collection
846  if (fc) {
847  fc->Update();
848  // Fraction of total in permille
849  Long64_t xf = (fc->GetTotalSize() * 1000) / GetTotalSize();
850  TFileInfoMeta *m = new TFileInfoMeta("FractionOfTotal", "External Info", xf);
851  m->SetBit(TFileInfoMeta::kExternal);
852  fc->AddMetaData(m);
853  }
854 
855  // Done
856  return fc;
857 }
858 
859 ////////////////////////////////////////////////////////////////////////////////
860 /// Return a map of TFileCollections with the files on each data server,
861 /// excluding servers in the comma-separated list 'exclude'.
862 /// If curronly is kTRUE, only the URL flagged as current in the TFileInfo
863 /// are considered.
864 
865 TMap *TFileCollection::GetFilesPerServer(const char *exclude, Bool_t curronly)
866 {
867  TMap *dsmap = 0;
868 
869  // Nothing to do for empty lists
870  if (!fList || fList->GetSize() <= 0) {
871  Info("GetFilesPerServer", "the list is empty - do nothing");
872  return dsmap;
873  }
874 
875  // List of servers to be ignored
876  THashList *excl = 0;
877  if (exclude && strlen(exclude) > 0) {
878  excl = new THashList;
879  excl->SetOwner();
880  TUri uri;
881  TString srvs(exclude), s, srv, scheme, port;
882  Int_t from = 0;
883  while (srvs.Tokenize(s, from, ",")) {
884  uri.SetUri(s.Data());
885  scheme = "root";
886  port = "";
887  if (uri.GetScheme() != "") scheme = uri.GetScheme();
888  if (uri.GetPort() != "") port.Form(":%s", uri.GetPort().Data());
889  srv.Form("%s://%s%s", scheme.Data(), TUrl(s.Data()).GetHostFQDN(), port.Data());
890  // Add
891  excl->Add(new TObjString(srv.Data()));
892  }
893  }
894 
895  // Prepare the output
896  dsmap = new TMap();
897 
898  // Go through the list
899  TIter nxf(fList);
900  TFileInfo *fi = 0;
901  TUri uri;
902  TString key;
903  TFileCollection *fc = 0;
904  while ((fi = (TFileInfo *)nxf())) {
905  // Save current URL
906  TUrl *curl = fi->GetCurrentUrl();
907  // Loop over URLs
908  if (!curronly) fi->ResetUrl();
909  TUrl *xurl = 0;
910  while ((xurl = (curronly) ? curl : fi->NextUrl())) {
911  // Find the key for this server
912  key.Form("%s://%s", xurl->GetProtocol(), xurl->GetHostFQDN());
913  // Check if this has to be ignored
914  if (excl && excl->FindObject(key.Data())) {
915  if (curronly) break;
916  continue;
917  } else if (excl && xurl->GetPort() > 0) {
918  // Complete the key, if needed, and recheck
919  key += TString::Format(":%d", xurl->GetPort());
920  if (excl->FindObject(key.Data())) {
921  if (curronly) break;
922  continue;
923  }
924  }
925  // Get the map entry for this key
926  TPair *ent = 0;
927  if (!(ent = (TPair *) dsmap->FindObject(key.Data()))) {
928  // Create the TFileCollection
929  fc = new TFileCollection(GetName());
930  TString title;
931  if (GetTitle() && strlen(GetTitle()) > 0) {
932  title.Form("%s (subset on server %s)", GetTitle(), key.Data());
933  } else {
934  title.Form("subset of '%s' on server %s", GetName(), key.Data());
935  }
936  fc->SetTitle(title.Data());
937  // The default tree name
938  fc->SetDefaultTreeName(GetDefaultTreeName());
939  // Add it to the map
940  dsmap->Add(new TObjString(key.Data()), fc);
941  // Notify
942  if (gDebug > 0)
943  Info("GetFilesPerServer", "found server: '%s' (fc: %p)", key.Data(), fc);
944  } else {
945  // Attach to the TFileCollection
946  fc = (TFileCollection *) ent->Value();
947  }
948  // Create a new TFileInfo object
949  TFileInfo *nfi = new TFileInfo(xurl->GetUrl(kTRUE), fi->GetSize(),
950  fi->GetUUID() ? fi->GetUUID()->AsString() : 0,
951  fi->GetMD5() ? fi->GetMD5()->AsString() : 0);
952  if (fi->GetMetaDataList()) {
953  TIter nxm(fi->GetMetaDataList());
954  TFileInfoMeta *md = 0;
955  while ((md = (TFileInfoMeta *) nxm())) {
956  nfi->AddMetaData(new TFileInfoMeta(*md));
957  }
958  }
961  fc->Add(nfi);
962  // In current_only mode we are done
963  if (curronly) break;
964  }
965  // Restore current URL
966  fi->SetCurrentUrl(curl);
967  }
968 
969  // Fill up sums on the sub file collections
970  TIter nxk(dsmap);
971  TObject *k = 0;
972  while ((k = nxk()) && (fc = (TFileCollection *) dsmap->GetValue(k))) {
973  fc->Update();
974  // Fraction of total in permille
975  Long64_t xf = (fc->GetTotalSize() * 1000) / GetTotalSize();
976  TFileInfoMeta *m = new TFileInfoMeta("FractionOfTotal", "External Info", xf);
977  m->SetBit(TFileInfoMeta::kExternal);
978  fc->AddMetaData(m);
979  }
980 
981  // Cleanup
982  if (excl) delete excl;
983 
984  // Done
985  return dsmap;
986 }
987 
988 ////////////////////////////////////////////////////////////////////////////////
989 /// Add's a meta data object to the file collection object. The object will be
990 /// adopted by the TFileCollection and should not be deleted by the user.
991 /// Typically objects of class TFileInfoMeta or derivatives should be added,
992 /// but any class is accepted.
993 ///
994 /// NB : a call to TFileCollection::Update will remove these objects unless the
995 /// bit TFileInfoMeta::kExternal is set.
996 /// Returns kTRUE if successful, kFALSE otherwise.
997 
999 {
1000  if (meta) {
1001  if (!fMetaDataList) {
1002  fMetaDataList = new TList;
1004  }
1005  fMetaDataList->Add(meta);
1006  return kTRUE;
1007  }
1008  return kFALSE;
1009 }
TPair
Definition: TMap.h:102
TFileCollection::AddMetaData
Bool_t AddMetaData(TObject *meta)
Add's a meta data object to the file collection object.
Definition: TFileCollection.cxx:998
c
#define c(i)
Definition: RSha256.hxx:119
TFileCollection::RemoveDuplicates
Int_t RemoveDuplicates()
Remove duplicates based on the UUID, typically after a verification.
Definition: TFileCollection.cxx:227
TFileCollection::AddFromFile
Int_t AddFromFile(const char *file, Int_t nfiles=-1, Int_t firstfile=1)
Add file names contained in the specified text file.
Definition: TFileCollection.cxx:116
m
auto * m
Definition: textangle.C:8
TFileCollection::GetTotalSize
Long64_t GetTotalSize() const
Definition: TFileCollection.h:85
TSystem::GetPathInfo
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:1396
TPMERegexp
Definition: TPRegexp.h:97
TFileInfo
Definition: TFileInfo.h:39
TFileInfoMeta::IsTree
Bool_t IsTree() const
Definition: TFileInfo.h:143
TFileCollection::Sort
void Sort(Bool_t useindex=kFALSE)
Sort the collection.
Definition: TFileCollection.cxx:688
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TFileCollection::fList
THashList * fList
Definition: TFileCollection.h:42
TObject::TestBit
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
Definition: TObject.h:172
TCollection::Print
virtual void Print(Option_t *option="") const
Default print for collections, calls Print(option, 1).
Definition: TCollection.cxx:476
TFileCollection::GetTotalEntries
Long64_t GetTotalEntries(const char *tree) const
Returns the number of entries for the specified tree (retrieved from meta data).
Definition: TFileCollection.cxx:622
TList::AddFirst
virtual void AddFirst(TObject *obj)
Add object at the beginning of the list.
Definition: TList.cxx:99
TFileInfo::GetCurrentUrl
TUrl * GetCurrentUrl() const
Return the current url.
Definition: TFileInfo.cxx:249
TFileCollection::fDefaultTree
TString fDefaultTree
Definition: TFileCollection.h:45
TFileInfo::SetIndex
void SetIndex(Int_t idx)
Definition: TFileInfo.h:100
TFileCollection::ExportInfo
TObjString * ExportInfo(const char *name=0, Int_t popt=0)
Export the relevant info as a string; use 'name' as collection name, if defined, else use GetName().
Definition: TFileCollection.cxx:708
f
#define f(i)
Definition: RSha256.hxx:122
TFileInfo::AddMetaData
Bool_t AddMetaData(TObject *meta)
Add's a meta data object to the file info object.
Definition: TFileInfo.cxx:385
TNamed::SetName
virtual void SetName(const char *name)
Set the name of the TNamed.
Definition: TNamed.cxx:140
kNPOS
const Ssiz_t kNPOS
Definition: RtypesCore.h:115
TCollection::GetEntries
virtual Int_t GetEntries() const
Definition: TCollection.h:177
TFileCollection::GetMetaData
TFileInfoMeta * GetMetaData(const char *meta=0) const
Returns the meta data object with the specified meta name.
Definition: TFileCollection.cxx:641
fc
static struct mg_connection * fc(struct mg_context *ctx)
Definition: civetweb.c:3728
TSystem::BaseName
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
Definition: TSystem.cxx:933
TFileCollection::ResetBitAll
void ResetBitAll(UInt_t f)
Reset the bit for all TFileInfos.
Definition: TFileCollection.cxx:586
TList::FindObject
virtual TObject * FindObject(const char *name) const
Find an object in this list using its name.
Definition: TList.cxx:577
TString::Data
const char * Data() const
Definition: TString.h:369
TSystem::FreeDirectory
virtual void FreeDirectory(void *dirp)
Free a directory.
Definition: TSystem.cxx:844
TFileCollection::SetAnchor
void SetAnchor(const char *anchor)
Calls TUrl::SetAnchor() for all URLs contained in all TFileInfos.
Definition: TFileCollection.cxx:553
TFileCollection::PrintDetailed
void PrintDetailed(TString &showOnly) const
Print detailed.
Definition: TFileCollection.cxx:443
tree
Definition: tree.py:1
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
Form
char * Form(const char *fmt,...)
TNamed::GetTitle
virtual const char * GetTitle() const
Returns title of object.
Definition: TNamed.h:54
TObjString.h
FileStat_t
Definition: TSystem.h:124
TString::Replace
TString & Replace(Ssiz_t pos, Ssiz_t n, const char *s)
Definition: TString.h:682
TFileCollection::~TFileCollection
virtual ~TFileCollection()
Cleanup.
Definition: TFileCollection.cxx:64
TObject::Info
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Definition: TObject.cxx:864
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TObject::Error
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition: TObject.cxx:890
TString::kIgnoreCase
@ kIgnoreCase
Definition: TString.h:268
TCollection::SetOwner
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
Definition: TCollection.cxx:746
TUrl::GetPort
Int_t GetPort() const
Definition: TUrl.h:78
Float_t
float Float_t
Definition: RtypesCore.h:57
TMap::GetValue
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
Definition: TMap.cxx:236
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:168
TUrl::SetAnchor
void SetAnchor(const char *anchor)
Definition: TUrl.h:86
TPMERegexp::Match
Int_t Match(const TString &s, UInt_t start=0)
Runs a match on s against the regex 'this' was created with.
Definition: TPRegexp.cxx:708
TString::Contains
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Definition: TString.h:624
TFileInfoMeta::SetEntries
void SetEntries(Long64_t entries)
Definition: TFileInfo.h:147
TString::Length
Ssiz_t Length() const
Definition: TString.h:410
TFileInfo::ResetUrl
void ResetUrl()
Definition: TFileInfo.h:69
TUri.h
nentries
int nentries
Definition: THbookFile.cxx:91
TFileInfo::NextUrl
TUrl * NextUrl()
Iterator function, start iteration by calling ResetUrl().
Definition: TFileInfo.cxx:261
TString::Format
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:2311
TMap::Add
void Add(TObject *obj)
This function may not be used (but we need to provide it since it is a pure virtual in TCollection).
Definition: TMap.cxx:54
TFileCollection::fNFiles
Long64_t fNFiles
Definition: TFileCollection.h:47
TFileCollection::GetStagedPercentage
Float_t GetStagedPercentage() const
Definition: TFileCollection.h:89
TMD5::AsString
const char * AsString() const
Return message digest as string.
Definition: TMD5.cxx:220
TString
Definition: TString.h:136
TFileCollection::RemoveMetaData
void RemoveMetaData(const char *meta=0)
Removes the indicated meta data object in all TFileInfos and this object If no name is given all meta...
Definition: TFileCollection.cxx:666
TFileInfo::SetCurrentUrl
Bool_t SetCurrentUrl(const char *url)
Set 'url' as current URL, if in the list Return kFALSE if not in the list.
Definition: TFileInfo.cxx:355
R_ISREG
Bool_t R_ISREG(Int_t mode)
Definition: TSystem.h:118
b
#define b(i)
Definition: RSha256.hxx:118
TFileInfo::GetMetaData
TFileInfoMeta * GetMetaData(const char *meta=0) const
Get meta data object with specified name.
Definition: TFileInfo.cxx:425
TFileInfo::FindByUrl
TUrl * FindByUrl(const char *url, Bool_t withDeflt=kFALSE)
Find an element from a URL. Returns 0 if not found.
Definition: TFileInfo.cxx:277
TSystem::GetDirName
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
Definition: TSystem.cxx:1030
bool
TString::ReplaceAll
TString & ReplaceAll(const TString &s1, const TString &s2)
Definition: TString.h:692
TList::Sort
virtual void Sort(Bool_t order=kSortAscending)
Sort linked list.
Definition: TList.cxx:936
TUUID.h
TObjString
Definition: TObjString.h:28
TFileCollection::Update
Int_t Update(Long64_t avgsize=-1)
Update accumulated information about the elements of the collection (e.g.
Definition: TFileCollection.cxx:312
TRegexp.h
TString::Form
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Definition: TString.cxx:2289
TFileCollection::TFileCollection
TFileCollection(const TFileCollection &)
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TFileCollection::fTotalSize
Long64_t fTotalSize
Definition: TFileCollection.h:46
TString::Resize
void Resize(Ssiz_t n)
Resize the string. Truncate or add blanks as necessary.
Definition: TString.cxx:1095
TPRegexp.h
TFileCollection::SetBitAll
void SetBitAll(UInt_t f)
Set the bit for all TFileInfos.
Definition: TFileCollection.cxx:572
TObject::ResetBit
void ResetBit(UInt_t f)
Definition: TObject.h:171
TSystem.h
TFileInfo::kCorrupted
@ kCorrupted
Definition: TFileInfo.h:59
TFileInfo.h
TFileCollection::FormatSize
void FormatSize(Long64_t bytes, TString &um, Double_t &size) const
Format size.
Definition: TFileCollection.cxx:533
TFileInfoMeta::kExternal
@ kExternal
Definition: TFileInfo.h:121
THashList
Definition: THashList.h:34
TObject::SetBit
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Definition: TObject.cxx:696
FileStat_t::fMode
Int_t fMode
Definition: TSystem.h:127
TIterator.h
THashList::FindObject
TObject * FindObject(const char *name) const
Find object using its name.
Definition: THashList.cxx:262
TFileCollection::fNCorruptFiles
Long64_t fNCorruptFiles
Definition: TFileCollection.h:50
TUri::GetScheme
const TString GetScheme() const
Definition: TUri.h:80
TNamed
Definition: TNamed.h:29
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TFileInfo::RemoveMetaData
Bool_t RemoveMetaData(const char *meta=0)
Remove the metadata object.
Definition: TFileInfo.cxx:402
TFileInfoMeta::GetEntries
Long64_t GetEntries() const
Definition: TFileInfo.h:140
gDebug
R__EXTERN Int_t gDebug
Definition: RtypesCore.h:119
TMap::FindObject
TObject * FindObject(const char *keyname) const
Check if a (key,value) pair exists with keyname as name of the key.
Definition: TMap.cxx:215
TFileInfoMeta
Definition: TFileInfo.h:108
TFileInfo::GetIndex
Int_t GetIndex() const
Definition: TFileInfo.h:99
TFileInfo::GetSize
Long64_t GetSize() const
Definition: TFileInfo.h:80
TFileCollection.h
TString::Insert
TString & Insert(Ssiz_t pos, const char *s)
Definition: TString.h:649
TPair::Value
TObject * Value() const
Definition: TMap.h:121
TFileCollection::fMetaDataList
TList * fMetaDataList
Definition: TFileCollection.h:43
TSystem::ExpandPathName
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
Definition: TSystem.cxx:1272
line
TLine * line
Definition: entrylistblock_figure1.C:235
TCollection::IsEmpty
virtual Bool_t IsEmpty() const
Definition: TCollection.h:186
THashList::Remove
TObject * Remove(TObject *obj)
Remove object from the list.
Definition: THashList.cxx:378
TObject::Warning
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Definition: TObject.cxx:876
TUrl::GetUrl
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
Definition: TUrl.cxx:387
TUrl
Definition: TUrl.h:33
TFileCollection::Add
Int_t Add(TFileInfo *info)
Add TFileInfo to the collection.
Definition: TFileCollection.cxx:73
TFileCollection::SetDefaultMetaData
void SetDefaultMetaData(const char *meta)
Moves the indicated meta data in the first position, so that it becomes effectively the default.
Definition: TFileCollection.cxx:653
unsigned int
TRegexp
Definition: TRegexp.h:31
TFileInfo::GetMD5
TMD5 * GetMD5() const
Definition: TFileInfo.h:82
THashList.h
TString::Index
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
Definition: TString.h:639
Printf
void Printf(const char *fmt,...)
TUrl::GetProtocol
const char * GetProtocol() const
Definition: TUrl.h:64
gSystem
R__EXTERN TSystem * gSystem
Definition: TSystem.h:559
TFileCollection::Merge
Long64_t Merge(TCollection *list)
Merge all TFileCollection objects in li into this TFileCollection object.
Definition: TFileCollection.cxx:280
TFileInfo::GetMetaDataList
TList * GetMetaDataList() const
Definition: TFileInfo.h:83
TIter::Next
TObject * Next()
Definition: TCollection.h:249
TFileInfo::kStaged
@ kStaged
Definition: TFileInfo.h:58
TString::IsNull
Bool_t IsNull() const
Definition: TString.h:407
Double_t
double Double_t
Definition: RtypesCore.h:59
TSystem::OpenDirectory
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
Definition: TSystem.cxx:835
TUri
Definition: TUri.h:35
TList::Remove
virtual TObject * Remove(TObject *obj)
Remove object from the list.
Definition: TList.cxx:821
TCollection::GetSize
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Definition: TCollection.h:182
TGeant4Unit::um
static constexpr double um
Definition: TGeant4SystemOfUnits.h:112
TFileCollection::GetFilesOnServer
TFileCollection * GetFilesOnServer(const char *server)
Return the subset of files served by 'server'.
Definition: TFileCollection.cxx:771
TFileCollection::GetList
THashList * GetList()
Definition: TFileCollection.h:70
TList::Add
virtual void Add(TObject *obj)
Definition: TList.h:87
TSystem::GetDirEntry
virtual const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
Definition: TSystem.cxx:852
TObject
Definition: TObject.h:37
TMap.h
TList::Clear
virtual void Clear(Option_t *option="")
Remove all objects from the list.
Definition: TList.cxx:401
TUri::GetPort
const TString GetPort() const
Definition: TUri.h:86
name
char name[80]
Definition: TGX11.cxx:110
TFileCollection::fNStagedFiles
Long64_t fNStagedFiles
Definition: TFileCollection.h:49
TUUID::AsString
const char * AsString() const
Return UUID as string. Copy string immediately since it will be reused.
Definition: TUUID.cxx:562
TFileCollection::GetCorruptedPercentage
Float_t GetCorruptedPercentage() const
Definition: TFileCollection.h:91
TMD5.h
TIter
Definition: TCollection.h:233
TFileCollection::Print
void Print(Option_t *option="") const
Prints the contents of the TFileCollection.
Definition: TFileCollection.cxx:404
TFileCollection::GetDefaultTreeName
const char * GetDefaultTreeName() const
Returns the tree set with SetDefaultTreeName if set Returns the name of the first tree in the meta da...
Definition: TFileCollection.cxx:602
TCollection
Definition: TCollection.h:63
TFileInfo::kSortWithIndex
@ kSortWithIndex
Definition: TFileInfo.h:60
TNamed::GetName
virtual const char * GetName() const
Returns name of object.
Definition: TNamed.h:53
TFileCollection::GetNFiles
Long64_t GetNFiles() const
Definition: TFileCollection.h:86
TFileCollection::GetStagedSubset
TFileCollection * GetStagedSubset()
Creates a subset of the files that have the kStaged & !kCorrupted bit set.
Definition: TFileCollection.cxx:256
TUrl::GetHostFQDN
const char * GetHostFQDN() const
Return fully qualified domain name of url host.
Definition: TUrl.cxx:469
TUrl.h
TList
Definition: TList.h:44
TFileInfo::GetUUID
TUUID * GetUUID() const
Definition: TFileInfo.h:81
TUri::SetUri
Bool_t SetUri(const TString &uri)
int
TFileCollection::GetFilesPerServer
TMap * GetFilesPerServer(const char *exclude=0, Bool_t curronly=kFALSE)
Return a map of TFileCollections with the files on each data server, excluding servers in the comma-s...
Definition: TFileCollection.cxx:865
TFileCollection
Definition: TFileCollection.h:39
TError.h
TMap
Definition: TMap.h:40