AliDebug(2,Form("File <%s> opened",dbFile));
if(fReadOnly) AliDebug(2,Form("in read-only mode"));
}
+
+ fType="dump";
+ fBaseFolder = dbFile;
}
//_____________________________________________________________________________
if(lastStorage.Contains(TString("new"), TString::kIgnoreCase) &&
id.GetSubVersion() > 0 ){
- AliWarning(Form("A NEW object is being stored with version v%d_s%d",
+ AliDebug(2, Form("A NEW object is being stored with version v%d_s%d",
id.GetVersion(),id.GetSubVersion()));
- AliWarning(Form("and it will hide previously stored object with v%d_s%d!",
+ AliDebug(2, Form("and it will hide previously stored object with v%d_s%d!",
id.GetVersion(),id.GetSubVersion()-1));
}
aRunRange.GetLastRun());
} else if (result.GetVersion() == aVersion
&& result.GetSubVersion() == aSubVersion){
- AliError(Form("More than one object valid for run %d, version %d_%d!",
+ AliDebug(2,Form("More than one object valid for run %d, version %d_%d!",
query.GetFirstRun(), aVersion, aSubVersion));
result.SetRunRange(-1,-1); result.SetVersion(-1); result.SetSubVersion(-1);
return kFALSE;
// aVersion is requested version!
if(result.GetSubVersion() == aSubVersion){
- AliError(Form("More than one object valid for run %d, version %d_%d!",
+ AliDebug(2,Form("More than one object valid for run %d, version %d_%d!",
query.GetFirstRun(), aVersion, aSubVersion));
result.SetRunRange(-1,-1); result.SetVersion(-1); result.SetSubVersion(-1);
return kFALSE;
// aVersion and aSubVersion are requested version and subVersion!
if(result.GetVersion() == aVersion && result.GetSubVersion() == aSubVersion){
- AliError(Form("More than one object valid for run %d, version %d_%d!",
+ AliDebug(2,Form("More than one object valid for run %d, version %d_%d!",
query.GetFirstRun(), aVersion, aSubVersion));
result.SetRunRange(-1,-1); result.SetVersion(-1); result.SetSubVersion(-1);
return kFALSE;
TString keyname;
if (!IdToKeyName(dataId.GetAliCDBRunRange(), dataId.GetVersion(),
dataId.GetSubVersion(), keyname)) {
- AliError("Bad ID encountered! Subnormal error!");
+ AliDebug(2,Form("Bad ID encountered! Subnormal error!"));
return NULL;
}
TObject* anObject = gDirectory->Get(keyname);
if (!anObject) {
- AliError("Bad storage data: NULL entry object!");
+ AliDebug(2,Form("Bad storage data: NULL entry object!"));
return NULL;
}
if (AliCDBEntry::Class() != anObject->IsA()) {
- AliError("Bad storage data: Invalid entry object!");
+ AliDebug(2,Form("Bad storage data: Invalid entry object!"));
return NULL;
}
// 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()));
}
}
+//_____________________________________________________________________________
+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 //
ClassImp(AliCDBDumpParam)
//_____________________________________________________________________________
-AliCDBDumpParam::AliCDBDumpParam() {
+AliCDBDumpParam::AliCDBDumpParam():
+fDBPath(), fReadOnly(kFALSE)
+{
// default constructor
}