#ifndef ROOT_TDataSetManagerFile
#define ROOT_TDataSetManagerFile
#ifndef ROOT_TDataSetManager
#include "TDataSetManager.h"
#endif
const char* const kDataSet_LocalCache = "dataset.cache";
const char* const kDataSet_DataSetList = "dataset.list";
const char* const kDataSet_LockLocation = "lock.location";
class TDataSetManagerFile : public TDataSetManager {
private:
TString fDataSetDir;
TString fMSSUrl;
TString fStageOpts;
TString fDataSetLockFile;
Int_t fLockFileTimeLimit;
TString fListFile;
Bool_t fIsRemote;
Bool_t fUseCache;
TString fLocalCacheDir;
Int_t fCacheUpdatePeriod;
Bool_t fOpenPerms;
void InitLocalCache();
Int_t CheckLocalCache(const char *group, const char *user, const char *dsName = "ls", UInt_t option = 0);
protected:
const char *GetDataSetPath(const char *group, const char *user, const char *dsName);
const char *GetDataSetPath(const char *group, const char *user, const char *dsName,
TString &md5path, Bool_t local = kFALSE);
void Init();
Bool_t BrowseDataSets(const char *group, const char *user, const char *dsName,
UInt_t option, TObject *target);
Bool_t RemoveDataSet(const char *group, const char *user, const char *dsName);
Bool_t ExistsDataSet(const char *group, const char *user, const char *dsName);
Int_t ScanDataSet(const char *group, const char *user, const char *dsName, UInt_t option = kReopen | kDebug);
Int_t ChecksumDataSet(const char *path, const char *md5path, TString &checksum);
Int_t CreateLsFile(const char *group, const char *user, Long_t &mtime, TString &checksum);
Int_t FillLsDataSet(const char *group, const char *user, const char *dsName, TList *out, UInt_t option);
void UpdateUsedSpace();
public:
TDataSetManagerFile() : TDataSetManager(0, 0, 0) { }
TDataSetManagerFile(const char *group, const char *user, const char *ins);
TDataSetManagerFile(const char *ins);
virtual ~TDataSetManagerFile() { }
void ParseInitOpts(const char *opts);
Int_t ClearCache(const char *uri = 0);
TFileCollection *GetDataSet(const char *uri, const char *srv = 0);
TMap *GetDataSets(const char *uri, UInt_t option = TDataSetManager::kExport);
Bool_t ExistsDataSet(const char *uri);
Bool_t RemoveDataSet(const char *uri);
Int_t RegisterDataSet(const char *uri, TFileCollection *dataSet, const char *opt);
Int_t ScanDataSet(const char *uri, UInt_t option = kReopen | kDebug);
Int_t NotifyUpdate(const char *group, const char *user,
const char *dspath, Long_t mtime, const char *checksum = 0);
Int_t ShowCache(const char *uri = 0);
TFileCollection *GetDataSet(const char *group, const char *user, const char *dsName,
UInt_t option = 0, TMD5 **checksum = 0);
TMap *GetDataSets(const char *group, const char *user, const char *dsName = 0,
UInt_t option = 0);
const char *GetMSSUrl() const { return fMSSUrl; }
const char *GetStageOpts() const { return fStageOpts; }
Int_t WriteDataSet(const char *group, const char *user, const char *dsName,
TFileCollection *dataset, UInt_t option = 0, TMD5 *checksum = 0);
Long_t GetModTime(const char *uri);
ClassDef(TDataSetManagerFile, 0)
};
#endif
TDataSetManagerFile.h:100 TDataSetManagerFile.h:101 TDataSetManagerFile.h:102 TDataSetManagerFile.h:103 TDataSetManagerFile.h:104 TDataSetManagerFile.h:105