46#define DSM_ONE_GB (1073741824)
61 fUser(user), fCommonUser(), fCommonGroup(),
62 fGroupQuota(), fGroupUsed(),
63 fUserUsed(), fNTouchedFiles(0), fNOpenedFiles(0),
64 fNDisappearedFiles(0), fMTimeGroupConfig(-1)
108 if (!(srvmapsenv.
IsNull())) {
110 if (!(srvmaps.
IsNull())) srvmaps +=
",";
111 srvmaps += srvmapsenv(1,srvmapsenv.
Length());
113 srvmaps = srvmapsenv;
117 Warning(
"TDataSetManager",
"problems parsing DataSet.SrvMaps input info (%s)"
118 " - ignoring", srvmaps.
Data());
160 if (opts && strlen(opts) > 0) {
214 Info(
"ReadGroupConfig",
"path to config file undefined - nothing to do");
224 Info(
"ReadGroupConfig",
"file has not changed - do nothing");
230 if (cf && (strlen(cf) > 0)) {
233 Error(
"ReadGroupConfig",
"could not stat %s", cf);
237 Error(
"ReadGroupConfig",
"cannot read %s", cf);
246 Info(
"ReadGroupConfig",
"reading group config from %s", cf);
252 Error(
"ReadGroupConfig",
"could not open config file %s", cf);
265 if (
line[0] ==
'#')
continue;
269 if (!
line.Tokenize(key, from,
" "))
272 if (key ==
"property") {
275 if (!
line.Tokenize(grp, from,
" ")) {
277 Info(
"ReadGroupConfig",
"incomplete line: '%s'",
line.Data());
282 if (!
line.Tokenize(
type, from,
" "))
284 if (
type ==
"diskquota") {
287 if (!
line.Tokenize(sdq, from,
" "))
297 "problems parsing string: wrong or unsupported suffix? %s",
300 }
else if (
type ==
"commonuser") {
303 if (!
line.Tokenize(comusr, from,
" "))
308 }
else if (key ==
"dataset") {
311 if (!
line.Tokenize(
type, from,
" ")) {
313 Info(
"ReadGroupConfig",
"incomplete line: '%s'",
line.Data());
316 if (
type ==
"commonuser") {
319 if (!
line.Tokenize(comusr, from,
" "))
322 }
else if (
type ==
"commongroup") {
325 if (!
line.Tokenize(comgrp, from,
" "))
328 }
else if (
type ==
"diskquota") {
331 if (!
line.Tokenize(
on, from,
" "))
335 }
else if (
on ==
"off") {
340 }
else if (key ==
"averagefilesize") {
344 if (!
line.Tokenize(avgsize, from,
" ")) {
346 Info(
"ReadGroupConfig",
"incomplete line: '%s'",
line.Data());
354 "problems parsing string: wrong or unsupported suffix? %s",
357 }
else if (key ==
"include") {
361 if (!
line.Tokenize(subfn, from,
" ")) {
363 Info(
"ReadGroupConfig",
"incomplete line: '%s'",
line.Data());
368 Error(
"ReadGroupConfig",
"request to parse file '%s' which is not readable",
373 Error(
"ReadGroupConfig",
"problems parsing include file '%s'", subfn.
Data());
392 if (!
size || strlen(
size) <= 0)
return lsize;
398 const char *unit[5] = {
"k",
"M",
"G",
"T",
"P"};
412 lsize = s.
Atoi() * fact;
501 if (opts && strlen(opts) > 0) {
503 if (strstr(opts,
"allfiles:") || strchr(opts,
'A'))
505 else if (strstr(opts,
"staged:") || strchr(opts,
'D'))
508 if (strstr(opts,
"open:") || strchr(opts,
'O'))
510 if (strstr(opts,
"touch:") || strchr(opts,
'T'))
512 if (strstr(opts,
"nostagedcheck:") || strchr(opts,
'I'))
515 if (strstr(opts,
"noaction:") || strchr(opts,
'N'))
517 if (strstr(opts,
"locateonly:") || strchr(opts,
'L'))
519 if (strstr(opts,
"stageonly:") || strchr(opts,
'S'))
522 if (strstr(opts,
"verbose:") || strchr(opts,
'V'))
554 Info(
"GetQuota",
"processing dataset %s %s %s",
group, user, dsName);
591 if (!groupQuotaMap || !userUsedMap)
595 TIter iter(groupQuotaMap);
602 Printf(
" +++ Group %s uses %.1f GB out of %.1f GB",
group->String().Data(),
614 TIter iter2(userMap);
626 Printf(
"------------------------------------------------------");
630 Printf(
" +++ Quota check enabled but no quota info available +++ ");
640 Info(
"PrintUsedSpace",
"listing used space");
650 if (userMap &&
size) {
651 Printf(
"Group %s: %lld B = %.2f GB",
group->String().Data(),
size->GetVal(),
654 TIter iter2(userMap);
664 Printf(
"------------------------------------------------------");
675 Info(
"MonitorUsedSpace",
"sending used space to monitoring server");
684 if (!userMap || !
size)
691 if (groupQuota != -1)
694 TIter iter2(userMap);
705 Warning(
"MonitorUsedSpace",
"problems sending monitoring parameters");
723 Info(
"GetGroupUsed",
"group %s not found",
group);
727 return size->GetVal();
743 Info(
"GetGroupQuota",
"group %s not found",
group);
746 return value->GetVal();
806 const char *dsName,
const char *dsObjPath)
810 if (dsGroup && strlen(dsGroup) > 0) {
811 if (dsUser && strlen(dsUser) > 0) {
812 uri +=
Form(
"/%s/%s/", dsGroup, dsUser);
814 uri +=
Form(
"/%s/*/", dsGroup);
816 }
else if (dsUser && strlen(dsUser) > 0) {
817 uri +=
Form(
"%s/", dsUser);
819 if (dsName && strlen(dsName) > 0)
821 if (dsObjPath && strlen(dsObjPath) > 0)
822 uri +=
Form(
"#%s", dsObjPath);
851 if ((uristr.
Index(
'=') >= 0) && (uristr.
Index(
';') >= 0)) {
857 "Dataset URI looks like a virtual URI, treating it as such. "
858 "No group and user will be parsed!");
864 if (dsGroup) *dsGroup =
"";
865 if (dsUser) *dsUser =
"";
866 if (dsName) *dsName = reVirtualUri[1];
868 if (nm == 4) *dsTree = reVirtualUri[3];
879 if (wildcards && uristr.
Length() > 0) {
884 if (pc == 1) uristr +=
"/*/";
885 if (pc == 2 && endsl) uristr +=
"*/";
886 if (pc == 2 && !endsl) uristr +=
"/";
893 Info (
"ParseUri",
"URI query part <%s> ignored", resolved.
GetQuery().
Data());
899 Error (
"ParseUri",
"illegal dataset path: '%s'", uri);
901 }
else if (pc >= 0 && pc < 3) {
906 }
else if (pc == 1) {
908 }
else if (pc == 0) {
915 Info(
"ParseUri",
"path: '%s'", path.
Data());
921 if (path.
Tokenize(user, from,
"/")) {
923 if (
gDebug > 0)
Info(
"ParseUri",
"'name' missing");
925 if (
gDebug > 0)
Info(
"ParseUri",
"'user' missing");
928 if (
gDebug > 1)
Info(
"ParseUri",
"'group' missing");
933 if (
tree.EndsWith(
"/"))
937 Info(
"ParseUri",
"group: '%s', user: '%s', dsname:'%s', seg: '%s'",
941 if ((user ==
"*" ||
group ==
"*") && !wildcards) {
942 Error (
"ParseUri",
"no wildcards allowed for user/group in this context (uri: '%s')", uri);
947 if (
name.IsNull() && !wildcards) {
948 Error (
"ParseUri",
"DataSet name is empty");
953 TPRegexp wcExp (wildcards ?
"^(?:[A-Za-z0-9-*_.]*|[*])$" :
"^[A-Za-z0-9-_.]*$");
957 Error(
"ParseUri",
"illegal characters in group (uri: '%s', group: '%s')", uri,
group.Data());
961 if (!wcExp.
Match(user)) {
962 Error(
"ParseUri",
"illegal characters in user (uri: '%s', user: '%s')", uri, user.
Data());
968 Error(
"ParseUri",
"illegal characters in name (uri: '%s', name: '%s')", uri,
name.Data());
973 Error(
"ParseUri",
"Illegal characters in subdir/object name (uri: '%s', obj: '%s')", uri,
tree.Data());
979 Error(
"ParseUri",
"only datasets from your group/user allowed");
1010 if (!ds || strlen(ds) <= 0) {
1011 Info(
"GetDataSets",
"dataset name undefined!");
1018 Info(
"GetDataSets",
"could not retrieve the dataset '%s'", ds);
1025 Info(
"GetDataSets",
"could not get map for '%s'", ds);
1111 while ((o.
Tokenize(srv, from,
","))) {
1132 TString u(uri), grp, usr, dsn;
1134 if (u ==
"" || u ==
"*" || u ==
"/*" || u ==
"/*/" || u ==
"/*/*") u =
"/*/*/";
1136 Warning(
"ShowDataSets",
"problems parsing URI '%s'", uri);
1143 if (!u.IsNull() && !u.Contains(
"*") && !grp.
IsNull() && !usr.
IsNull() && !dsn.
IsNull()) {
1158 if (u.Index(
reg) ==
kNPOS) grp =
"*";
1159 if (u.Index(reu) ==
kNPOS) usr =
"*";
1228 Int_t maxfiles,
const char *stageopts)
1231 if (maxfiles > -1 && dbg)
1232 ::Info(
"TDataSetManager::ScanDataSet",
"processing a maximum of %d files", maxfiles);
1248 if (scanlist && !flist) {
1249 ::Error(
"TDataSetManager::ScanDataSet",
"input list is mandatory for option 'scan file list'");
1255 Int_t fdisappeared = 0;
1259 TList *newStagedFiles = 0;
1264 if (doall || getlistonly) {
1267 newStagedFiles = (!doall && getlistonly && flist) ? flist :
new TList;
1280 while ((fileInfo = (
TFileInfo *) iter())) {
1289 stager, createStager, dbg, bchanged_fi, btouched,
1292 if (bchanged_fi) bchanged_ds =
kTRUE;
1293 if (btouched) ftouched++;
1294 if (bdisappeared) fdisappeared++;
1297 if (dbg && (ftouched+fdisappeared) % 100 == 0)
1298 ::Info(
"TDataSetManager::ScanDataSet",
"opening %d: file: %s",
1302 if (!noaction && newlystaged) newStagedFiles->
Add(fileInfo);
1309 ::Info(
"TDataSetManager::ScanDataSet",
" %d files appear to be newly staged",
1312 return ((bchanged_ds) ? 2 : 1);
1316 if (!noaction && (doall || scanlist)) {
1319 newStagedFiles = (!doall && scanlist && flist) ? flist : newStagedFiles;
1324 ::Info(
"TDataSetManager::ScanDataSet",
"opening %d files that appear to be newly staged",
1328 if (locateonly || stageonly) {
1335 if (fqnot > 100) fqnot = 100;
1339 TIter iter(newStagedFiles);
1340 while ((fileInfo = (
TFileInfo *) iter())) {
1342 if (dbg && (count%fqnot == 0))
1343 ::Info(
"TDataSetManager::ScanDataSet",
"processing %d.'new' file: %s",
1352 ProcessFile(fileInfo, sopt, checkstg, doall, stager, createStager,
1353 stageopts, dbg, bchanged_fi, bopened);
1355 bchanged_ds |= bchanged_fi;
1356 if (bopened) fopened++;
1358 if (newStagedFiles != flist)
SafeDelete(newStagedFiles);
1366 ::Info(
"TDataSetManager::ScanDataSet",
"%d files 'new'; %d files touched;"
1367 " %d files disappeared", fopened, ftouched, fdisappeared);
1370 if (touched) *touched = ftouched;
1371 if (opened) *opened = fopened;
1372 if (disappeared) *disappeared = fdisappeared;
1422 if (fopt >= 0) fopt %= 100;
1439 ::Error(
"TDataSetManager::CheckStagedStatus",
"GetCurrentUrl() returned 0 for %s",
1450 if (!reopen)
return kFALSE;
1455 const char *furl = curl->
GetUrl();
1458 furl = urlmod.
Data();
1464 uopt +=
"filetype=raw&mxredir=2";
1471 if (
file->ReadBuffer(&tmpChar, 1))
1472 ::Warning(
"TDataSetManager::CheckStagedStatus",
"problems reading 1 byte from open file");
1480 if (dbg)
::Info(
"TDataSetManager::CheckStagedStatus",
"file %s disappeared", url.
GetUrl());
1482 disappeared =
kTRUE;
1498 if (maxfiles > 0 && newstagedfiles >= maxfiles)
1506 const char *furl = curl->
GetUrl();
1510 furl = urlmod.
Data();
1523 ::Info(
"TDataSetManager::CheckStagedStatus",
"IsStaged: %s: %d", url.
GetUrl(),
result);
1527 ::Warning(
"TDataSetManager::CheckStagedStatus",
1528 "could not get stager instance for '%s'", url.
GetUrl());
1577 const char *furl = curl->
GetUrl();
1581 furl = urlmod.
Data();
1589 if (!stager || (stager && !stager->
Matches(url.
GetUrl()))) {
1592 ::Error(
"TDataSetManager::ProcessFile",
1593 "could not get valid stager instance for '%s'", url.
GetUrl());
1601 if (stager && stager->
Locate(url.
GetUrl(), eurl) == 0) {
1614 ::Error(
"TDataSetManager::ProcessFile",
"could not locate %s", url.
GetUrl());
1617 }
else if (stageonly) {
1622 ::Error(
"TDataSetManager::ProcessFile",
1623 "problems issuing stage request for %s", url.
GetUrl());
1626 }
else if (fullproc) {
1639 }
else if (stager) {
1640 ::Warning(
"TDataSetManager::ProcessFile",
1641 "required file '%s' does not look as being online (staged)", url.
GetUrl());
1659 ::Error(
"TDataSetManager::ScanFile",
"undefined input (!)");
1671 if (timeout > 0) fileopt.
Form(
"TIMEOUT=%d", timeout);
1677 const char *furl = url->
GetUrl();
1680 furl = urlmod.
Data();
1684 TUrl urlNoAnchor(furl);
1688 unaopts +=
"&filetype=raw";
1690 unaopts =
"filetype=raw";
1703 if (
file->GetEndpointUrl()) {
1705 TUrl eurl(*(
file->GetEndpointUrl()));
1714 if (!strcmp(eurl.
GetHost(),
"localhost") || !strcmp(eurl.
GetHost(),
"127.0.0.1") ||
1715 !strcmp(eurl.
GetHost(),
"localhost.localdomain")) {
1725 ::Warning(
"TDataSetManager::ScanFile",
"end-point URL undefined for file %s",
file->GetName());
1742 if (dbg)
::Info(
"TDataSetManager::ScanFile",
"marking %s as corrupt", url->
GetUrl());
1747 }
else if (!anchor) {
1753 TUrl eurl(*(
file->GetEndpointUrl()));
1762 if (!strcmp(eurl.
GetHost(),
"localhost") || !strcmp(eurl.
GetHost(),
"127.0.0.1") ||
1763 !strcmp(eurl.
GetHost(),
"localhost.localdomain")) {
1779 ::Error(
"TDataSetManager::ScanFile",
1780 "problems processing the directory tree in looking for metainfo");
1804 if (!fi || !
d || !rdir) {
1805 ::Error(
"TDataSetManager::FillMetaData",
1806 "some inputs are invalid (fi:%p,d:%p,r:%s)", fi,
d, rdir);
1810 if (
d->GetListOfKeys()) {
1811 TIter nxk(
d->GetListOfKeys());
1813 while ((k =
dynamic_cast<TKey *
> (nxk()))) {
1819 ::Error(
"TDataSetManager::FillMetaData",
"cannot get sub-directory '%s'", k->
GetName());
1823 ::Error(
"TDataSetManager::FillMetaData",
"problems processing sub-directory '%s'", k->
GetName());
1840 ::Info(
"TDataSetManager::FillMetaData",
"created meta data for tree %s", ks.
Data());
1853 ::Error(
"TDataSetManager::FillMetaData",
"could not get tree '%s'", k->
GetName());
1869 TList *srvmapslist = 0;
1871 ::Warning(
"TDataSetManager::ParseDataSetSrvMaps",
1872 "called with an empty string! - nothing to do");
1876 Int_t from = 0, from1 = 0;
1877 while (srvmaps.
Tokenize(srvmap, from,
" ")) {
1881 if (srvmap.
Tokenize(sf, from1,
"|"))
1882 if (srvmap.
Tokenize(st, from1,
"|")) { }
1887 ::Warning(
"TDataSetManager::ParseDataSetSrvMaps",
1888 "parsing DataSet.SrvMaps: target must be defined"
1889 " (token: %s) - ignoring", srvmap.
Data());
1904 if (!srvmapslist) srvmapslist =
new TList;
1933 if (!furl)
return replaced;
1937 if (mlist && mlist->
GetSize() > 0) {
1940 while ((pr = (
TPair *) nxm())) {
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void on
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void reg
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
R__EXTERN TSystem * gSystem
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
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.
virtual Int_t GetEntries() const
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
static TString fgCommonDataSetTag
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".
virtual TFileCollection * GetDataSet(const char *uri, const char *server=0)
Utility function used in various methods for user dataset upload.
virtual Long64_t GetGroupUsed(const char *group)
Returns the used space of that group.
Int_t ScanDataSet(const char *uri, const char *opt)
Scans the dataset indicated by 'uri' following the 'opts' directives.
Bool_t ReadGroupConfig(const char *cf=0)
Read group config file 'cf'.
static TList * GetDataSetSrvMaps()
Static getter for server mapping list.
virtual void UpdateUsedSpace()
updates the used space maps
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".
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...
static Int_t ScanFile(TFileInfo *fileinfo, Bool_t notify)
Open the file described by 'fileinfo' to extract the relevant meta-information.
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]',...
static Int_t FillMetaData(TFileInfo *fi, TDirectory *d, const char *rdir="/")
Navigate the directory 'd' (and its subdirectories) looking for TTree objects.
void PrintUsedSpace()
Prints the quota.
static Bool_t CheckDataSetSrvMaps(TUrl *furl, TString &fn, TList *srvmaplist=0)
Check if the dataset server mappings apply to the url defined by 'furl'.
void GetQuota(const char *group, const char *user, const char *dsName, TFileCollection *dataset)
Gets quota information from this dataset.
void PrintDataSet(TFileCollection *fc, Int_t popt=0)
Formatted printout of the content of TFileCollection 'fc'.
virtual TMap * GetDataSets(const char *uri, UInt_t=TDataSetManager::kExport)
Returns all datasets for the <group> and <user> specified by <uri>.
void SetScanCounters(Int_t t=-1, Int_t o=-1, Int_t d=-1)
Update scan counters.
virtual Bool_t ExistsDataSet(const char *uri)
Checks if the indicated dataset exits.
virtual TMap * GetGroupQuotaMap()
virtual void ShowDataSets(const char *uri="*", const char *opt="")
Prints formatted information about the dataset 'uri'.
virtual TMap * GetUserUsedMap()
virtual void ShowQuota(const char *opt)
Display quota information.
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...
virtual Bool_t RemoveDataSet(const char *uri)
Removes the indicated dataset.
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.
static TList * fgDataSetSrvMaps
virtual Long64_t GetGroupQuota(const char *group)
returns the quota a group is allowed to have
virtual Int_t ClearCache(const char *uri)
Clear cached information matching uri.
virtual void ParseInitOpts(const char *opts)
Parse the opts string and set the init bits accordingly Available options: Cq: set kCheckQuota Ar: se...
virtual TMap * GetSubDataSets(const char *uri, const char *excludeservers)
Partition dataset 'ds' accordingly to the servers.
TDataSetManager(const TDataSetManager &)
virtual void MonitorUsedSpace(TVirtualMonitoringWriter *monitoring)
Log info to the monitoring server.
virtual Int_t RegisterDataSet(const char *uri, TFileCollection *dataSet, const char *opt)
Register a dataset, perfoming quota checkings, if needed.
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>`...
virtual ~TDataSetManager()
Destructor.
virtual Int_t ShowCache(const char *uri)
Show cached information matching uri.
Describe directory structure in memory.
virtual TObject * Get(const char *namecycle)
Return pointer to object identified by namecycle.
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
Class that contains a list of TFileInfo's and accumulated meta data information about its entries.
TMap * GetFilesPerServer(const char *exclude=nullptr, Bool_t curronly=kFALSE)
Return a map of TFileCollections with the files on each data server, excluding servers in the comma-s...
TObjString * ExportInfo(const char *name=nullptr, Int_t popt=0)
Export the relevant info as a string; use 'name' as collection name, if defined, else use GetName().
Int_t RemoveDuplicates()
Remove duplicates based on the UUID, typically after a verification.
Int_t Update(Long64_t avgsize=-1)
Update accumulated information about the elements of the collection (e.g.
Long64_t GetTotalSize() const
Class describing a generic file including meta information.
Bool_t AddUrl(const char *url, Bool_t infront=kFALSE)
Add a new URL.
Bool_t AddMetaData(TObject *meta)
Add's a meta data object to the file info object.
Bool_t RemoveUrl(const char *url)
Remove an URL. Returns kTRUE if successful, kFALSE otherwise.
TUrl * GetFirstUrl() const
TFileInfoMeta * GetMetaData(const char *meta=nullptr) const
Get meta data object with specified name.
TUrl * GetCurrentUrl() const
Return the current url.
void SetUUID(const char *uuid)
Set the UUID to the value associated to the string 'uuid'.
void SetSize(Long64_t size)
virtual Bool_t Matches(const char *s)
virtual Bool_t IsValid() const
virtual Bool_t IsStaged(const char *)
Just check if the file exists locally.
static TFileStager * Open(const char *stager)
Open a stager, after having loaded the relevant plug-in.
virtual Int_t Locate(const char *u, TString &f)
Just check if the file exists locally.
virtual Bool_t Stage(const char *, Option_t *=nullptr)
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
Book space in a file, create I/O buffers, to fill them, (un)compress them.
virtual const char * GetClassName() const
void Add(TObject *obj) override
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
void DeleteAll()
Remove all (key,value) pairs from the map AND delete the keys AND values when they are allocated on t...
void Add(TObject *obj) override
This function may not be used (but we need to provide it since it is a pure virtual in TCollection).
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
const char * GetName() const override
Returns name of object.
const char * GetTitle() const override
Returns title of object.
Collectable string class.
const TString & GetString() const
const char * GetName() const override
Returns name of object.
Mother of all ROOT objects.
void AbstractMethod(const char *method) const
Use this method to implement an "abstract" method that you don't want to leave purely abstract.
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Wrapper for PCRE library (Perl Compatible Regular Expressions).
Int_t Match(const TString &s, UInt_t start=0)
Runs a match on s against the regex 'this' was created with.
Int_t Match(const TString &s, const TString &mods="", Int_t start=0, Int_t nMaxMatch=10, TArrayI *pos=nullptr)
The number of matches is returned, this equals the full match + sub-pattern matches.
Class used by TMap to store (key,value) pairs.
Named parameter, streamable and storable.
const AParamType & GetVal() const
Regular expression class.
Ssiz_t Index(const TString &str, Ssiz_t *len, Ssiz_t start=0) const
Find the first occurrence of the regexp in string and return the position, or -1 if there is no match...
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
Compare a string to char *cs2.
TString & Insert(Ssiz_t pos, const char *s)
Int_t Atoi() const
Return integer value of string.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
const char * Data() const
Bool_t IsDigit() const
Returns true if all characters in string are digits (0-9) or white spaces, i.e.
TString & ReplaceAll(const TString &s1, const TString &s2)
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
Int_t CountChar(Int_t c) const
Return number of times character c occurs in the string.
TString & Remove(Ssiz_t pos)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
virtual const char * Getenv(const char *env)
Get environment variable.
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.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual void DispatchOneEvent(Bool_t pendingOnly=kFALSE)
Dispatch a single event.
virtual const char * HostName()
Return the system's host name.
virtual UserGroup_t * GetUserInfo(Int_t uid)
Returns all user info in the UserGroup_t structure.
A TTree represents a columnar dataset.
virtual Long64_t GetEntries() const
virtual Long64_t GetZipBytes() const
virtual Long64_t GetTotBytes() const
This class represents a RFC 3986 compatible URI.
const TString GetPath() const
const TString GetFragment() const
const TString GetQuery() const
static TUri Transform(const TUri &reference, const TUri &base)
Transform a URI reference into its target URI using given a base URI.
Bool_t SetUri(const TString &uri)
Parse URI and set the member variables accordingly, returns kTRUE if URI validates,...
This class represents a WWW compatible URL.
const char * GetAnchor() const
const char * GetUrl(Bool_t withDeflt=kFALSE) const
Return full URL.
void SetAnchor(const char *anchor)
const char * GetFileAndOptions() const
Return the file and its options (the string specified behind the ?).
const char * GetFile() const
void SetUrl(const char *url, Bool_t defaultIsFile=kFALSE)
Parse url character string and split in its different subcomponents.
void SetProtocol(const char *proto, Bool_t setDefaultPort=kFALSE)
Set protocol and, optionally, change the port accordingly.
const char * GetHost() const
void SetOptions(const char *opt)
const char * GetHostFQDN() const
Return fully qualified domain name of url host.
const char * GetOptions() const
void SetHost(const char *host)
const char * GetProtocol() const
virtual Bool_t SendParameters(TList *, const char *=nullptr)