]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Changes related to the removal of the deprecated AliCDBGrid::GetLatestVersion:
authorrgrosso <rgrosso@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 20 Feb 2013 14:25:09 +0000 (14:25 +0000)
committerrgrosso <rgrosso@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 20 Feb 2013 14:25:09 +0000 (14:25 +0000)
- AliFatal is issued in AliCDBGrid::GetEntry when no CDB entry is found
- an exception is thrown in AliCDBLocal::GetEntry when no CDB entry is found
- the AliFatal is removed from AliCDBStorage::Get.
AliCDBGrid::GetLatestVersion will be made private or removed as soon as the
corresponding calls are removed from HLT code
(AliHLTPendolino, AliHLTRootSchemaEvolutionComponent, AliHLTMiscImplementation)
which is the only client of this method.

SHUTTLE/AliShuttle.cxx
STEER/CDB/AliCDBGrid.cxx
STEER/CDB/AliCDBLocal.cxx
STEER/CDB/AliCDBStorage.cxx
STEER/STEER/AliReconstruction.cxx

index a7c1833b482a611921543da02c28c12cc539a836..660e3397e6bba7535db32a734466e7ba47c4a9ff 100644 (file)
@@ -951,8 +951,12 @@ AliShuttleStatus* AliShuttle::ReadShuttleStatus()
        }
 
        Int_t path1 = GetCurrentRun()/10000;
        }
 
        Int_t path1 = GetCurrentRun()/10000;
-       fStatusEntry = AliCDBManager::Instance()->GetStorage(GetLocalCDB())
-               ->Get(Form("/SHUTTLE/%s/%d", fCurrentDetector.Data(), path1), GetCurrentRun());
+       try{
+                fStatusEntry = AliCDBManager::Instance()->GetStorage(GetLocalCDB())
+                        ->Get(Form("/SHUTTLE/%s/%d", fCurrentDetector.Data(), path1), GetCurrentRun());
+        } catch(std::exception& x) {
+                AliInfo("%s",x.what());
+        }
 
        if (!fStatusEntry) return 0;
        fStatusEntry->SetOwner(1);
 
        if (!fStatusEntry) return 0;
        fStatusEntry->SetOwner(1);
