ROOT logo
ROOT » PROOF » PROOF » TDataSetManager

class TDataSetManager: public TObject


TDataSetManager

This class contains functions to handle datasets in PROOF
It is the layer between TProofServ and the file system that stores
the datasets.


Function Members (Methods)

public:
TDataSetManager(const char* group = 0, const char* user = 0, const char* options = 0)
virtual~TDataSetManager()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
static TClass*TObject::Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
static TStringCreateUri(const char* dsGroup = 0, const char* dsUser = 0, const char* dsName = 0, const char* dsTree = 0)
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual Bool_tExistsDataSet(const char* uri)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual TFileCollection*GetDataSet(const char* uri, const char* server = 0)
virtual TMap*GetDataSets(const char* uri, UInt_t = 0)
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual Long64_tGetGroupQuota(const char* group)
virtual TMap*GetGroupQuotaMap()
virtual Long64_tGetGroupUsed(const char* group)
virtual const char*TObject::GetIconName() const
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual TMap*GetSubDataSets(const char* uri, const char* excludeservers)
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual TClass*TObject::IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual voidMonitorUsedSpace(TVirtualMonitoringWriter* monitoring)
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TObject&TObject::operator=(const TObject& rhs)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidParseInitOpts(const char* opts)
Bool_tParseUri(const char* uri, TString* dsGroup = 0, TString* dsUser = 0, TString* dsName = 0, TString* dsTree = 0, Bool_t onlyCurrent = kFALSE, Bool_t wildcards = kFALSE)
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual Int_tRegisterDataSet(const char* uri, TFileCollection* dataSet, const char* opt)
virtual Bool_tRemoveDataSet(const char* uri)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
virtual Int_tScanDataSet(const char* uri, UInt_t option = 0)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowDataSets(const char* uri = "*", const char* opt = "")
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidTObject::ShowMembers(TMemberInspector& insp, char* parent)
virtual voidShowQuota(const char* opt)
virtual voidStreamer(TBuffer& b)
virtual voidTObject::Streamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
voidTObject::StreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
virtual TMap*GetGroupUsedMap()
Int_tGetNDisapparedFiles() const
Int_tGetNOpenedFiles() const
Int_tGetNTouchedFiles() const
voidGetQuota(const char* group, const char* user, const char* dsName, TFileCollection* dataset)
virtual TMap*GetUserUsedMap()
voidTObject::MakeZombie()
voidPrintDataSet(TFileCollection* fc, Int_t popt = 0)
voidPrintUsedSpace()
Bool_tReadGroupConfig(const char* cf = 0)
static Long64_tToBytes(const char* size = 0)
virtual voidUpdateUsedSpace()

Data Members

private:
enum EDataSetStatusBits { kCheckQuota
kAllowRegister
kAllowVerify
kAllowStaging
kIsSandbox
};
enum EDataSetWorkOpts { kDebug
kShowDefault
kPrint
kExport
kQuotaUpdate
kSetDefaultTree
kReopen
kTouch
kMaxFiles
kReadShort
kFileMustExist
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
Long64_tfAvgFileSizeAverage file size to be used to estimate the dataset size (in MB)
TUrifBaseBase URI used to parse dataset names
TStringfCommonGroupGroup that stores the COMMON datasets
TStringfCommonUserUser that stores the COMMON datasets
TStringfGroupGroup to which the owner of this session belongs
TStringfGroupConfigFilePath to the group config file
TMapfGroupQuotaGroup quotas (read from config file)
TMapfGroupUsed<group> --> <used bytes> (TParameter)
Long_tfMTimeGroupConfigLast modification of the group config file
Int_tfNDisappearedFilesNumber of files disappared in the last ScanDataSet operation
Int_tfNOpenedFilesNumber of files opened in the last ScanDataSet operation
Int_tfNTouchedFilesNumber of files touched in the last ScanDataSet operation
TStringfUserOwner of the session
TMapfUserUsed<group> --> <map of users> --> <value>
static TStringfgCommonDataSetTagName for common datasets, default: COMMON

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TDataSetManager(const char* group = 0, const char* user = 0, const char* options = 0)
 Main constructor
~TDataSetManager()
 Destructor
void ParseInitOpts(const char* opts)
 Parse the opts string and set the init bits accordingly
 Available options:
    Cq:               set kCheckQuota
    Ar:               set kAllowRegister
    Av:               set kAllowVerify
    As:               set kAllowStaging
    Sb:               set kIsSandbox
 The opts string may also contain additional unrelated info: in such a case
 the field delimited by the prefix "opt:" is analyzed, e.g. if opts is
 "/tmp/dataset  opt:Cq:-Ar: root://lxb6046.cern.ch" only the substring
 "Cq:-Ar:" will be parsed .
Bool_t ReadGroupConfig(const char* cf = 0)
 Read group config file 'cf'.
 If cf == 0 re-read, if changed, the file pointed by fGroupConfigFile .

