]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliCDBDump.cxx
Updated version of the CDB classes. Bug fix in AliCDBGrid. New AliCDBStorage function...
[u/mrichter/AliRoot.git] / STEER / AliCDBDump.cxx
index df5c9fe4614902364f73b9e72e7fb3865d5a46ea..d40bb51f981fb0db87d0236f44b085223e77c68a 100644 (file)
@@ -46,6 +46,9 @@ fFile(NULL), fReadOnly(readOnly) {
                AliDebug(2,Form("File <%s> opened",dbFile));
                if(fReadOnly) AliDebug(2,Form("in read-only mode"));
        }
+
+       fType="dump";
+       fBaseFolder = dbFile;
 }
 
 //_____________________________________________________________________________
@@ -542,7 +545,7 @@ Bool_t AliCDBDump::PutEntry(AliCDBEntry* entry) {
        // write object (key name: Run#firstRun_#lastRun_v#version_s#subVersion)
        Bool_t result = gDirectory->WriteTObject(entry, keyname);
        if (!result) {
-               AliError(Form("Can't write entry to file: %s", 
+               AliError(Form("Can't write entry to file: %s",
                                fFile->GetName()));
        }
 
@@ -600,6 +603,61 @@ Bool_t AliCDBDump::Contains(const char* path) const{
 
 }
 
+//_____________________________________________________________________________
+void AliCDBDump::QueryValidFiles()
+{
+// Query the CDB for files valid for AliCDBStorage::fRun
+// fills list fValidFileIds with AliCDBId objects created from file name
+
+       AliError("Not yet (and maybe never) implemented");
+}
+
+//_____________________________________________________________________________
+Bool_t AliCDBDump::IdToFilename(const AliCDBId& /*id*/, TString& /*filename*/) const {
+// build file name from AliCDBId (path, run range, version) and fDBFolder
+
+       AliError("Not implemented");
+        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,dataId);
+
+       return dataId.GetVersion();
+}
+
+//_____________________________________________________________________________
+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,dataId);
+
+       return dataId.GetSubVersion();
+
+}
+
+
 /////////////////////////////////////////////////////////////////////////////////////////////////
 //                                                                                             //
 // AliCDBDump factory                                                                                 //
@@ -670,7 +728,9 @@ AliCDBStorage* AliCDBDumpFactory::Create(const AliCDBParam* param) {
 ClassImp(AliCDBDumpParam)
 
 //_____________________________________________________________________________
-AliCDBDumpParam::AliCDBDumpParam() {
+AliCDBDumpParam::AliCDBDumpParam():
+fDBPath(), fReadOnly(kFALSE)
+{
 // default constructor
 
 }