index aea48ac5772b456fbc0a4c85963457dd9d958ab2..3a853002e1ef080f154d0beff088dff396e3cb66 100644 (file)
@@ -477,20 +477,31 @@ AliCDBId* AliCDBGrid::GetEntryId(const AliCDBId& queryId) {
 AliCDBEntry* AliCDBGrid::GetEntry(const AliCDBId& queryId) {
 // get AliCDBEntry from the database
 
 AliCDBEntry* AliCDBGrid::GetEntry(const AliCDBId& queryId) {
 // get AliCDBEntry from the database
 
+        Printf("Entering AliCDBGrid::GetEntry");
+
        AliCDBId* dataId = GetEntryId(queryId);
 
        AliCDBId* dataId = GetEntryId(queryId);
 
-       if (!dataId) return NULL;
+       if (!dataId){
+                AliFatal(TString::Format("No valid CDB object found! request was: %s", queryId.ToString().Data()));
+                return NULL;
+        }
 
        TString filename;
        if (!IdToFilename(*dataId, filename)) {
                AliDebug(2,Form("Bad data ID encountered! Subnormal error!"));
                delete dataId;
 
        TString filename;
        if (!IdToFilename(*dataId, filename)) {
                AliDebug(2,Form("Bad data ID encountered! Subnormal error!"));
                delete dataId;
+                AliFatal(TString::Format("No valid CDB object found! request was: %s", queryId.ToString().Data()));
                return NULL;
        }
 
        AliCDBEntry* anEntry = GetEntryFromFile(filename, dataId);
 
        delete dataId;
                return NULL;
        }
 
        AliCDBEntry* anEntry = GetEntryFromFile(filename, dataId);
 
        delete dataId;
+       if(!anEntry){
+                Printf("follows an alifatal");
+                AliFatal(TString::Format("No valid CDB object found! request was: %s", queryId.ToString().Data()));
+        }
+
        return anEntry;
 }
 
        return anEntry;
 }
 
index f2221623478f86d7f280fa0d9f3612f2499558e0..8ffddd2c64b9f736c52d059771dc21e197212242 100644 (file)
@@ -21,6 +21,8 @@
 /////////////////////////////////////////////////////////////////////////////////////////////////
 
 #include <cstdlib>
 /////////////////////////////////////////////////////////////////////////////////////////////////
 
 #include <cstdlib>
+#include <stdexcept>
+
 #include <TSystem.h>
 #include <TObjString.h>
 #include <TRegexp.h>
 #include <TSystem.h>
 #include <TObjString.h>
 #include <TRegexp.h>
@@ -30,6 +32,7 @@
 #include "AliCDBLocal.h"
 #include "AliCDBEntry.h"
 #include "AliLog.h"
 #include "AliCDBLocal.h"
 #include "AliCDBEntry.h"
 #include "AliLog.h"
+using namespace std;
 
 ClassImp(AliCDBLocal)
 
 
 ClassImp(AliCDBLocal)
 
@@ -510,13 +513,18 @@ AliCDBEntry* AliCDBLocal::GetEntry(const AliCDBId& queryId) {
 
        AliCDBId* dataId = GetEntryId(queryId);
 
 
        AliCDBId* dataId = GetEntryId(queryId);
 
-       if (!dataId || !dataId->IsSpecified()) return NULL;
+        TString errMessage(TString::Format("No valid CDB object found! request was: %s", queryId.ToString().Data()));
+       if (!dataId || !dataId->IsSpecified()){
+                throw std::runtime_error(errMessage.Data());
+                return NULL;
+        }
 
        TString filename;
        if (!IdToFilename(*dataId, filename)) {
 
                AliDebug(2,Form("Bad data ID encountered! Subnormal error!"));
                delete dataId;
 
        TString filename;
        if (!IdToFilename(*dataId, filename)) {
 
                AliDebug(2,Form("Bad data ID encountered! Subnormal error!"));
                delete dataId;
+               throw std::runtime_error(errMessage.Data());
                return NULL;
        }
 
                return NULL;
        }
 
@@ -524,6 +532,7 @@ AliCDBEntry* AliCDBLocal::GetEntry(const AliCDBId& queryId) {
        if (!file.IsOpen()) {
                AliDebug(2,Form("Can't open file <%s>!", filename.Data()));
                delete dataId;
        if (!file.IsOpen()) {
                AliDebug(2,Form("Can't open file <%s>!", filename.Data()));
                delete dataId;
+               throw std::runtime_error(errMessage.Data());
                return NULL;
        }
 
                return NULL;
        }
 
@@ -535,6 +544,7 @@ AliCDBEntry* AliCDBLocal::GetEntry(const AliCDBId& queryId) {
                AliDebug(2,Form("Bad storage data: No AliCDBEntry in file!"));
                file.Close();
                delete dataId;
                AliDebug(2,Form("Bad storage data: No AliCDBEntry in file!"));
                file.Close();
                delete dataId;
+               throw std::runtime_error(errMessage.Data());
                return NULL;
        }
 
                return NULL;
        }
 
@@ -555,9 +565,10 @@ AliCDBEntry* AliCDBLocal::GetEntry(const AliCDBId& queryId) {
        // Check whether entry contains a TTree. In case load the tree in memory!
        LoadTreeFromFile(anEntry);
 
        // Check whether entry contains a TTree. In case load the tree in memory!
        LoadTreeFromFile(anEntry);
 
-       // close file, return retieved entry
+       // close file, return retrieved entry
        file.Close();
        delete dataId;
        file.Close();
        delete dataId;
+
        return anEntry;
 }
 
        return anEntry;
 }
 
index 2b036df58d3335ea62b20fd4698b2664b524032d..8d82c2f3009f8424e6494c8732b297e7406c8e34 100644 (file)
@@ -229,23 +229,6 @@ AliCDBEntry* AliCDBStorage::Get(const AliCDBId& query) {
        if (oldStatus != kFALSE)
                TH1::AddDirectory(kTRUE);
 
        if (oldStatus != kFALSE)
                TH1::AddDirectory(kTRUE);
 
-       if (entry) {
-               // this is to make the SHUTTLE output lighter
-               if(!(query.GetPath().Contains("SHUTTLE/STATUS")))
-                       AliDebug(2, Form("CDB object retrieved: %s", entry->GetId().ToString().Data()));
-       } else {
-               // this is to make the SHUTTLE output lighter
-               if(!(query.GetPath().Contains("SHUTTLE/STATUS"))){
-
-                       if(!(query.GetPath().Contains("SHUTTLE"))){
-                               AliFatal(Form("No valid CDB object found! request was: %s", query.ToString().Data()));
-                       }
-                       else {
-                               AliInfo(Form("No valid CDB object found! request was: %s", query.ToString().Data()));
-                       }
-               }
-       }
-
        // if drain storage is set, drain entry into drain storage
        if(entry && (AliCDBManager::Instance())->IsDrainSet())
                AliCDBManager::Instance()->Drain(entry);
        // if drain storage is set, drain entry into drain storage
        if(entry && (AliCDBManager::Instance())->IsDrainSet())
                AliCDBManager::Instance()->Drain(entry);
index 46a5d88fa1732c0b25b07f7e6b21ffae7832254d..2ca62afcb6e6cdf4706c6c533f2bd560b58e53a4 100644 (file)
@@ -1277,6 +1277,7 @@ Bool_t AliReconstruction::LoadCDB()
   // in the trigger or that are needed in order to put correct
   // information in ESD
   AliCDBManager::Instance()->GetAll("TRIGGER/*/*");
   // in the trigger or that are needed in order to put correct
   // information in ESD
   AliCDBManager::Instance()->GetAll("TRIGGER/*/*");
+  AliCDBManager::Instance()->GetAll("HLT/*/*");
 
   return kTRUE;
 }
 
   return kTRUE;
 }