66 const char *user,
const char *
ins)
114 "could not attach to a valid the dataset dir; paths tried:");
139 "problems setting perms of dataset directory %s (#%d)",
171 if (
f && !(
f->IsZombie())) {
177 if (
f->ReadBuffer(buf,
len)) {
189 lockloc.ReplaceAll(
"?filetype=raw",
"");
190 Warning(
"Init",
"could not open remore file '%s' with the lock location",
lockloc.Data());
201 if (!
strcmp(
lu.GetProtocol(),
"file")) {
205 srv.Remove(
srv.Index(
u.GetFile()));
259 "non-default local cache directory '%s' could not be created"
267 "non-default local cache directory '%s' is not writable"
268 " - switching to default",
277 uds.ReplaceAll(
"/",
"%");
278 uds.ReplaceAll(
":",
"%");
290 "local cache directory '%s' could not be created"
297 "local cache directory '%s' is not writable - disabling cache",
328 while (s.Tokenize(
tok,
from,
" ")) {
329 if (
tok.BeginsWith(
"dir:"))
331 if (
tok.BeginsWith(
"mss:"))
333 if (
tok ==
"perms:open")
390 Warning(
"NotifyUpdate",
"problems (re-)creating the dataset lists for '/%s/%s'",
412 mac.GetListOfLines()->Remove(os);
420 Warning(
"NotifyUpdate",
"entry for removed dataset '%s' not found!",
dspath.Data());
432 mac.GetListOfLines()->Remove(os);
449 "can't set permissions of dataset list file %s (#%d)",
487 Error(
"CreateLsFile",
"problems redirecting output to %s (errno: %d)",
497 Error(
"CreateLsFile",
"problems restoring output to standard streams (errno: %d)",
508 Error(
"CreateLsFile",
"problems unlinking old file '%s' (errno: %d)",
516 Error(
"CreateLsFile",
"problems renaming '%s' to '%s' (errno: %d)",
525 Warning(
"CreateLsFile",
"problems setting ownership on file '%s' (errno: %d)",
531 "can't set permissions of list file %s (#%d)",
535 else if (chmod(
lsfile.Data(), 0644) != 0) {
536 Warning(
"CreateLsFile",
"problems setting permissions on file '%s' (errno: %d)",
544 Error(
"CreateLsFile",
"problems calculating checksum for '%s'",
lsfile.Data());
551 Error(
"CreateLsFile",
"problems unlinking temp file '%s' (errno: %d)",
600 Error(
"BrowseDataSets",
601 "only one of kPrint, kQuotaUpdate, kExport or kList can be specified at once");
617 const char *
dsEnt = 0;
627 Info(
"GetDataSets",
"found dataset %s of user %s in group %s",
632 Error(
"GetDataSets",
"dataset %s (user %s, group %s) could not be opened",
692 if (os)
Printf(
"%s", os->GetName());
759 if (user && (
strcmp(user,
"*") == 0 || !user[0]))
772 Error(
"GetDataSets",
"only one of '?P', '?Q', '?E' or '?L' can be specified at once");
797 Warning(
"GetDataSets",
"problems recreating 'ls' info for {%s,%s}",
815 Warning(
"GetDataSets",
"problems recreating 'ls' info for {%s,%s}",
836 if (!(os->GetString().Contains(
"/ls")))
continue;
838 if (!(os->GetString().Tokenize(
dsn,
from,
" ")))
continue;
839 if (!(os->GetString().Tokenize(
dsn,
from,
" ")))
continue;
890 Warning(
"GetDataSets",
"problems recreating 'ls' info for {%s,%s}",
913 Printf(
"Dataset URI | # Files | Default tree | # Events | Disk | Staged");
918 if (os->GetString().BeginsWith(
"file:")) {
920 TString path(os->GetString()(5, os->GetString().Length()));
926 Printf(
"%s", os->String().Data());
948 Error(
"FillLsDataSet",
"at least one of the inputs is invalid (%s,%s,%p)",
group, user, out);
965 Info(
"FillLsDataSet",
"file '%s' does not exists",
lsfile.Data());
969 Warning(
"FillLsDataSet",
"file '%s' exists cannot be read (permission denied)",
lsfile.Data());
977 Error(
"FillLsDataSet",
"could not initialize TMacro from '%s'",
lsfile.Data());
990 out->Add(o->
Clone());
996 Info(
"FillLsDataSet",
"no match for dataset uri '/%s/%s/%s'",
group, user,
dsname);
1033 Info(
"GetDataSet",
"dataset %s does not exist", path.
Data());
1043 Info(
"GetDataSet",
"file '%s' does not exists", path.
Data());
1047 Warning(
"GetDataSet",
"file '%s' exists cannot be read (permission denied)", path.
Data());
1056 Error(
"GetDataSet",
"could not get checksum of %s from %s", path.
Data(),
md5path.Data());
1063 Error(
"GetDataSet",
"could not open file %s", path.
Data());
1107 Error(
"CheckLocalCache",
"cannot get info for remote file '%s' - ignoring",
remupdate.Data());
1118 "cannot set modification time on file '%s' (errno: %d)",
1126 Error(
"CheckLocalCache",
"cannot get remote file '%s' - ignoring",
remupdate.Data());
1131 Warning(
"CheckLocalCache",
"cannot set modification time on file '%s' (errno: %d)",
1138 Warning(
"CheckLocalCache",
"problems create file '%s' (errno: %d)",
1142 Warning(
"CheckLocalCache",
"problems close file '%s' (errno: %d)",
1146 "cannot set modification time on file '%s' (errno: %d)",
1158 Warning(
"CheckLocalCache",
"problems create file '%s' (errno: %d)",
1162 Warning(
"CheckLocalCache",
"problems close file '%s' (errno: %d)",
1167 "cannot set modification time on file '%s' (errno: %d)",
1170 Warning(
"CheckLocalCache",
"cannot get info for file '%s'"
1193 Warning(
"CheckLocalCache",
"dataset '%s' does not exists anymore",
ds.Data());
1199 while (os->GetString().Tokenize(s,
from,
" ")) {
1207 Warning(
"CheckLocalCache",
"dataset '%s' does not exists anymore",
ds.Data());
1216 Warning(
"CheckLocalCache",
"cannot get checksum of '%s' - assuming match failed",
ds.Data());
1229 Error(
"CheckLocalCache",
"cannot get remote file '%s' - ignoring", path.
Data());
1236 Warning(
"CheckLocalCache",
"checksum for freshly downloaded file '%s' does not match the"
1239 Warning(
"CheckLocalCache",
"problems saving checksum to '%s' (errno: %d)",
1242 Warning(
"CheckLocalCache",
"problems calculating checksum for '%s'",
locpath.Data());
1258 Error(
"ClearCache",
"cannot open directory '%s' (errno: %d)",
1263 if (uri &&
strlen(uri) > 0) {
1268 if (
u(0) ==
'/')
u.Remove(0,1);
1270 u.ReplaceAll(
"/",
".");
1272 u.ReplaceAll(
"*",
".*");
1293 Warning(
"ShowCache",
"problems 'stat'-ing '%s' (errno: %d)",
1302 Warning(
"ClearCache",
"problems unlinking '%s' (errno: %d)",
1310 Printf(
" %lld bytes (%lld files) have been freed",
totsz,
nf);
1324 Error(
"ShowCache",
"cannot open directory '%s' (errno: %d)",
1329 if (uri &&
strlen(uri) > 0) {
1334 if (
u(0) ==
'/')
u.Remove(0,1);
1336 u.ReplaceAll(
"/",
".");
1338 u.ReplaceAll(
"*",
".*");
1345 Printf(
" Last modified Size(bytes) File");
1360 Warning(
"ShowCache",
"problems 'stat'-ing '%s' (errno: %d)",
1369 sz.Form(
"%lld",
st.fSize);
1411 Info(
"WriteDataSet",
"Dataset disappeared. Discarding update.");
1420 Error(
"WriteDataSet",
"Could not get checksum of %s", path.
Data());
1429 Info(
"WriteDataSet",
"Dataset changed. Discarding update.");
1444 Error(
"WriteDataSet",
"Could not open dataset for writing %s",
tempFile.Data());
1453 dataset->SetList(0);
1460 dataset->SetList(list);
1464 Error(
"WriteDataSet",
"renaming %s to %s failed; dataset might be corrupted",
1468 Error(
"WriteDataSet",
"unlink of %s failed",
md5path.Data());
1474 "can't set permissions of dataset file %s (#%d)",
1481 Error(
"WriteDataSet",
"problems calculating checksum of %s", path.
Data());
1487 "can't set permissions of dataset MD5 checksum file %s (#%d)",
1494 Error(
"WriteDataSet",
"could not 'stat' the version of '%s'!", path.
Data());
1502 Warning(
"WriteDataSet",
"problems notifying update with 'NotifyUpdate'");
1518 Error(
"ChecksumDataSet",
"one or more inputs are invalid ('%s','%s')",
1525 Error(
"ChecksumDataSet",
"problems calculating checksum of '%s'", path);
1530 Error(
"ChecksumDataSet",
"problems saving checksum to '%s'",
md5path);
1554 Warning(
"RemoveDataSet",
"problems removing main file '%s' (errno: %d)",
1558 Warning(
"RemoveDataSet",
"problems removing chcksum file '%s' (errno: %d)",
1565 Warning(
"RemoveDataSet",
"problems notifying update with 'NotifyUpdate'");
1608 Error(
"RegisterDataSet",
"problem parsing uri: %s", uri);
1624 "dataset '%s' claimed to exists but retrieval failed - ignoring", uri);
1635 Error(
"RegisterDataSet",
"dataset '%s' exists already", uri);
1653 dataSet->GetList()->SetOwner(0);
1654 dataSet->GetList()->Clear(
"nodelete");
1655 dataSet->GetList()->SetOwner(1);
1664 Warning(
"RegisterDataSet",
"configured to not trust the information"
1665 " provided by users: ignoring request");
1671 dataSet->SetName(
dsName);
1674 dataSet->RemoveMetaData();
1682 Error(
"RegisterDataSet",
"problems verifying the dataset");
1686 Warning(
"RegisterDataSet",
"user-driven verification not allowed: ignoring request");
1694 if (dataSet->GetTotalSize() <= 0) {
1695 Error(
"RegisterDataSet",
"datasets without size information are not accepted:");
1697 Error(
"RegisterDataSet",
"you may want to define an average"
1698 " file size to get an estimated dataset size");
1706 Info(
"RegisterDataSet",
"your group %s uses %.1f GB + %.1f GB for the new dataset; "
1707 "the available quota is %.1f GB",
fGroup.
Data(),
1709 (
Float_t) dataSet->GetTotalSize() / 1073741824,
1712 Error(
"RegisterDataSet",
"quota exceeded");
1719 Error(
"RegisterDataSet",
"could not write dataset: %s",
dsName.Data());
1737 if (!dataset)
return -1;
1738 dataset->SetDefaultTreeName(
dsTree.Data());
1741 return (
rc == 0) ? -1 : 0;
1747 if (!(
dsName.Contains(
"*"))) {
1753 if (!
fcs)
return -1;
1759 if (!(
d->GetString().IsNull())) {
1761 if (
dsn.Contains(
"/"))
dsn.Remove(0,
dsn.Last(
'/') + 1);
1765 Warning(
"ScanDataSet",
"problems processing dataset: %s",
d->GetName());
1768 Warning(
"ScanDataSet",
"empty string found in map while processing: %s", uri);
1805 Warning(
"ScanDataSet",
"kAllFiles mode: ignoring kStagedFiles or kReopen"
1806 " or kTouch requests");
1815 Error(
"ScanDataSet",
"kLocateOnly and kStageOnly cannot be processed concurrently");
1821 Warning(
"ScanDataSet",
"kNoAction mode: ignoring kLocateOnly or kStageOnly requests");
1882 ss.ReplaceAll(
"S:",
"");
1883 ss.ReplaceAll(
"short:",
"");
1887 if (!
fcs)
return fc;
1903 if (
fc && !
ss.IsNull()) {
1908 while (
ss.Tokenize(s,
from,
",")) {
1938 Error(
"RemoveDataSet",
"error removing dataset %s",
dsName.Data());
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
const char *const kDataSet_LocalCache
const char *const kDataSet_DataSetList
const char *const kDataSet_LockLocation
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 target
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 char Point_t Rectangle_t WindowAttributes_t index
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 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.
Bool_t R_ISDIR(Int_t mode)
R__EXTERN TSystem * gSystem
Int_t NotifyUpdate(const char *group, const char *user, const char *dspath, Long_t mtime, const char *checksum=0) override
Save into the <datasetdir>/kDataSet_DataSetList file the name of the updated or created or modified d...
Int_t ChecksumDataSet(const char *path, const char *md5path, TString &checksum)
Calculate the checksum of the indicated dataset at 'path' and save it to the appropriate file 'md5pat...
TMap * GetDataSets(const char *uri, UInt_t option=TDataSetManager::kExport) override
Returns all datasets for the <group> and <user> specified by <uri>.
Int_t WriteDataSet(const char *group, const char *user, const char *dsName, TFileCollection *dataset, UInt_t option=0, TMD5 *checksum=0)
Writes indicated dataset.
Int_t ShowCache(const char *uri=0) override
Show cached information matching uri.
Int_t CreateLsFile(const char *group, const char *user, Long_t &mtime, TString &checksum)
Create or recreate the dataset lists for 'uri'.
Bool_t ExistsDataSet(const char *group, const char *user, const char *dsName)
Checks if the indicated dataset exits.
const char * GetDataSetPath(const char *group, const char *user, const char *dsName)
void ParseInitOpts(const char *opts) override
Parse the input string and set the init bits accordingly Format is dir:<datasetdir> [mss:<mss-url>] [...
Bool_t BrowseDataSets(const char *group, const char *user, const char *dsName, UInt_t option, TObject *target)
Adds the dataset in the folder of group, user to the list in target.
Int_t RegisterDataSet(const char *uri, TFileCollection *dataSet, const char *opt) override
Register a dataset, perfoming quota checkings and verification, if required.
void InitLocalCache()
Init the local cache if required.
Bool_t RemoveDataSet(const char *group, const char *user, const char *dsName)
Removes the indicated dataset.
Int_t CheckLocalCache(const char *group, const char *user, const char *dsName="ls", UInt_t option=0)
Check if the local cache information for group, user, dsName is up-to-date If not,...
Int_t ScanDataSet(const char *group, const char *user, const char *dsName, UInt_t option=kReopen|kDebug)
See documentation of ScanDataSet(TFileCollection *dataset, UInt_t option)
Int_t FillLsDataSet(const char *group, const char *user, const char *dsName, TList *out, UInt_t option)
Check for the 'ls.txt' for 'group' and 'user' and fill the path for the ls file in 'out'.
void UpdateUsedSpace() override
updates the used space maps
Long_t GetModTime(const char *uri)
Gets last dataset modification time.
void Init()
Do the real inititialization.
TFileCollection * GetDataSet(const char *uri, const char *srv=0) override
Utility function used in various methods for user dataset upload.
Int_t ClearCache(const char *uri=0) override
Clear cached information matching uri.
static TString fgCommonDataSetTag
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.
void GetQuota(const char *group, const char *user, const char *dsName, TFileCollection *dataset)
Gets quota information from this dataset.
virtual void ShowDataSets(const char *uri="*", const char *opt="")
Prints formatted information about the dataset 'uri'.
Int_t GetNDisapparedFiles() const
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.
virtual Long64_t GetGroupQuota(const char *group)
returns the quota a group is allowed to have
This class stores the date and time with a precision of one second in an unsigned 32 bit word (950130...
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.
Class describing a generic file including meta information.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
static EFileType GetType(const char *name, Option_t *option="", TString *prefix=nullptr)
Resolve the file type as a function of the protocol field in 'name'.
virtual Bool_t Cp(const char *dst, Bool_t progressbar=kTRUE, UInt_t buffersize=1000000)
Allows to copy this file to the dst URL.
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.
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
A scoped lock based on files.
This code implements the MD5 message-digest algorithm.
static TMD5 * FileChecksum(const char *file)
Returns checksum of specified file.
static TMD5 * ReadChecksum(const char *file)
Returns checksum stored in ASCII in specified file.
static Int_t WriteChecksum(const char *file, const TMD5 *md5)
Writes checksum in ASCII format to specified file.
Class supporting a collection of lines with C++ code.
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...
Collectable string class.
const TString & GetString() const
Mother of all ROOT objects.
@ kOverwrite
overwrite existing object with same name
@ kSingleKey
write collection with single key
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
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.
@ kInvalidObject
if object ctor succeeded but object should not be used
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Regular expression class.
TString & Insert(Ssiz_t pos, const char *s)
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)
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
virtual Int_t RedirectOutput(const char *name, const char *mode="a", RedirectHandle_t *h=nullptr)
Redirect standard output (stdout, stderr) to the specified file.
static Int_t GetErrno()
Static function returning system error number.
virtual int Chmod(const char *file, UInt_t mode)
Set the file permission bits. Returns -1 in case or error, 0 otherwise.
virtual void FreeDirectory(void *dirp)
Free a directory.
virtual void * OpenDirectory(const char *name)
Open a directory. Returns 0 if directory does not exist.
virtual const char * Getenv(const char *env)
Get environment variable.
virtual void ShowOutput(RedirectHandle_t *h)
Display the content associated with the redirection described by the opaque handle 'h'.
virtual int mkdir(const char *name, Bool_t recursive=kFALSE)
Make a file system directory.
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 const char * GetDirEntry(void *dirp)
Get a directory entry. Returns 0 if no more entries.
virtual int Rename(const char *from, const char *to)
Rename a file.
virtual int Utime(const char *file, Long_t modtime, Long_t actime)
Set the a files modification and access times.
virtual TString GetDirName(const char *pathname)
Return the directory name in pathname.
virtual int Unlink(const char *name)
Unlink, i.e.
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
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.
LsTreeEntry_t(const char *g, const char *u, const char *cs, const char *ls, Long64_t m)