//_____________________________________________________________________________
AliCDBManager::AliCDBManager():
TObject(),
- fCondParam(0),
- fRefParam(0),
fFactories(),
fActiveStorages(),
fSpecificStorages(),
+ fEntryCache(),
+ fIds(0),
+ fStorageMap(0),
+ fShortLived(0),
fDefaultStorage(NULL),
fRemoteStorage(NULL),
fDrainStorage(NULL),
- fEntryCache(),
- fCache(kTRUE),
+ fCondParam(0),
+ fRefParam(0),
fRun(-1),
- fShortLived(0)
+ fCache(kTRUE)
{
// default constuctor
fFactories.SetOwner(1);
fActiveStorages.SetOwner(1);
fSpecificStorages.SetOwner(1);
fEntryCache.SetOwner(1);
+
+ fStorageMap = new TMap();
+ fStorageMap->SetOwner(1);
+ fIds = new TList();
+ fIds->SetOwner(1);
}
//_____________________________________________________________________________
fDrainStorage = 0x0;
fDefaultStorage = 0x0;
fRemoteStorage = 0x0;
+ delete fStorageMap; fStorageMap = 0;
+ delete fIds; fIds = 0;
delete fCondParam;
delete fRefParam;
delete fShortLived; fShortLived = 0x0;
//_____________________________________________________________________________
Bool_t AliCDBManager::HasStorage(const char* dbString) const {
-// check if dbString is a URI valid for one of the registered factories
+// check if dbString is a URI valid for one of the registered factories
TIter iter(&fFactories);
AliWarning("Existing default storage replaced: clearing cache!");
ClearCache();
}
+
+ if (fStorageMap->Contains("default")) {
+ delete fStorageMap->Remove(fStorageMap->GetValue("default"));
+ }
+ fStorageMap->Add(new TObjString("default"), new TObjString(fDefaultStorage->GetURI()));
}
//_____________________________________________________________________________
AliWarning("Existing default storage replaced: clearing cache!");
ClearCache();
}
+
+ if (fStorageMap->Contains("default")) {
+ delete fStorageMap->Remove(fStorageMap->GetValue("default"));
+ }
+ fStorageMap->Add(new TObjString("default"), new TObjString(fDefaultStorage->GetURI()));
}
//_____________________________________________________________________________
AliWarning("Existing default storage replaced: clearing cache!");
ClearCache();
}
+
+ if (fStorageMap->Contains("default")) {
+ delete fStorageMap->Remove(fStorageMap->GetValue("default"));
+ }
+ fStorageMap->Add(new TObjString("default"), new TObjString(fDefaultStorage->GetURI()));
}
//_____________________________________________________________________________
void AliCDBManager::SetRemoteStorage(const char* dbString) {
GetStorage(param);
fSpecificStorages.Add(objCalibType, param->CloneParam());
+
+ if(fStorageMap->Contains(objCalibType)){
+ delete fStorageMap->Remove(objCalibType);
+ }
+ fStorageMap->Add(objCalibType->Clone(), new TObjString(param->GetURI()));
+
}
//_____________________________________________________________________________
CacheEntry(query.GetPath(), entry);
}
+ if(entry && !fIds->Contains(&entry->GetId())){
+ fIds->Add(entry->GetId().Clone());
+ }
+
+
return entry;
}
}
// caching entries
- if(fCache && (query.GetFirstRun() == fRun)){
+ TIter iter(result);
+ AliCDBEntry* entry=0;
+ while((entry = dynamic_cast<AliCDBEntry*> (iter.Next()))){
- TIter iter(result);
- AliCDBEntry* entry=0;
- while((entry = dynamic_cast<AliCDBEntry*> (iter.Next()))){
+ if(!fIds->Contains(&entry->GetId())){
+ fIds->Add(entry->GetId().Clone());
+ }
+ if(fCache && (query.GetFirstRun() == fRun)){
CacheEntry(entry->GetId().GetPath(), entry);
}
}
+
return result;
}
TList* GetActiveStorages();
+ const TMap* GetStorageMap() const {return fStorageMap;}
+ const TList* GetRetrievedIds() const {return fIds;}
+
void SetDefaultStorage(const char* dbString);
void SetDefaultStorage(const AliCDBParam* param);
void SetDefaultStorage(AliCDBStorage *storage);
static TString fgkCondUri; // URI of the Conditions data base folder
static TString fgkRefUri; // URI of the Reference data base folder
- AliCDBParam* fCondParam; // Conditions data storage parameters
- AliCDBParam* fRefParam; // Reference data storage parameters
AliCDBManager();
AliCDBManager(const AliCDBManager & source);
TList fFactories; //! list of registered storage factories
TMap fActiveStorages; //! list of active storages
TMap fSpecificStorages; //! list of detector-specific storages
+ TMap fEntryCache; //! cache of the retrieved objects
+
+ TList* fIds; //! List of the retrieved object Id's (to be streamed to file)
+ TMap* fStorageMap; //! list of storages (to be streamed to file)
+ TList* fShortLived; //! List of short lived objects
AliCDBStorage *fDefaultStorage; //! pointer to default storage
AliCDBStorage *fRemoteStorage; //! pointer to remote storage
AliCDBStorage *fDrainStorage; //! pointer to drain storage
- TMap fEntryCache; //! cache of the retrieved objects
+ AliCDBParam* fCondParam; // Conditions data storage parameters
+ AliCDBParam* fRefParam; // Reference data storage parameters
+ Int_t fRun; //! The run number
Bool_t fCache; //! The cache flag
- Int_t fRun; //! The run number
- TList* fShortLived; //! List of short lived objects
ClassDef(AliCDBManager, 0);
};