 expects the following directives:
 Group definition:
   group <groupname> <user>+
 disk quota
   property <groupname> diskquota <quota in GB>
 average filesize (to be used when the file size is not available)
   averagefilesize <average size>{G,g,M,m,K,k}
Long64_t ToBytes(const char* size = 0)
 Static utility function to gt the number of bytes from a string
 representation in the form "<digit><sfx>" with <sfx> = {"", "k", "M", "G",
 "T", "P"} (case insensitive).
 Returns -1 if the format is wrong.
TFileCollection * GetDataSet(const char* uri, const char* server = 0)
 Utility function used in various methods for user dataset upload.
Bool_t RemoveDataSet(const char* uri)
 Removes the indicated dataset
Bool_t ExistsDataSet(const char* uri)
 Checks if the indicated dataset exits
TMap * GetDataSets(const char* uri, UInt_t = 0)
 Returns all datasets for the <group> and <user> specified by <uri>.
 If <user> is 0, it returns all datasets for the given <group>.
 If <group> is 0, it returns all datasets.
 The returned TMap contains:
    <group> --> <map of users> --> <map of datasets> --> <dataset> (TFileCollection)

 The unsigned int 'option' is forwarded to GetDataSet and BrowseDataSet.
 Available options (to be .or.ed):
    kShowDefault    a default selection is shown that include the ones from
                    the current user, the ones from the group and the common ones
    kPrint          print the dataset content
    kQuotaUpdate    update quotas
    kExport         use export naming

 NB1: options "kPrint", "kQuoatUpdate" and "kExport" are mutually exclusive
 NB2: for options "kPrint" and "kQuoatUpdate" return is null.
Int_t ScanDataSet(const char* uri, UInt_t option = 0)
 Scans the dataset indicated by <uri> and returns the number of missing files.
 Returns -1 if any failure occurs.
 For more details, see documentation of
 ScanDataSet(TFileCollection *dataset, const char *option)
void GetQuota(const char* group, const char* user, const char* dsName, TFileCollection* dataset)
 Gets quota information from this dataset
void ShowQuota(const char* opt)
 Display quota information
void PrintUsedSpace()
 Prints the quota
void MonitorUsedSpace(TVirtualMonitoringWriter* monitoring)
 Log info to the monitoring server
Long64_t GetGroupUsed(const char* group)
 Returns the used space of that group
Long64_t GetGroupQuota(const char* group)
 returns the quota a group is allowed to have
void UpdateUsedSpace()
 updates the used space maps
Int_t RegisterDataSet(const char* uri, TFileCollection* dataSet, const char* opt)
 Register a dataset, perfoming quota checkings, if needed.
 Returns 0 on success, -1 on failure
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]'.
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.
 The input 'uri' should be in the form '[[/group/]user/]dsname[#[subdir/]objname]',
  where 'objname' is the name of the object (e.g. the tree name) and the 'subdir'
 is the directory in the file wher it should be looked for.
 After resolving against a base URI consisting of proof://masterhost/group/user
 - meaning masterhost, group and user of the current session -
 the path is checked to contain exactly three elements separated by '/':
 group/user/dsname
 If wildcards, '*' is allowed in group and user and dsname is allowed to be empty.
 If onlyCurrent, only group and user of current session are allowed.
 Only non-null parameters are filled by this function.
 Returns kTRUE in case of success.
TMap * GetSubDataSets(const char* uri, const char* excludeservers)
 Partition dataset 'ds' accordingly to the servers.
 The returned TMap contains:
                <server> --> <subdataset> (TFileCollection)
 where <subdataset> is the subset of 'ds' on <server>
 The partitioning is done using all the URLs in the TFileInfo's, so the
 resulting datasets are not mutually exclusive.
 The string 'exclude' contains a comma-separated list of servers to exclude
 from the map.
void PrintDataSet(TFileCollection* fc, Int_t popt = 0)
 Formatted printout of the content of TFileCollection 'fc'.
 Options in the form
           popt = u * 10 + f
     f    0 => header only, 1 => header + files
   when printing files
     u    0 => print file name only, 1 => print full URL
void ShowDataSets(const char* uri = "*", const char* opt = "")
 Prints formatted information about the dataset 'uri'.
 The type and format of output is driven by 'opt':

   1. opt = "server:srv1[,srv2[,srv3[,...]]]"
            Print info about the subsets of 'uri' on servers srv1, srv2, ...
   2. opt = "servers[:exclude:srv1[,srv2[,srv3[,...]]]]"
            Print info about the subsets of 'uri' on all servers, except
            the ones in the exclude list srv1, srv2, ...
   3. opt = <any>
            Print info about all datasets matching 'uri'

   If 'opt' contains 'full:' the list of files in the datasets are also printed.
   In case 3. this is enabled only if 'uri' matches a single dataset.
TDataSetManager(const TDataSetManager& )
TDataSetManager& operator=(const TDataSetManager& )
TMap * GetGroupUsedMap()
{ return &fGroupUsed; }
TMap * GetUserUsedMap()
{ return &fUserUsed; }
Int_t GetNTouchedFiles() const
{ return fNTouchedFiles; }
Int_t GetNOpenedFiles() const
{ return fNOpenedFiles; }
Int_t GetNDisapparedFiles() const
{ return fNDisappearedFiles; }
TMap * GetGroupQuotaMap()
{ return &fGroupQuota; }