#ifndef ROOT_TDataSetManager
#define ROOT_TDataSetManager
#ifndef ROOT_TObject
#include "TObject.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif
#ifndef ROOT_TMap
#include "TMap.h"
#endif
#ifndef ROOT_TUri
#include "TUri.h"
#endif
class TFileCollection;
class TMD5;
class TVirtualMonitoringWriter;
class TDataSetManager : public TObject {
private:
TDataSetManager(const TDataSetManager&);
TDataSetManager& operator=(const TDataSetManager&);
protected:
TString fGroup;
TString fUser;
TString fCommonUser;
TString fCommonGroup;
TUri fBase;
TMap fGroupQuota;
TMap fGroupUsed;
TMap fUserUsed;
Long64_t fAvgFileSize;
Int_t fNTouchedFiles;
Int_t fNOpenedFiles;
Int_t fNDisappearedFiles;
TString fGroupConfigFile;
Long_t fMTimeGroupConfig;
static TString fgCommonDataSetTag;
virtual TMap *GetGroupUsedMap() { return &fGroupUsed; }
virtual TMap *GetUserUsedMap() { return &fUserUsed; }
Int_t GetNTouchedFiles() const { return fNTouchedFiles; }
Int_t GetNOpenedFiles() const { return fNOpenedFiles; }
Int_t GetNDisapparedFiles() const { return fNDisappearedFiles; }
void GetQuota(const char *group, const char *user, const char *dsName, TFileCollection *dataset);
void PrintDataSet(TFileCollection *fc, Int_t popt = 0);
void PrintUsedSpace();
Bool_t ReadGroupConfig(const char *cf = 0);
virtual void UpdateUsedSpace();
static Long64_t ToBytes(const char *size = 0);
public:
enum EDataSetStatusBits {
kCheckQuota = BIT(15),
kAllowRegister = BIT(16),
kAllowVerify = BIT(17),
kAllowStaging = BIT(18),
kIsSandbox = BIT(19)
};
enum EDataSetWorkOpts {
kDebug = 1, kShowDefault = 2, kPrint = 4, kExport = 8,
kQuotaUpdate = 16, kSetDefaultTree = 32,
kReopen = 256, kTouch = 512, kMaxFiles = 1024, kReadShort = 2048,
kFileMustExist = 4096};
TDataSetManager(const char *group = 0, const char *user = 0, const char *options = 0);
virtual ~TDataSetManager();
virtual TFileCollection *GetDataSet(const char *uri, const char *server = 0);
virtual TMap *GetDataSets(const char *uri, UInt_t = 0);
virtual TMap *GetSubDataSets(const char *uri, const char *excludeservers);
virtual Long64_t GetGroupQuota(const char *group);
virtual TMap *GetGroupQuotaMap() { return &fGroupQuota; }
virtual Long64_t GetGroupUsed(const char *group);
virtual Bool_t ExistsDataSet(const char *uri);
virtual void MonitorUsedSpace(TVirtualMonitoringWriter *monitoring);
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);
virtual void ParseInitOpts(const char *opts);
virtual Bool_t RemoveDataSet(const char *uri);
virtual Int_t RegisterDataSet(const char *uri, TFileCollection *dataSet, const char *opt);
virtual Int_t ScanDataSet(const char *uri, UInt_t option = 0);
virtual void ShowQuota(const char *opt);
virtual void ShowDataSets(const char *uri = "*", const char *opt = "");
static TString CreateUri(const char *dsGroup = 0, const char *dsUser = 0,
const char *dsName = 0, const char *dsTree = 0);
ClassDef(TDataSetManager, 0)
};
#endif