From d67e09417984b0ff2f31da152d0075086ea7eae9 Mon Sep 17 00:00:00 2001 From: rgrosso Date: Thu, 21 Feb 2013 14:14:44 +0000 Subject: [PATCH] We can now remove the deprecated methods GetLatestVersion and GetLatestSubVersion from AliCDBStorage and derived classes, following revisions 61012 and 61018. The issue was discussed in the savannah ticket #82052, which can now be closed. --- STEER/CDB/AliCDBDump.cxx | 41 ------------------- STEER/CDB/AliCDBDump.h | 2 - STEER/CDB/AliCDBGrid.cxx | 86 --------------------------------------- STEER/CDB/AliCDBGrid.h | 2 - STEER/CDB/AliCDBLocal.cxx | 43 -------------------- STEER/CDB/AliCDBLocal.h | 2 - STEER/CDB/AliCDBStorage.h | 3 -- 7 files changed, 179 deletions(-) diff --git a/STEER/CDB/AliCDBDump.cxx b/STEER/CDB/AliCDBDump.cxx index 9f002a66f14..c292db2bdce 100644 --- a/STEER/CDB/AliCDBDump.cxx +++ b/STEER/CDB/AliCDBDump.cxx @@ -767,47 +767,6 @@ Bool_t AliCDBDump::IdToFilename(const AliCDBId& /*id*/, TString& /*filename*/) c return kFALSE; } -//_____________________________________________________________________________ -Int_t AliCDBDump::GetLatestVersion(const char* path, Int_t run){ -// get last version found in the database valid for run and path - - AliCDBPath aCDBPath(path); - if(!aCDBPath.IsValid() || aCDBPath.IsWildcard()) { - AliError(Form("Invalid path in request: %s", path)); - return -1; - } - - AliCDBId query(path, run, run, -1, -1); - AliCDBId *dataId = GetId(query); - - if(!dataId) return -1; - Int_t version = dataId->GetVersion(); - - delete dataId; - return version; -} - -//_____________________________________________________________________________ -Int_t AliCDBDump::GetLatestSubVersion(const char* path, Int_t run, Int_t version){ -// get last version found in the database valid for run and path - - AliCDBPath aCDBPath(path); - if(!aCDBPath.IsValid() || aCDBPath.IsWildcard()) { - AliError(Form("Invalid path in request: %s", path)); - return -1; - } - - AliCDBId query(path, run, run, version, -1); - AliCDBId *dataId = GetId(query); - - if(!dataId) return -1; - - Int_t subVersion = dataId->GetSubVersion(); - - delete dataId; - return subVersion; - -} //_____________________________________________________________________________ void AliCDBDump::SetRetry(Int_t /* nretry */, Int_t /* initsec */) { diff --git a/STEER/CDB/AliCDBDump.h b/STEER/CDB/AliCDBDump.h index a339f57f5ff..f8500d927f1 100644 --- a/STEER/CDB/AliCDBDump.h +++ b/STEER/CDB/AliCDBDump.h @@ -25,8 +25,6 @@ public: virtual Bool_t IsReadOnly() const {return fReadOnly;}; virtual Bool_t HasSubVersion() const {return kFALSE;}; virtual Bool_t Contains(const char* path) const; - virtual Int_t GetLatestVersion(const char* path, Int_t run); - virtual Int_t GetLatestSubVersion(const char* path, Int_t run, Int_t version=-1); virtual Bool_t IdToFilename(const AliCDBId& id, TString& filename) const; virtual void SetRetry(Int_t /* nretry */, Int_t /* initsec */); diff --git a/STEER/CDB/AliCDBGrid.cxx b/STEER/CDB/AliCDBGrid.cxx index 3a853002e1e..9d1885dd3eb 100644 --- a/STEER/CDB/AliCDBGrid.cxx +++ b/STEER/CDB/AliCDBGrid.cxx @@ -1184,92 +1184,6 @@ void AliCDBGrid::MakeQueryFilter(Int_t firstRun, Int_t lastRun, } -//_____________________________________________________________________________ -Int_t AliCDBGrid::GetLatestVersion(const char* path, Int_t run){ -// get last version found in the database valid for run and path - - AliCDBPath aCDBPath(path); - if(!aCDBPath.IsValid() || aCDBPath.IsWildcard()) { - AliError(Form("Invalid path in request: %s", path)); - return -1; - } - AliCDBId query(path, run, run, -1, -1); - - AliCDBId* dataId = 0; - // look for file matching query requests (path, runRange, version) - if(run == fRun && fPathFilter.Comprises(aCDBPath) && fVersion < 0){ - // look into list of valid files previously loaded with AliCDBStorage::FillValidFileIds() - AliDebug(2, Form("List of files valid for run %d and for path %s was loaded. Looking there!", - run, path)); - dataId = GetId(fValidFileIds, query); - if (!dataId) return -1; - Int_t version = dataId->GetVersion(); - delete dataId; - return version; - - } - // List of files valid for reqested run was not loaded. Looking directly into CDB - AliDebug(2, Form("List of files valid for run %d and for path %s was not loaded. Looking directly into CDB!", - run, path)); - - TObjArray validFileIds; - validFileIds.SetOwner(1); - - TString filter; - MakeQueryFilter(run, run, 0, filter); - - TString pattern = ".root"; - - TString folderCopy(Form("%s%s/Run",fDBFolder.Data(),path)); - - AliDebug(2,Form("** fDBFolder = %s, pattern = %s, filter = %s",folderCopy.Data(), pattern.Data(), filter.Data())); - TGridResult *res = gGrid->Query(folderCopy, pattern, filter, "-y -m"); - - AliCDBId validFileId; - if (res->GetEntries()>1){ - AliWarning("Number of found entries >1, even if option -y was used"); - for(int i=0; iGetEntries(); i++){ - TString filename = res->GetKey(i, "lfn"); - if(filename == "") continue; - if(FilenameToId(filename, validFileId)) - validFileIds.AddLast(validFileId.Clone()); - } - dataId = GetId(validFileIds, query); - if (!dataId) return -1; - - Int_t version = dataId->GetVersion(); - delete dataId; - return version; - } - else if (res->GetEntries()==1){ - TString filename = res->GetKey(0, "lfn"); - if(filename == "") { - AliError("The only entry found has filename empty"); - return -1; - } - if(FilenameToId(filename, validFileId)) return validFileId.GetVersion(); - else{ - AliError("Impossible to get FileId from filename"); - return -1; - } - } - else { - AliError("No entries found"); - return -1; - } - - delete res; - - -} - -//_____________________________________________________________________________ -Int_t AliCDBGrid::GetLatestSubVersion(const char* /*path*/, Int_t /*run*/, Int_t /*version*/){ -// get last subversion found in the database valid for run and path - AliError("Objects in GRID storage have no sub version!"); - return -1; -} - ///////////////////////////////////////////////////////////////////////////////////////////////// // // diff --git a/STEER/CDB/AliCDBGrid.h b/STEER/CDB/AliCDBGrid.h index e1f684eb436..9e9de8bc909 100644 --- a/STEER/CDB/AliCDBGrid.h +++ b/STEER/CDB/AliCDBGrid.h @@ -23,8 +23,6 @@ public: virtual Bool_t IsReadOnly() const {return kFALSE;} virtual Bool_t HasSubVersion() const {return kFALSE;} virtual Bool_t Contains(const char* path) const; - virtual Int_t GetLatestVersion(const char* path, Int_t run); - virtual Int_t GetLatestSubVersion(const char* path, Int_t run, Int_t version); virtual Bool_t IdToFilename(const AliCDBId& id, TString& filename) const; virtual void SetRetry(Int_t nretry, Int_t initsec); virtual void SetMirrorSEs(const char* mirrors) {fMirrorSEs=mirrors;} diff --git a/STEER/CDB/AliCDBLocal.cxx b/STEER/CDB/AliCDBLocal.cxx index 8ffddd2c64b..ab4f8e6cc3a 100644 --- a/STEER/CDB/AliCDBLocal.cxx +++ b/STEER/CDB/AliCDBLocal.cxx @@ -905,49 +905,6 @@ void AliCDBLocal::QueryValidFiles() } -//_____________________________________________________________________________ -Int_t AliCDBLocal::GetLatestVersion(const char* path, Int_t run){ -// get last version found in the database valid for run and path - - AliCDBPath aCDBPath(path); - if(!aCDBPath.IsValid() || aCDBPath.IsWildcard()) { - AliError(Form("Invalid path in request: %s", path)); - return -1; - } - - AliCDBId query(path, run, run, -1, -1); - AliCDBId* dataId = GetId(query); - - if(!dataId) return -1; - - Int_t version = dataId->GetVersion(); - delete dataId; - - return version; - -} - -//_____________________________________________________________________________ -Int_t AliCDBLocal::GetLatestSubVersion(const char* path, Int_t run, Int_t version){ -// get last version found in the database valid for run and path - - AliCDBPath aCDBPath(path); - if(!aCDBPath.IsValid() || aCDBPath.IsWildcard()) { - AliError(Form("Invalid path in request: %s", path)); - return -1; - } - - AliCDBId query(path, run, run, version, -1); - AliCDBId *dataId = GetId(query); - - if(!dataId) return -1; - - Int_t subVersion = dataId->GetSubVersion(); - - delete dataId; - return subVersion; - -} ///////////////////////////////////////////////////////////////////////////////////////////////// // // diff --git a/STEER/CDB/AliCDBLocal.h b/STEER/CDB/AliCDBLocal.h index fc206efaf75..22f5e06e97b 100644 --- a/STEER/CDB/AliCDBLocal.h +++ b/STEER/CDB/AliCDBLocal.h @@ -22,8 +22,6 @@ public: virtual Bool_t IsReadOnly() const {return kFALSE;}; virtual Bool_t HasSubVersion() const {return kTRUE;}; virtual Bool_t Contains(const char* path) const; - virtual Int_t GetLatestVersion(const char* path, Int_t run); - virtual Int_t GetLatestSubVersion(const char* path, Int_t run, Int_t version=-1); virtual Bool_t IdToFilename(const AliCDBId& id, TString& filename) const; virtual void SetRetry(Int_t /* nretry */, Int_t /* initsec */); diff --git a/STEER/CDB/AliCDBStorage.h b/STEER/CDB/AliCDBStorage.h index 620a82559b4..d61ebd857a1 100644 --- a/STEER/CDB/AliCDBStorage.h +++ b/STEER/CDB/AliCDBStorage.h @@ -100,9 +100,6 @@ public: Int_t version=-1, AliCDBMetaData *mdFilter=0); void PrintQueryCDB(); TObjArray* GetQueryCDBList() {return &fValidFileIds;} - - virtual Int_t GetLatestVersion(const char* path, Int_t run)=0; - virtual Int_t GetLatestSubVersion(const char* path, Int_t run, Int_t version=-1)=0; virtual void SetRetry(Int_t nretry, Int_t initsec) = 0; protected: -- 2.43.0