Adding the possibility to get an oldest version, also via GetAll, by means
authorrgrosso <rgrosso@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 7 Jun 2013 15:24:07 +0000 (15:24 +0000)
committerrgrosso <rgrosso@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 7 Jun 2013 15:24:07 +0000 (15:24 +0000)
of AliCDBStorage::AddSelection
This functionality is introduced in this way for the specific purposes
described in savannah 101609.

STEER/CDB/AliCDBManager.cxx
STEER/CDB/AliCDBStorage.h

index 4c94031..d6b3ebc 100644 (file)
@@ -1160,7 +1160,7 @@ TList* AliCDBManager::GetAll(const AliCDBId& query) {
        if(!result) return 0;
 
        // loop on result to check whether entries should be re-queried with specific storages
-       if(fSpecificStorages.GetEntries()>0 && ! (fSpecificStorages.GetEntries() == 1 && aPar)) {
+       if(fSpecificStorages.GetEntries()>0 && ! (fSpecificStorages.GetEntries() == 1 && aPar) || aStorage->GetNSelections()>0 ) {
                AliInfo("Now look into all other specific storages...");
 
                TIter iter(result);
@@ -1169,17 +1169,21 @@ TList* AliCDBManager::GetAll(const AliCDBId& query) {
                while((chkEntry = dynamic_cast<AliCDBEntry*> (iter.Next()))){
                        AliCDBId& chkId = chkEntry->GetId();
                        AliDebug(2, Form("Checking id %s ", chkId.GetPath().Data()));
-                       AliCDBParam *chkPar=SelectSpecificStorage(chkId.GetPath());
-                       if (!chkPar || aPar == chkPar) continue;
-                       AliCDBStorage *chkStorage = GetStorage(chkPar);
-                       AliDebug(2, Form("Found specific storage! %s", chkPar->GetURI().Data()));
-
-                       AliCDBEntry *newEntry=0;
                        chkId.SetRunRange(query.GetFirstRun(), query.GetLastRun());
                        chkId.SetVersion(query.GetVersion());
                        chkId.SetSubVersion(query.GetSubVersion());
 
-                       if(chkStorage) newEntry = chkStorage->Get(chkId);
+                       AliCDBParam *chkPar=SelectSpecificStorage(chkId.GetPath());
+                       AliCDBStorage *chkStorage = 0;
+                       AliCDBEntry *newEntry=0;
+                       if (!chkPar || aPar == chkPar){
+                           aStorage->GetSelection(&chkId);
+                           newEntry = GetDefaultStorage()->Get(chkId);
+                       }else{
+                           chkStorage = GetStorage(chkPar);
+                           AliDebug(2, Form("Found specific storage! %s", chkPar->GetURI().Data()));
+                           newEntry = chkStorage->Get(chkId);
+                       }
                        if(!newEntry) continue;
 
                        // object is found in specific storage: replace entry in the result list!
index d61ebd8..78ca469 100644 (file)
@@ -101,11 +101,12 @@ public:
        void PrintQueryCDB();
        TObjArray* GetQueryCDBList() {return &fValidFileIds;}
        virtual void SetRetry(Int_t nretry, Int_t initsec) = 0;
+       void    GetSelection(AliCDBId* id);
+       Int_t   GetNSelections(){return fSelections.GetEntries();}
 
 protected:
 
        virtual ~AliCDBStorage();
-       void    GetSelection(/*const*/ AliCDBId* id);
        virtual AliCDBEntry* GetEntry(const AliCDBId& query) = 0;
        virtual AliCDBId* GetEntryId(const AliCDBId& query) = 0;
        virtual TList* GetEntries(const AliCDBId& query) = 0;
@@ -130,7 +131,7 @@ protected:
 
 private:
        AliCDBStorage(const AliCDBStorage & source);
-       AliCDBStorage & operator=(const AliCDBStorage & source);
+       AliCDBStorage* operator=(const AliCDBStorage & source);
 
        ClassDef(AliCDBStorage, 0);
 };