47 #define DSM_ONE_GB (1073741824) 62 fUser(user), fCommonUser(), fCommonGroup(),
63 fGroupQuota(), fGroupUsed(),
64 fUserUsed(), fNTouchedFiles(0), fNOpenedFiles(0),
65 fNDisappearedFiles(0), fMTimeGroupConfig(-1)
109 if (!(srvmapsenv.IsNull())) {
110 if (srvmapsenv.BeginsWith(
"+")) {
111 if (!(srvmaps.IsNull())) srvmaps +=
",";
112 srvmaps += srvmapsenv(1,srvmapsenv.Length());
114 srvmaps = srvmapsenv;
118 Warning(
"TDataSetManager",
"problems parsing DataSet.SrvMaps input info (%s)" 119 " - ignoring", srvmaps.Data());
161 if (opts && strlen(opts) > 0) {
215 Info(
"ReadGroupConfig",
"path to config file undefined - nothing to do");
225 Info(
"ReadGroupConfig",
"file has not changed - do nothing");
231 if (cf && (strlen(cf) > 0)) {
234 Error(
"ReadGroupConfig",
"could not stat %s", cf);
238 Error(
"ReadGroupConfig",
"cannot read %s", cf);
247 Info(
"ReadGroupConfig",
"reading group config from %s", cf);
253 Error(
"ReadGroupConfig",
"could not open config file %s", cf);
266 if (line[0] ==
'#')
continue;
273 if (key ==
"property") {
276 if (!line.
Tokenize(grp, from,
" ")) {
278 Info(
"ReadGroupConfig",
"incomplete line: '%s'", line.
Data());
283 if (!line.
Tokenize(type, from,
" "))
285 if (type ==
"diskquota") {
298 "problems parsing string: wrong or unsupported suffix? %s",
301 }
else if (type ==
"commonuser") {
304 if (!line.
Tokenize(comusr, from,
" "))
309 }
else if (key ==
"dataset") {
312 if (!line.
Tokenize(type, from,
" ")) {
314 Info(
"ReadGroupConfig",
"incomplete line: '%s'", line.
Data());
317 if (type ==
"commonuser") {
320 if (!line.
Tokenize(comusr, from,
" "))
323 }
else if (type ==
"commongroup") {
326 if (!line.
Tokenize(comgrp, from,
" "))
329 }
else if (type ==
"diskquota") {
336 }
else if (on ==
"off") {
341 }
else if (key ==
"averagefilesize") {
345 if (!line.
Tokenize(avgsize, from,
" ")) {
347 Info(
"ReadGroupConfig",
"incomplete line: '%s'", line.
Data());
355 "problems parsing string: wrong or unsupported suffix? %s",
358 }
else if (key ==
"include") {
362 if (!line.
Tokenize(subfn, from,
" ")) {
364 Info(
"ReadGroupConfig",
"incomplete line: '%s'", line.
Data());
369 Error(
"ReadGroupConfig",
"request to parse file '%s' which is not readable",
374 Error(
"ReadGroupConfig",
"problems parsing include file '%s'", subfn.
Data());
393 if (!size || strlen(size) <= 0)
return lsize;
399 const char *unit[5] = {
"k",
"M",
"G",
"T",
"P"};
413 lsize = s.
Atoi() * fact;
502 if (opts && strlen(opts) > 0) {
504 if (strstr(opts,
"allfiles:") || strchr(opts,
'A'))
506 else if (strstr(opts,
"staged:") || strchr(opts,
'D'))
509 if (strstr(opts,
"open:") || strchr(opts,
'O'))
511 if (strstr(opts,
"touch:") || strchr(opts,
'T'))
513 if (strstr(opts,
"nostagedcheck:") || strchr(opts,
'I'))
516 if (strstr(opts,
"noaction:") || strchr(opts,
'N'))
518 if (strstr(opts,
"locateonly:") || strchr(opts,
'L'))
520 if (strstr(opts,
"stageonly:") || strchr(opts,
'S'))
523 if (strstr(opts,
"verbose:") || strchr(opts,
'V'))
555 Info(
"GetQuota",
"processing dataset %s %s %s", group, user, dsName);
592 if (!groupQuotaMap || !userUsedMap)
596 TIter iter(groupQuotaMap);
598 while ((group = dynamic_cast<TObjString*> (iter.
Next()))) {
615 TIter iter2(userMap);
617 while ((user = dynamic_cast<TObjString*> (iter2.
Next()))) {
627 Printf(
"------------------------------------------------------");
631 Printf(
" +++ Quota check enabled but no quota info available +++ ");
641 Info(
"PrintUsedSpace",
"listing used space");
645 while ((group = dynamic_cast<TObjString*> (iter.
Next()))) {
651 if (userMap && size) {
655 TIter iter2(userMap);
657 while ((user = dynamic_cast<TObjString*> (iter2.Next()))) {
665 Printf(
"------------------------------------------------------");
676 Info(
"MonitorUsedSpace",
"sending used space to monitoring server");
680 while ((group = dynamic_cast<TObjString*> (iter.
Next()))) {
685 if (!userMap || !size)
692 if (groupQuota != -1)
695 TIter iter2(userMap);
697 while ((user = dynamic_cast<TObjString*> (iter2.
Next()))) {
706 Warning(
"MonitorUsedSpace",
"problems sending monitoring parameters");
724 Info(
"GetGroupUsed",
"group %s not found", group);
744 Info(
"GetGroupQuota",
"group %s not found", group);
807 const char *dsName,
const char *dsObjPath)
811 if (dsGroup && strlen(dsGroup) > 0) {
812 if (dsUser && strlen(dsUser) > 0) {
813 uri +=
Form(
"/%s/%s/", dsGroup, dsUser);
815 uri +=
Form(
"/%s/*/", dsGroup);
817 }
else if (dsUser && strlen(dsUser) > 0) {
818 uri +=
Form(
"%s/", dsUser);
820 if (dsName && strlen(dsName) > 0)
822 if (dsObjPath && strlen(dsObjPath) > 0)
823 uri +=
Form(
"#%s", dsObjPath);
852 if ((uristr.
Index(
'=') >= 0) && (uristr.
Index(
';') >= 0)) {
858 "Dataset URI looks like a virtual URI, treating it as such. " 859 "No group and user will be parsed!");
865 if (dsGroup) *dsGroup =
"";
866 if (dsUser) *dsUser =
"";
867 if (dsName) *dsName = reVirtualUri[1];
869 if (nm == 4) *dsTree = reVirtualUri[3];
880 if (wildcards && uristr.
Length() > 0) {
885 if (pc == 1) uristr +=
"/*/";
886 if (pc == 2 && endsl) uristr +=
"*/";
887 if (pc == 2 && !endsl) uristr +=
"/";
894 Info (
"ParseUri",
"URI query part <%s> ignored", resolved.
GetQuery().
Data());
898 if ((pc = path.CountChar(
'/')) != 3) {
900 Error (
"ParseUri",
"illegal dataset path: '%s'", uri);
902 }
else if (pc >= 0 && pc < 3) {
907 }
else if (pc == 1) {
909 }
else if (pc == 0) {
916 Info(
"ParseUri",
"path: '%s'", path.Data());
921 if (path.Tokenize(group, from,
"/")) {
922 if (path.Tokenize(user, from,
"/")) {
923 if (!path.Tokenize(name, from,
"/"))
924 if (
gDebug > 0)
Info(
"ParseUri",
"'name' missing");
926 if (
gDebug > 0)
Info(
"ParseUri",
"'user' missing");
929 if (
gDebug > 1)
Info(
"ParseUri",
"'group' missing");
938 Info(
"ParseUri",
"group: '%s', user: '%s', dsname:'%s', seg: '%s'",
942 if ((user ==
"*" || group ==
"*") && !wildcards) {
943 Error (
"ParseUri",
"no wildcards allowed for user/group in this context (uri: '%s')", uri);
948 if (name.
IsNull() && !wildcards) {
949 Error (
"ParseUri",
"DataSet name is empty");
954 TPRegexp wcExp (wildcards ?
"^(?:[A-Za-z0-9-*_.]*|[*])$" :
"^[A-Za-z0-9-_.]*$");
957 if (!wcExp.
Match(group)) {
958 Error(
"ParseUri",
"illegal characters in group (uri: '%s', group: '%s')", uri, group.
Data());
962 if (!wcExp.
Match(user)) {
963 Error(
"ParseUri",
"illegal characters in user (uri: '%s', user: '%s')", uri, user.
Data());
968 if (!wcExp.
Match(name)) {
969 Error(
"ParseUri",
"illegal characters in name (uri: '%s', name: '%s')", uri, name.
Data());
974 Error(
"ParseUri",
"Illegal characters in subdir/object name (uri: '%s', obj: '%s')", uri, tree.
Data());
980 Error(
"ParseUri",
"only datasets from your group/user allowed");
1011 if (!ds || strlen(ds) <= 0) {
1012 Info(
"GetDataSets",
"dataset name undefined!");
1019 Info(
"GetDataSets",
"could not retrieve the dataset '%s'", ds);
1026 Info(
"GetDataSets",
"could not get map for '%s'", ds);
1065 Printf(
"+++ %5d. %s", ++nf, fi->GetCurrentUrl()->GetUrl());
1067 Printf(
"+++ %5d. %s", ++nf, fi->GetCurrentUrl()->GetFile());
1112 while ((o.
Tokenize(srv, from,
","))) {
1133 TString u(uri), grp, usr, dsn;
1135 if (u ==
"" || u ==
"*" || u ==
"/*" || u ==
"/*/" || u ==
"/*/*") u =
"/*/*/";
1137 Warning(
"ShowDataSets",
"problems parsing URI '%s'", uri);
1144 if (!u.IsNull() && !u.Contains(
"*") && !grp.
IsNull() && !usr.IsNull() && !dsn.IsNull()) {
1159 if (u.Index(reg) ==
kNPOS) grp =
"*";
1160 if (u.Index(reu) ==
kNPOS) usr =
"*";
1162 u.
Form(
"/%s/%s/%s", grp.
Data(), usr.Data(), dsn.Data());
1229 Int_t maxfiles,
const char *stageopts)
1232 if (maxfiles > -1 && dbg)
1233 ::Info(
"TDataSetManager::ScanDataSet",
"processing a maximum of %d files", maxfiles);
1249 if (scanlist && !flist) {
1250 ::Error(
"TDataSetManager::ScanDataSet",
"input list is mandatory for option 'scan file list'");
1256 Int_t fdisappeared = 0;
1260 TList *newStagedFiles = 0;
1265 if (doall || getlistonly) {
1268 newStagedFiles = (!doall && getlistonly && flist) ? flist :
new TList;
1281 while ((fileInfo = (
TFileInfo *) iter())) {
1290 stager, createStager, dbg, bchanged_fi, btouched,
1293 if (bchanged_fi) bchanged_ds =
kTRUE;
1294 if (btouched) ftouched++;
1295 if (bdisappeared) fdisappeared++;
1298 if (dbg && (ftouched+fdisappeared) % 100 == 0)
1299 ::
Info(
"TDataSetManager::ScanDataSet",
"opening %d: file: %s",
1303 if (!noaction && newlystaged) newStagedFiles->
Add(fileInfo);
1310 ::
Info(
"TDataSetManager::ScanDataSet",
" %d files appear to be newly staged",
1313 return ((bchanged_ds) ? 2 : 1);
1317 if (!noaction && (doall || scanlist)) {
1320 newStagedFiles = (!doall && scanlist && flist) ? flist : newStagedFiles;
1325 ::
Info(
"TDataSetManager::ScanDataSet",
"opening %d files that appear to be newly staged",
1329 if (locateonly || stageonly) {
1336 if (fqnot > 100) fqnot = 100;
1340 TIter iter(newStagedFiles);
1341 while ((fileInfo = (
TFileInfo *) iter())) {
1343 if (dbg && (count%fqnot == 0))
1344 ::Info(
"TDataSetManager::ScanDataSet",
"processing %d.'new' file: %s",
1353 ProcessFile(fileInfo, sopt, checkstg, doall, stager, createStager,
1354 stageopts, dbg, bchanged_fi, bopened);
1356 bchanged_ds |= bchanged_fi;
1357 if (bopened) fopened++;
1359 if (newStagedFiles != flist)
SafeDelete(newStagedFiles);
1365 Int_t result = (bchanged_ds) ? 2 : 1;
1366 if (result > 0 && dbg)
1367 ::Info(
"TDataSetManager::ScanDataSet",
"%d files 'new'; %d files touched;" 1368 " %d files disappeared", fopened, ftouched, fdisappeared);
1371 if (touched) *touched = ftouched;
1372 if (opened) *opened = fopened;
1373 if (disappeared) *disappeared = fdisappeared;
1423 if (fopt >= 0) fopt %= 100;
1440 ::Error(
"TDataSetManager::CheckStagedStatus",
"GetCurrentUrl() returned 0 for %s",
1451 if (!reopen)
return kFALSE;
1456 const char *furl = curl->
GetUrl();
1459 furl = urlmod.
Data();
1465 uopt +=
"filetype=raw&mxredir=2";
1473 ::
Warning(
"TDataSetManager::CheckStagedStatus",
"problems reading 1 byte from open file");
1481 if (dbg)
::Info(
"TDataSetManager::CheckStagedStatus",
"file %s disappeared", url.
GetUrl());
1483 disappeared =
kTRUE;
1499 if (maxfiles > 0 && newstagedfiles >= maxfiles)
1507 const char *furl = curl->
GetUrl();
1511 furl = urlmod.
Data();
1524 ::Info(
"TDataSetManager::CheckStagedStatus",
"IsStaged: %s: %d", url.
GetUrl(), result);
1528 ::Warning(
"TDataSetManager::CheckStagedStatus",
1529 "could not get stager instance for '%s'", url.
GetUrl());
1578 const char *furl = curl->
GetUrl();
1582 furl = urlmod.
Data();
1590 if (!stager || (stager && !stager->
Matches(url.
GetUrl()))) {
1593 ::Error(
"TDataSetManager::ProcessFile",
1594 "could not get valid stager instance for '%s'", url.
GetUrl());
1602 if (stager && stager->
Locate(url.
GetUrl(), eurl) == 0) {
1615 ::Error(
"TDataSetManager::ProcessFile",
"could not locate %s", url.
GetUrl());
1618 }
else if (stageonly) {
1623 ::Error(
"TDataSetManager::ProcessFile",
1624 "problems issuing stage request for %s", url.
GetUrl());
1627 }
else if (fullproc) {
1640 }
else if (stager) {
1641 ::Warning(
"TDataSetManager::ProcessFile",
1642 "required file '%s' does not look as being online (staged)", url.
GetUrl());
1660 ::Error(
"TDataSetManager::ScanFile",
"undefined input (!)");
1672 if (timeout > 0) fileopt.
Form(
"TIMEOUT=%d", timeout);
1678 const char *furl = url->
GetUrl();
1681 furl = urlmod.
Data();
1685 TUrl urlNoAnchor(furl);
1689 unaopts +=
"&filetype=raw";
1691 unaopts =
"filetype=raw";
1715 if (!strcmp(eurl.
GetHost(),
"localhost") || !strcmp(eurl.
GetHost(),
"127.0.0.1") ||
1716 !strcmp(eurl.
GetHost(),
"localhost.localdomain")) {
1726 ::Warning(
"TDataSetManager::ScanFile",
"end-point URL undefined for file %s", file->
GetName());
1743 if (dbg)
::Info(
"TDataSetManager::ScanFile",
"marking %s as corrupt", url->
GetUrl());
1748 }
else if (!anchor) {
1763 if (!strcmp(eurl.
GetHost(),
"localhost") || !strcmp(eurl.
GetHost(),
"127.0.0.1") ||
1764 !strcmp(eurl.
GetHost(),
"localhost.localdomain")) {
1780 ::Error(
"TDataSetManager::ScanFile",
1781 "problems processing the directory tree in looking for metainfo");
1805 if (!fi || !d || !rdir) {
1806 ::Error(
"TDataSetManager::FillMetaData",
1807 "some inputs are invalid (fi:%p,d:%p,r:%s)", fi, d, rdir);
1814 while ((k = dynamic_cast<TKey *> (nxk()))) {
1820 ::Error(
"TDataSetManager::FillMetaData",
"cannot get sub-directory '%s'", k->GetName());
1824 ::Error(
"TDataSetManager::FillMetaData",
"problems processing sub-directory '%s'", k->GetName());
1833 ks.
Form(
"%s%s", rdir, k->GetName());
1841 ::Info(
"TDataSetManager::FillMetaData",
"created meta data for tree %s", ks.
Data());
1846 if (t->GetEntries() >= 0) {
1848 if (t->GetTotBytes() >= 0)
1850 if (t->GetZipBytes() >= 0)
1854 ::Error(
"TDataSetManager::FillMetaData",
"could not get tree '%s'", k->GetName());
1870 TList *srvmapslist = 0;
1872 ::Warning(
"TDataSetManager::ParseDataSetSrvMaps",
1873 "called with an empty string! - nothing to do");
1877 Int_t from = 0, from1 = 0;
1878 while (srvmaps.
Tokenize(srvmap, from,
" ")) {
1882 if (srvmap.
Tokenize(sf, from1,
"|"))
1883 if (srvmap.
Tokenize(st, from1,
"|")) { }
1888 ::Warning(
"TDataSetManager::ParseDataSetSrvMaps",
1889 "parsing DataSet.SrvMaps: target must be defined" 1890 " (token: %s) - ignoring", srvmap.
Data());
1905 if (!srvmapslist) srvmapslist =
new TList;
1934 if (!furl)
return replaced;
1938 if (mlist && mlist->
GetSize() > 0) {
1941 while ((pr = (
TPair *) nxm())) {
1954 if (re.Index(furl->
GetHost(), &len) == 0) replace =
kTRUE;
static Bool_t CheckDataSetSrvMaps(TUrl *furl, TString &fn, TList *srvmaplist=0)
Check if the dataset server mappings apply to the url defined by 'furl'.
virtual Bool_t IsStaged(const char *)
Just check if the file exists locally.
virtual const char * GetName() const
Returns name of object.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual TList * GetListOfKeys() const
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual Int_t ClearCache(const char *uri)
Clear cached information matching uri.
void SetUUID(const char *uuid)
Set the UUID to the value associated to the string 'uuid'.
R__EXTERN Int_t gErrorIgnoreLevel
static TList * fgDataSetSrvMaps
void SetProtocol(const char *proto, Bool_t setDefaultPort=kFALSE)
Set protocol and, optionally, change the port accordingly.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
virtual void ParseInitOpts(const char *opts)
Parse the opts string and set the init bits accordingly Available options: Cq: set kCheckQuota Ar: se...
Collectable string class.
Long64_t GetTotalSize() const
This class represents a WWW compatible URL.
TString & ReplaceAll(const TString &s1, const TString &s2)
Bool_t RemoveUrl(const char *url)
Remove an URL. Returns kTRUE if successful, kFALSE otherwise.
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.
TUrl * GetCurrentUrl() const
Return the current url.
const char * GetProtocol() const
std::istream & ReadLine(std::istream &str, Bool_t skipWhite=kTRUE)
Read a line from stream upto newline skipping any whitespace.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Bool_t RemoveDataSet(const char *uri)
Removes the indicated dataset.
void SetUrl(const char *url, Bool_t defaultIsFile=kFALSE)
Parse url character string and split in its different subcomponents.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
virtual Int_t GetEntries() const
virtual Bool_t ReadBuffer(char *buf, Int_t len)
Read a buffer from the file.
virtual TFileCollection * GetDataSet(const char *uri, const char *server=0)
Utility function used in various methods for user dataset upload.
Regular expression class.
const char * GetFileAndOptions() const
Return the file and its options (the string specified behind the ?).
void Add(TObject *obj)
This function may not be used (but we need to provide it since it is a pure virtual in TCollection)...
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
void SetScanCounters(Int_t t=-1, Int_t o=-1, Int_t d=-1)
Update scan counters.
virtual ~TDataSetManager()
Destructor.
void SetVal(const AParamType &val)
static Long64_t ToBytes(const char *size=0)
Static utility function to gt the number of bytes from a string representation in the form "<digit><s...
const char * GetOptions() const
virtual void ShowDataSets(const char *uri="*", const char *opt="")
Prints formatted information about the dataset 'uri'.
This class represents a RFC 3986 compatible URI.
static TString CreateUri(const char *dsGroup=0, const char *dsUser=0, const char *dsName=0, const char *dsTree=0)
Creates URI for the dataset manger in the form '[[/dsGroup/]dsUser/]dsName[#dsObjPath]', The optional dsObjPath can be in the form [subdir/]objname]'.
virtual TMap * GetGroupQuotaMap()
Bool_t AddUrl(const char *url, Bool_t infront=kFALSE)
Add a new URL.
static void ProcessFile(TFileInfo *fileInfo, Int_t sopt, Bool_t checkstg, Bool_t doall, TFileStager *stager, Bool_t createStager, const char *stageopts, Bool_t dbg, Bool_t &changed, Bool_t &opened)
Locate, stage, or fully validate file "fileInfo".
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
const TString GetPath() const
virtual void MonitorUsedSpace(TVirtualMonitoringWriter *monitoring)
Log info to the monitoring server.
static struct mg_connection * fc(struct mg_context *ctx)
const char * GetHost() const
Int_t Update(Long64_t avgsize=-1)
Update accumulated information about the elements of the collection (e.g.
Bool_t SetUri(const TString &uri)
Parse URI and set the member variables accordingly, returns kTRUE if URI validates, and kFALSE otherwise: URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] hier-part = "//" authority path-abempty / path-absolute / path-rootless / path-empty.
TDataSetManager(const TDataSetManager &)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
Bool_t AddMetaData(TObject *meta)
Add's a meta data object to the file info object.
virtual void ShowQuota(const char *opt)
Display quota information.
TUrl * GetFirstUrl() const
void SetSize(Long64_t size)
virtual Int_t RegisterDataSet(const char *uri, TFileCollection *dataSet, const char *opt)
Register a dataset, perfoming quota checkings, if needed.
void DeleteAll()
Remove all (key,value) pairs from the map AND delete the keys AND values when they are allocated on t...
virtual Long64_t GetGroupQuota(const char *group)
returns the quota a group is allowed to have
static TList * GetDataSetSrvMaps()
Static getter for server mapping list.
virtual const char * Getenv(const char *env)
Get environment variable.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
const char * GetAnchor() const
Book space in a file, create I/O buffers, to fill them, (un)compress them.
const TString GetFragment() const
static Bool_t CheckStagedStatus(TFileInfo *fileInfo, Int_t fopt, Int_t maxfiles, Int_t newstagedfiles, TFileStager *stager, Bool_t createStager, Bool_t dbg, Bool_t &changed, Bool_t &touched, Bool_t &disappeared)
Check stage status of the file described by "fileInfo".
TFileInfoMeta * GetMetaData(const char *meta=0) const
Get meta data object with specified name.
const char * GetName() const
Returns name of object.
void PrintUsedSpace()
Prints the quota.
virtual void UpdateUsedSpace()
updates the used space maps
const TString & GetString() const
virtual TMap * GetSubDataSets(const char *uri, const char *excludeservers)
Partition dataset 'ds' accordingly to the servers.
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()...
static Int_t FillMetaData(TFileInfo *fi, TDirectory *d, const char *rdir="/")
Navigate the directory 'd' (and its subdirectories) looking for TTree objects.
R__EXTERN TSystem * gSystem
Int_t RemoveDuplicates()
Remove duplicates based on the UUID, typically after a verification.
Bool_t ReadGroupConfig(const char *cf=0)
Read group config file 'cf'.
virtual TMap * GetUserUsedMap()
virtual Bool_t ExistsDataSet(const char *uri)
Checks if the indicated dataset exits.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Bool_t ParseUri(const char *uri, TString *dsGroup=0, TString *dsUser=0, TString *dsName=0, TString *dsTree=0, Bool_t onlyCurrent=kFALSE, Bool_t wildcards=kFALSE)
Parses a (relative) URI that describes a DataSet on the cluster.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
virtual Int_t ShowCache(const char *uri)
Show cached information matching uri.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Int_t ScanDataSet(const char *uri, const char *opt)
Scans the dataset indicated by 'uri' following the 'opts' directives.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
char * Form(const char *fmt,...)
virtual Bool_t SendParameters(TList *, const char *=0)
static TUri Transform(const TUri &reference, const TUri &base)
Transform a URI reference into its target URI using given a base URI.
static constexpr double nm
static Int_t ScanFile(TFileInfo *fileinfo, Bool_t notify)
Open the file described by 'fileinfo' to extract the relevant meta-information.
void GetQuota(const char *group, const char *user, const char *dsName, TFileCollection *dataset)
Gets quota information from this dataset.
virtual Bool_t Stage(const char *, Option_t *=0)
void SetHost(const char *host)
TString & Remove(Ssiz_t pos)
Class used by TMap to store (key,value) pairs.
void SetAnchor(const char *anchor)
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
static TString fgCommonDataSetTag
virtual const char * HostName()
Return the system's host name.
Describe directory structure in memory.
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
virtual Long64_t GetSize() const
Returns the current file size.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
static constexpr double s
static TFileStager * Open(const char *stager)
Open a stager, after having loaded the relevant plug-in.
virtual void DispatchOneEvent(Bool_t pendingOnly=kFALSE)
Dispatch a single event.
virtual Int_t NotifyUpdate(const char *group=0, const char *user=0, const char *dspath=0, Long_t mtime=0, const char *checksum=0)
Save into the <datasetdir>/dataset.list file the name of the last updated or created or modified data...
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
const char * AsString() const
Return UUID as string. Copy string immediately since it will be reused.
Int_t Match(const TString &s, UInt_t start=0)
Runs a match on s against the regex 'this' was created with.
Mother of all ROOT objects.
virtual const TUrl * GetEndpointUrl() const
virtual void Add(TObject *obj)
Wrapper for PCRE library (Perl Compatible Regular Expressions).
Class that contains a list of TFileInfo's and accumulated meta data information about its entries...
void PrintDataSet(TFileCollection *fc, Int_t popt=0)
Formatted printout of the content of TFileCollection 'fc'.
void SetOptions(const char *opt)
static TList * ParseDataSetSrvMaps(const TString &srvmaps)
Create a server mapping list from the content of 'srvmaps' Return the list (owned by the caller) or 0...
Int_t CountChar(Int_t c) const
Return number of times character c occurs in the string.
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
Int_t Atoi() const
Return integer value of string.
virtual Bool_t Matches(const char *s)
static constexpr double pc
Bool_t IsDigit() const
Returns true if all characters in string are digits (0-9) or white spaces, i.e.
A TTree object has a header with a name and a title.
const AParamType & GetVal() const
Class describing a generic file including meta information.
const TString GetQuery() const
virtual Bool_t IsValid() const
virtual Int_t Locate(const char *u, TString &f)
Just check if the file exists locally.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Int_t Match(const TString &s, const TString &mods="", Int_t start=0, Int_t nMaxMatch=10, TArrayI *pos=0)
The number of matches is returned, this equals the full match + sub-pattern matches.
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...
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
virtual Long64_t GetGroupUsed(const char *group)
Returns the used space of that group.
virtual TMap * GetDataSets(const char *uri, UInt_t=TDataSetManager::kExport)
Returns all datasets for the <group> and <user> specified by <uri>.
void AbstractMethod(const char *method) const
Use this method to implement an "abstract" method that you don't want to leave purely abstract...
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual const char * GetTitle() const
Returns title of object.
virtual void Close(Option_t *option="")
Close a file.
const char * Data() const