]>
Commit | Line | Data |
---|---|---|
9e1ceb13 | 1 | #ifndef ALI_CDB_STORAGE_H |
2 | #define ALI_CDB_STORAGE_H | |
3 | ||
fe913d8f | 4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
9e1ceb13 | 7 | ///////////////////////////////////////////////////////////////////// |
8 | // // | |
9 | // class AliCDBStorage // | |
10 | // interface to specific storage classes // | |
11 | // (AliCDBGrid, AliCDBLocal, AliCDBDump) // | |
12 | // // | |
13 | ///////////////////////////////////////////////////////////////////// | |
fe913d8f | 14 | |
9e1ceb13 | 15 | #include "AliCDBId.h" |
fe913d8f | 16 | #include "AliCDBMetaData.h" |
b8ec52f6 | 17 | #include "AliCDBManager.h" |
fe913d8f | 18 | |
9e1ceb13 | 19 | #include <TList.h> |
6dc56e97 | 20 | #include <TObjArray.h> |
fe913d8f | 21 | |
fe913d8f | 22 | class AliCDBEntry; |
62032124 | 23 | class AliCDBPath; |
b8ec52f6 | 24 | class AliCDBParam; |
145f45a2 | 25 | class TFile; |
fe913d8f | 26 | |
27 | class AliCDBStorage: public TObject { | |
fe913d8f | 28 | |
9e1ceb13 | 29 | public: |
b8ec52f6 | 30 | |
9e1ceb13 | 31 | AliCDBStorage(); |
9e1ceb13 | 32 | |
7d160419 | 33 | void SetURI(const TString& uri) {fURI = uri;} |
34 | const TString& GetURI() const {return fURI;} | |
62032124 | 35 | const TString& GetType() const {return fType;} |
36 | const TString& GetBaseFolder() const {return fBaseFolder;} | |
b8ec52f6 | 37 | AliCDBManager::DataType GetDataType() const; |
62032124 | 38 | |
7d160419 | 39 | |
b05400be | 40 | void ReadSelectionFromFile(const char *fileName); |
41 | ||
9e1ceb13 | 42 | void AddSelection(const AliCDBId& selection); |
43 | ||
44 | void AddSelection(const AliCDBPath& path, | |
45 | const AliCDBRunRange& runRange, | |
46 | Int_t version, | |
47 | Int_t subVersion = -1); | |
48 | ||
49 | void AddSelection(const AliCDBPath& path, | |
50 | Int_t firstRun, | |
51 | Int_t lastRun, | |
52 | Int_t version, | |
53 | Int_t subVersion = -1); | |
54 | ||
55 | void RemoveSelection(const AliCDBId& selection); | |
56 | ||
57 | void RemoveSelection(const AliCDBPath& path, | |
58 | const AliCDBRunRange& runRange); | |
59 | ||
60 | void RemoveSelection(const AliCDBPath& path, | |
61 | Int_t firstRun = -1, | |
62 | Int_t lastRun = -1); | |
63 | ||
eb0b1051 | 64 | void RemoveSelection(int position); |
9e1ceb13 | 65 | void RemoveAllSelections(); |
66 | ||
02c4845e | 67 | void PrintSelectionList(); |
68 | ||
9e1ceb13 | 69 | AliCDBEntry* Get(const AliCDBId& query); |
4667c116 | 70 | AliCDBEntry* Get(const AliCDBPath& path, Int_t runNumber, |
9e1ceb13 | 71 | Int_t version = -1, Int_t subVersion = -1); |
72 | AliCDBEntry* Get(const AliCDBPath& path, const AliCDBRunRange& runRange, | |
73 | Int_t version = -1, Int_t subVersion = -1); | |
74 | ||
75 | TList* GetAll(const AliCDBId& query); | |
76 | TList* GetAll(const AliCDBPath& path, Int_t runNumber, | |
77 | Int_t version = -1, Int_t subVersion = -1); | |
78 | TList* GetAll(const AliCDBPath& path, const AliCDBRunRange& runRange, | |
7d160419 | 79 | Int_t version = -1, Int_t subVersion = -1); |
9e1ceb13 | 80 | |
4667c116 | 81 | AliCDBId* GetId(const AliCDBId& query); |
82 | AliCDBId* GetId(const AliCDBPath& path, Int_t runNumber, | |
83 | Int_t version = -1, Int_t subVersion = -1); | |
84 | AliCDBId* GetId(const AliCDBPath& path, const AliCDBRunRange& runRange, | |
85 | Int_t version = -1, Int_t subVersion = -1); | |
86 | ||
c5941d67 | 87 | Bool_t Put(TObject* object, AliCDBId& id, AliCDBMetaData* metaData, const char* mirrors="", |
b8ec52f6 | 88 | AliCDBManager::DataType type=AliCDBManager::kPrivate); |
06eeadea | 89 | Bool_t Put(AliCDBEntry* entry, const char* mirrors="", AliCDBManager::DataType type=AliCDBManager::kPrivate); |
9e1ceb13 | 90 | |
c5941d67 | 91 | virtual void SetMirrorSEs(const char* mirrors); |
92 | virtual const char* GetMirrorSEs() const; | |
93 | ||
fdf65bb5 | 94 | virtual Bool_t IsReadOnly() const = 0; |
95 | virtual Bool_t HasSubVersion() const = 0; | |
b05400be | 96 | virtual Bool_t Contains(const char* path) const = 0; |
c3a7b59a | 97 | virtual Bool_t IdToFilename(const AliCDBId& id, TString& filename) const = 0; |
b05400be | 98 | |
c3a7b59a | 99 | void QueryCDB(Int_t run, const char* pathFilter="*", |
62032124 | 100 | Int_t version=-1, AliCDBMetaData *mdFilter=0); |
101 | void PrintQueryCDB(); | |
6dc56e97 | 102 | TObjArray* GetQueryCDBList() {return &fValidFileIds;} |
5bfe3965 | 103 | virtual void SetRetry(Int_t nretry, Int_t initsec) = 0; |
d3ce989c | 104 | void GetSelection(AliCDBId* id); |
105 | Int_t GetNSelections(){return fSelections.GetEntries();} | |
c3a7b59a | 106 | |
fe913d8f | 107 | protected: |
62032124 | 108 | |
109 | virtual ~AliCDBStorage(); | |
9e1ceb13 | 110 | virtual AliCDBEntry* GetEntry(const AliCDBId& query) = 0; |
4667c116 | 111 | virtual AliCDBId* GetEntryId(const AliCDBId& query) = 0; |
9e1ceb13 | 112 | virtual TList* GetEntries(const AliCDBId& query) = 0; |
06eeadea | 113 | virtual Bool_t PutEntry(AliCDBEntry* entry, const char* mirrors="") = 0; |
b05400be | 114 | virtual TList *GetIdListFromFile(const char* fileName)=0; |
62032124 | 115 | virtual void QueryValidFiles() = 0; |
145f45a2 | 116 | void LoadTreeFromFile(AliCDBEntry* entry) const; |
ed343d5e | 117 | //void SetTreeToFile(AliCDBEntry* entry, TFile* file) const; |
fe913d8f | 118 | |
6dc56e97 | 119 | TObjArray fValidFileIds; // list of Id's of the files valid for a given run (cached as fRun) |
c5941d67 | 120 | Int_t fRun; // run number, used to manage list of valid files |
121 | AliCDBPath fPathFilter; // path filter, used to manage list of valid files | |
122 | Int_t fVersion; // version, used to manage list of valid files | |
62032124 | 123 | AliCDBMetaData* fMetaDataFilter; // metadata, used to manage list of valid files |
fe913d8f | 124 | |
7d160419 | 125 | TList fSelections; // list of selection criteria |
62032124 | 126 | TString fURI; // storage URI; |
127 | TString fType; //! Local, Grid: base folder name - Dump: file name | |
128 | TString fBaseFolder; //! Local, Grid: base folder name - Dump: file name | |
89004e35 | 129 | Short_t fNretry; // Number of retries in opening the file |
5bfe3965 | 130 | Short_t fInitRetrySeconds; // Seconds for first retry |
fe913d8f | 131 | |
c3a7b59a | 132 | private: |
fe12e09c | 133 | AliCDBStorage(const AliCDBStorage & source); |
d3ce989c | 134 | AliCDBStorage* operator=(const AliCDBStorage & source); |
fe12e09c | 135 | |
9e1ceb13 | 136 | ClassDef(AliCDBStorage, 0); |
fe913d8f | 137 | }; |
138 | ||
139 | #endif |