/*
$Log$
+Revision 1.20 2006/11/16 16:16:48 jgrosseo
+introducing strict run ordering flag
+removed giving preprocessor name to preprocessor, they have to know their name themselves ;-)
+
Revision 1.19 2006/11/06 14:23:04 jgrosseo
major update (Alberto)
o) reading of run parameters from the logbook
for(int iSys=0;iSys<4;iSys++) {
fServer[iSys]=0;
if (iSys < 3)
- fFESlist[iSys].SetOwner(kTRUE);
+ fFXSlist[iSys].SetOwner(kTRUE);
}
fPreprocessorMap.SetOwner(kTRUE);
return;
}
- TString actionStr = Form("UpdateShuttleStatus - %s: Changing state from %s to %s",
+ TString actionStr = Form("UpdateShuttleStatus - %s: Changing state from %s to %s",
fCurrentDetector.Data(),
status->GetStatusName(),
status->GetStatusName(newStatus));
// Initialization
Bool_t hasError = kFALSE;
- for(Int_t iSys=0;iSys<3;iSys++) fFESCalled[iSys]=kFALSE;
+ for(Int_t iSys=0;iSys<3;iSys++) fFXSCalled[iSys]=kFALSE;
AliCDBStorage *mainCDBSto = AliCDBManager::Instance()->GetStorage(fgkMainCDB);
if(mainCDBSto) mainCDBSto->QueryCDB(GetCurrentRun());
if (result > 0)
{
- // Process successful: Update time_processed field in FES logbooks!
- if (fFESCalled[kDAQ])
+ // Process successful: Update time_processed field in FXS logbooks!
+ if (fFXSCalled[kDAQ])
{
if (UpdateDAQTable() == kFALSE)
returnCode = 1;
- fFESlist[kDAQ].Clear();
+ fFXSlist[kDAQ].Clear();
}
- //if(fFESCalled[kDCS]) {
+ //if(fFXSCalled[kDCS]) {
// if (UpdateDCSTable(aDetector->GetName()) == kFALSE)
// returnCode = 1;
- // fFESlist[kDCS].Clear();
+ // fFXSlist[kDCS].Clear();
//}
- //if(fFESCalled[kHLT]) {
+ //if(fFXSCalled[kHLT]) {
// if (UpdateHLTTable(aDetector->GetName()) == kFALSE)
// returnCode = 1;
- // fFESlist[kHLT].Clear();
+ // fFXSlist[kHLT].Clear();
//}
}
UpdateShuttleStatus(AliShuttleStatus::kDCSStarted);
- TString host(fConfig->GetDCSHost(fCurrentDetector));
- Int_t port = fConfig->GetDCSPort(fCurrentDetector);
-
- TIter iter(fConfig->GetDCSAliases(fCurrentDetector));
- TObjString* anAlias;
- TMap aliasMap;
- aliasMap.SetOwner(1);
+ TMap dcsMap;
+ dcsMap.SetOwner(1);
Bool_t aDCSError = kFALSE;
fGridError = kFALSE;
- while ((anAlias = (TObjString*) iter.Next())) {
- TObjArray *valueSet = new TObjArray();
- valueSet->SetOwner(1);
- // TODO Test only... I've added a flag that allows to
- // exclude DCS archive DB query
- if(fgkProcessDCS){
- AliInfo("Querying DCS archive DB data...");
- aDCSError = (GetValueSet(host, port, anAlias->String(), valueSet) == 0);
- } else {
- AliInfo(Form("Skipping DCS processing. Port = %d",port));
- aDCSError = kFALSE;
+ // TODO Test only... I've added a flag that allows to
+ // exclude DCS archive DB query
+ if (!fgkProcessDCS)
+ {
+ AliInfo("Skipping DCS processing!");
+ aDCSError = kFALSE;
+ } else {
+ TString host(fConfig->GetDCSHost(fCurrentDetector));
+ Int_t port = fConfig->GetDCSPort(fCurrentDetector);
+
+ // Retrieval of Aliases
+ TObjString* anAlias = 0;
+ TIter iterAliases(fConfig->GetDCSAliases(fCurrentDetector));
+ while ((anAlias = (TObjString*) iterAliases.Next()))
+ {
+ TObjArray *valueSet = new TObjArray();
+ valueSet->SetOwner(1);
+
+ AliInfo("Querying DCS archive DB (Aliases)...");
+ aDCSError = (GetValueSet(host, port, anAlias->String(), valueSet, kAlias) == 0);
+
+ if(!aDCSError)
+ {
+ dcsMap.Add(anAlias->Clone(), valueSet);
+ } else {
+ Log(fCurrentDetector,
+ Form("ProcessCurrentDetector - Error while retrieving alias %s",
+ anAlias->GetName()));
+ UpdateShuttleStatus(AliShuttleStatus::kDCSError);
+ dcsMap.DeleteAll();
+ return 0;
+ }
}
- if(!aDCSError) {
- aliasMap.Add(anAlias->Clone(), valueSet);
- }else{
- Log(fCurrentDetector, Form("ProcessCurrentDetector - Error while retrieving alias %s",
- anAlias->GetName()));
- UpdateShuttleStatus(AliShuttleStatus::kDCSError, kTRUE);
- aliasMap.DeleteAll();
- return 0;
+
+ // Retrieval of Data Points
+ TObjString* aDP = 0;
+ TIter iterDP(fConfig->GetDCSDataPoints(fCurrentDetector));
+ while ((aDP = (TObjString*) iterDP.Next()))
+ {
+ TObjArray *valueSet = new TObjArray();
+ valueSet->SetOwner(1);
+ AliInfo("Querying DCS archive DB (Data Points)...");
+ aDCSError = (GetValueSet(host, port, aDP->String(), valueSet, kDP) == 0);
+
+ if(!aDCSError)
+ {
+ dcsMap.Add(aDP->Clone(), valueSet);
+ } else {
+ Log(fCurrentDetector,
+ Form("ProcessCurrentDetector - Error while retrieving data point %s",
+ aDP->GetName()));
+ UpdateShuttleStatus(AliShuttleStatus::kDCSError);
+ dcsMap.DeleteAll();
+ return 0;
+ }
}
}
dynamic_cast<AliPreprocessor*> (fPreprocessorMap.GetValue(fCurrentDetector));
aPreprocessor->Initialize(GetCurrentRun(), GetCurrentStartTime(), GetCurrentEndTime());
- UInt_t aPPResult = aPreprocessor->Process(&aliasMap);
+ UInt_t aPPResult = aPreprocessor->Process(&dcsMap);
UInt_t returnValue = 0;
if (aPPResult == 0) { // Preprocessor error
returnValue = 2;
}
- aliasMap.DeleteAll();
+ dcsMap.DeleteAll();
return returnValue;
}
return 0;
TString sqlQuery;
- sqlQuery.Form("select * from logbook where run=%d", run);
+ sqlQuery.Form("select * from %s where run=%d", fConfig->GetDAQlbTable(), run);
TSQLResult* aResult = fServer[3]->Query(sqlQuery);
if (!aResult) {
if (!fFirstUnprocessed[GetDetPos(fCurrentDetector)])
{
Log(fCurrentDetector.Data(),
- ("TryToStoreAgain - This object has validity infinite but there are previous unprocessed runs!"));
+ ("TryToStoreAgain - This object has validity infinite but "
+ "there are previous unprocessed runs!"));
continue;
} else {
break;
}
//______________________________________________________________________________________________
-Bool_t AliShuttle::GetValueSet(const char* host, Int_t port, const char* alias,
- TObjArray* valueSet)
+Bool_t AliShuttle::GetValueSet(const char* host, Int_t port, const char* entry,
+ TObjArray* valueSet, DCSType type)
{
-// Retrieve all "alias" data points from the DCS server
+// Retrieve all "entry" data points from the DCS server
// host, port: TSocket connection parameters
-// alias: name of the alias
+// entry: name of the alias or data point
// valueSet: array of retrieved AliDCSValue's
+// type: kAlias or kDP
AliDCSClient client(host, port, fTimeout, fRetries);
- if (!client.IsConnected()) {
+ if (!client.IsConnected())
+ {
return kFALSE;
}
- Int_t result = client.GetAliasValues(alias,
- GetCurrentStartTime(), GetCurrentEndTime(), valueSet);
+ Int_t result=0;
- if (result < 0) {
+ if (type == kAlias)
+ {
+ result = client.GetAliasValues(entry,
+ GetCurrentStartTime(), GetCurrentEndTime(), valueSet);
+ } else
+ if (type == kDP)
+ {
+ result = client.GetDPValues(entry,
+ GetCurrentStartTime(), GetCurrentEndTime(), valueSet);
+ }
+
+ if (result < 0)
+ {
Log(fCurrentDetector.Data(), Form("GetValueSet - Can't get '%s'! Reason: %s",
- alias, AliDCSClient::GetErrorString(result)));
+ entry, AliDCSClient::GetErrorString(result)));
- if (result == AliDCSClient::fgkServerError) {
+ if (result == AliDCSClient::fgkServerError)
+ {
Log(fCurrentDetector.Data(), Form("GetValueSet - Server error: %s",
client.GetServerError().Data()));
}
//______________________________________________________________________________________________
Bool_t AliShuttle::Connect(Int_t system)
{
-// Connect to MySQL Server of the system's FES logbook
-// DAQ Logbook, Shuttle Logbook and DAQ FES Logbook are on the same host
+// Connect to MySQL Server of the system's FXS MySQL databases
+// DAQ Logbook, Shuttle Logbook and DAQ FXS db are on the same host
// check connection: if already connected return
if(fServer[system] && fServer[system]->IsConnected()) return kTRUE;
- TString lbHost, lbUser, lbPass;
+ TString dbHost, dbUser, dbPass, dbName;
- if (system < 3) // FES logbook servers
+ if (system < 3) // FXS db servers
{
- lbHost = Form("mysql://%s", fConfig->GetFESlbHost(system));
- lbUser = fConfig->GetFESlbUser(system);
- lbPass = fConfig->GetFESlbPass(system);
+ dbHost = Form("mysql://%s", fConfig->GetFXSdbHost(system));
+ dbUser = fConfig->GetFXSdbUser(system);
+ dbPass = fConfig->GetFXSdbPass(system);
+ dbName = fConfig->GetFXSdbName(system);
} else { // Run & Shuttle logbook servers
// TODO Will the Shuttle logbook server be the same as the Run logbook server ???
- lbHost = Form("mysql://%s", fConfig->GetDAQlbHost());
- lbUser = fConfig->GetDAQlbUser();
- lbPass = fConfig->GetDAQlbPass();
+ dbHost = Form("mysql://%s", fConfig->GetDAQlbHost());
+ dbUser = fConfig->GetDAQlbUser();
+ dbPass = fConfig->GetDAQlbPass();
+ dbName = fConfig->GetDAQlbDB();
}
- fServer[system] = TSQLServer::Connect(lbHost.Data(), lbUser.Data(), lbPass.Data());
+ fServer[system] = TSQLServer::Connect(dbHost.Data(), dbUser.Data(), dbPass.Data());
if (!fServer[system] || !fServer[system]->IsConnected()) {
if(system < 3)
{
- AliError(Form("Can't establish connection to FES logbook for %s",
+ AliError(Form("Can't establish connection to FXS database for %s",
AliShuttleInterface::GetSystemName(system)));
} else {
AliError("Can't establish connection to Run logbook.");
TSQLResult* aResult=0;
switch(system){
case kDAQ:
- aResult = fServer[kDAQ]->GetTables("REFSYSLOG");
+ aResult = fServer[kDAQ]->GetTables(dbName.Data());
break;
case kDCS:
- //aResult = fServer[kDCS]->GetTables("REFSYSLOG");
+ //aResult = fServer[kDCS]->GetTables(dbName.Data());
break;
case kHLT:
- //aResult = fServer[kHLT]->GetTables("REFSYSLOG");
+ //aResult = fServer[kHLT]->GetTables(dbName.Data());
break;
default:
- aResult = fServer[3]->GetTables("REFSYSLOG");
+ aResult = fServer[3]->GetTables(dbName.Data());
break;
}
//______________________________________________________________________________________________
const char* AliShuttle::GetDAQFileName(const char* detector, const char* id, const char* source)
{
-// Retrieves a file from the DAQ FES.
-// First queris the DAQ logbook_fs for the DAQ file name, using the run, detector, id and source info
+// Retrieves a file from the DAQ FXS.
+// First queris the DAQ FXS database for the DAQ file name, using the run, detector, id and source info
// then calls RetrieveDAQFile(DAQfilename) for actual copy to local disk
// run: current run being processed (given by Logbook entry fLogbookEntry)
// detector: the Preprocessor name
// check connection, in case connect
if (!Connect(kDAQ))
{
- Log(detector, "GetDAQFileName - Couldn't connect to DAQ Logbook");
+ Log(detector, "GetDAQFileName - Couldn't connect to DAQ FXS database");
return 0;
}
// Query preparation
- TString sqlQueryStart = "select filePath from logbook_fs where";
+ TString sqlQueryStart = Form("select filePath from %s where", fConfig->GetFXSdbTable(kDAQ));
TString whereClause = Form("run=%d and detector=\"%s\" and fileId=\"%s\" and DAQsource=\"%s\"",
GetCurrentRun(), detector, id, source);
TString sqlQuery = Form("%s %s", sqlQueryStart.Data(), whereClause.Data());
if(aResult->GetRowCount() == 0)
{
Log(detector,
- Form("GetDAQFileName - No entry in FES table for: id = %s, source = %s",
+ Form("GetDAQFileName - No entry in FXS table for: id = %s, source = %s",
id, source));
delete aResult;
return 0;
if (aResult->GetRowCount() > 1) {
Log(detector,
- Form("GetDAQFileName - More than one entry in FES table for: id = %s, source = %s",
+ Form("GetDAQFileName - More than one entry in FXS table for: id = %s, source = %s",
id, source));
delete aResult;
return 0;
TString localFileName = Form("%s_%d_%s_%s.shuttle",
detector, GetCurrentRun(), id, source);
- // file retrieval from DAQ FES
+ // file retrieval from DAQ FXS
Bool_t result = RetrieveDAQFile(filePath.Data(), localFileName.Data());
if(!result) {
- Log(detector, Form("GetDAQFileName - Copy of file %s from DAQ FES failed", filePath.Data()));
+ Log(detector, Form("GetDAQFileName - Copy of file %s from DAQ FXS failed", filePath.Data()));
return 0;
} else {
- AliInfo(Form("File %s copied from DAQ FES into %s/%s",
+ AliInfo(Form("File %s copied from DAQ FXS into %s/%s",
filePath.Data(), fgkShuttleTempDir, localFileName.Data()));
}
- fFESCalled[kDAQ]=kTRUE;
+ fFXSCalled[kDAQ]=kTRUE;
TObjString *fileParams = new TObjString(Form("%s_!?!_%s", id, source));
- fFESlist[kDAQ].Add(fileParams);
+ fFXSlist[kDAQ].Add(fileParams);
return localFileName.Data();
{
// check temp directory: trying to cd to temp; if it does not exist, create it
- AliDebug(2, Form("Copy file %s from DAQ FES into folder %s and rename it as %s",
+ AliDebug(2, Form("Copy file %s from DAQ FXS into folder %s and rename it as %s",
daqFileName,fgkShuttleTempDir, localFileName));
void* dir = gSystem->OpenDirectory(fgkShuttleTempDir);
gSystem->FreeDirectory(dir);
}
- TString baseDAQFESFolder = "DAQ";
+ TString baseDAQFXSFolder = "DAQ";
TString command = Form("scp %s@%s:%s/%s %s/%s",
- fConfig->GetFESUser(kDAQ),
- fConfig->GetFESHost(kDAQ),
- baseDAQFESFolder.Data(),
+ fConfig->GetFXSUser(kDAQ),
+ fConfig->GetFXSHost(kDAQ),
+ baseDAQFXSFolder.Data(),
daqFileName,
fgkShuttleTempDir,
localFileName);
//______________________________________________________________________________________________
TList* AliShuttle::GetDAQFileSources(const char* detector, const char* id)
{
-// Retrieves a file from the DCS FES.
+// Retrieves a file from the DCS FXS.
// check connection, in case connect
if(!Connect(kDAQ)){
- Log(detector, "GetDAQFileSources - Couldn't connect to DAQ Logbook");
+ Log(detector, "GetDAQFileSources - Couldn't connect to DAQ FXS database");
return 0;
}
// Query preparation
- TString sqlQueryStart = "select DAQsource from logbook_fs where";
+ TString sqlQueryStart = Form("select DAQsource from %s where", fConfig->GetFXSdbTable(kDAQ));
TString whereClause = Form("run=%d and detector=\"%s\" and fileId=\"%s\"",
GetCurrentRun(), detector, id);
TString sqlQuery = Form("%s %s", sqlQueryStart.Data(), whereClause.Data());
if (aResult->GetRowCount() == 0) {
Log(detector,
- Form("GetDAQFileSources - No entry in FES table for id: %s", id));
+ Form("GetDAQFileSources - No entry in FXS table for id: %s", id));
delete aResult;
return 0;
}
//______________________________________________________________________________________________
const char* AliShuttle::GetDCSFileName(const char* /*detector*/, const char* /*id*/, const char* /*source*/){
-// Retrieves a file from the DCS FES.
+// Retrieves a file from the DCS FXS.
return "You're in DCS";
//______________________________________________________________________________________________
TList* AliShuttle::GetDCSFileSources(const char* /*detector*/, const char* /*id*/){
-// Retrieves a file from the DCS FES.
+// Retrieves file sources from the DCS FXS.
return NULL;
//______________________________________________________________________________________________
const char* AliShuttle::GetHLTFileName(const char* /*detector*/, const char* /*id*/, const char* /*source*/){
-// Retrieves a file from the HLT FES.
+// Retrieves a file from the HLT FXS.
return "You're in HLT";
//______________________________________________________________________________________________
TList* AliShuttle::GetHLTFileSources(const char* /*detector*/, const char* /*id*/){
-// Retrieves a file from the HLT FES.
+// Retrieves file sources from the HLT FXS.
return NULL;
// check connection, in case connect
if(!Connect(kDAQ)){
- Log(fCurrentDetector, "UpdateDAQTable - Couldn't connect to DAQ Logbook");
+ Log(fCurrentDetector, "UpdateDAQTable - Couldn't connect to DAQ FXS database");
return kFALSE;
}
TTimeStamp now; // now
- // Loop on FES list entries
- TIter iter(&fFESlist[kDAQ]);
- TObjString *aFESentry=0;
- while((aFESentry = dynamic_cast<TObjString*> (iter.Next()))){
- TString aFESentrystr = aFESentry->String();
- TObjArray *aFESarray = aFESentrystr.Tokenize("_!?!_");
- if(!aFESarray || aFESarray->GetEntries() != 2 ) {
- Log(fCurrentDetector, Form("UpdateDAQTable - error updating FES entry. Check string: <%s>",
- aFESentrystr.Data()));
- if(aFESarray) delete aFESarray;
+ // Loop on FXS list entries
+ TIter iter(&fFXSlist[kDAQ]);
+ TObjString *aFXSentry=0;
+ while((aFXSentry = dynamic_cast<TObjString*> (iter.Next()))){
+ TString aFXSentrystr = aFXSentry->String();
+ TObjArray *aFXSarray = aFXSentrystr.Tokenize("_!?!_");
+ if(!aFXSarray || aFXSarray->GetEntries() != 2 ) {
+ Log(fCurrentDetector, Form("UpdateDAQTable - error updating FXS entry. Check string: <%s>",
+ aFXSentrystr.Data()));
+ if(aFXSarray) delete aFXSarray;
return kFALSE;
}
- const char* fileId = ((TObjString*) aFESarray->At(0))->GetName();
- const char* daqSource = ((TObjString*) aFESarray->At(1))->GetName();
+ const char* fileId = ((TObjString*) aFXSarray->At(0))->GetName();
+ const char* daqSource = ((TObjString*) aFXSarray->At(1))->GetName();
TString whereClause = Form("where run=%d and detector=\"%s\" and fileId=\"%s\" and DAQsource=\"%s\";",
GetCurrentRun(), fCurrentDetector.Data(), fileId, daqSource);
- delete aFESarray;
+ delete aFXSarray;
- TString sqlQuery = Form("update logbook_fs set time_processed=%d %s", now.GetSec(), whereClause.Data());
+ TString sqlQuery = Form("update %s set time_processed=%d %s", fConfig->GetFXSdbTable(kDAQ),
+ now.GetSec(), whereClause.Data());
AliDebug(2, Form("SQL query: \n%s",sqlQuery.Data()));
class AliShuttle: public AliShuttleInterface {
public:
+ enum DCSType {kAlias=0, kDP};
+
AliShuttle(const AliShuttleConfig* config, UInt_t timeout = 5000, Int_t retries = 5);
virtual ~AliShuttle();
Bool_t QueryShuttleLogbook(const char* whereClause, TObjArray& entries);
Bool_t RetrieveConditionsData(const TObjArray& shuttleLogbookEntries);
- Bool_t GetValueSet(const char* host, Int_t port, const char* alias, TObjArray* result);
+ Bool_t GetValueSet(const char* host, Int_t port, const char* alias,
+ TObjArray* result, DCSType type);
const char* GetDAQFileName(const char* detector, const char* id, const char* source);
Bool_t RetrieveDAQFile(const char* daqFileName, const char* localFileName);
AliShuttleLogbookEntry* fLogbookEntry; //! current Shuttle logbook entry
TString fCurrentDetector; // current detector
- TSQLServer *fServer[4]; // pointer to the three FES + Run & Shuttle logbook servers
- Bool_t fFESCalled[3]; // FES call status
- TList fFESlist[3]; // List of files retrieved from each FES
+ TSQLServer *fServer[4]; // pointer to the three FXS + Run & Shuttle logbook servers
+ Bool_t fFXSCalled[3]; // FXS call status
+ TList fFXSlist[3]; // List of files retrieved from each FXS
AliCDBEntry* fStatusEntry; // last CDB entry containing a AliShuttleStatus retrieved
Bool_t fGridError; // Grid storage error flag
/*
$Log$
+Revision 1.12 2006/11/16 16:16:48 jgrosseo
+introducing strict run ordering flag
+removed giving preprocessor name to preprocessor, they have to know their name themselves ;-)
+
Revision 1.11 2006/11/06 14:23:04 jgrosseo
major update (Alberto)
o) reading of run parameters from the logbook
TLDAPAttribute* anAttribute;
fDCSAliases = new TObjArray();
fDCSAliases->SetOwner(1);
+ fDCSDataPoints = new TObjArray();
+ fDCSDataPoints->SetOwner(1);
anAttribute = entry->GetAttribute("det"); // MUST
+ if (!anAttribute)
+ {
+ AliError(Form("Invalid configuration! No \"det\" attribute!"));
+ return;
+ }
fDetector = anAttribute->GetValue();
anAttribute = entry->GetAttribute("StrictRunOrder"); // MAY
}
anAttribute = entry->GetAttribute("DCSHost"); // MAY
- if (!anAttribute) {
+ if (!anAttribute)
+ {
AliWarning(
Form("%s has not DCS host entry - Shuttle will skip DCS data query!",
fDetector.Data()));
fDCSHost = anAttribute->GetValue();
anAttribute = entry->GetAttribute("DCSPort"); // MAY
- if (!anAttribute) {
+ if (!anAttribute)
+ {
AliError(Form("Invalid configuration! %s has DCS Host but no port number!",
fDetector.Data()));
return;
TString portStr = anAttribute->GetValue();
fDCSPort = portStr.Atoi();
- anAttribute = entry->GetAttribute("DCSAlias"); // MAY
- if (!anAttribute) {
- AliError(Form("Invalid configuration! %s has DCS host settings but no DCSAlias entries!",
- fDetector.Data()));
- return;
+ anAttribute = entry->GetAttribute("DCSalias"); // MAY
+ if (anAttribute)
+ {
+ const char* anAlias;
+ while ((anAlias = anAttribute->GetValue()))
+ {
+ fDCSAliases->AddLast(new TObjString(anAlias));
+ }
}
- const char* anAlias;
- while ((anAlias = anAttribute->GetValue())) {
- fDCSAliases->AddLast(new TObjString(anAlias));
+ anAttribute = entry->GetAttribute("DCSdatapoint"); // MAY
+ if (anAttribute)
+ {
+ const char* aDataPoint;
+ while ((aDataPoint = anAttribute->GetValue()))
+ {
+ fDCSDataPoints->AddLast(new TObjString(aDataPoint));
+ }
}
fIsValid = kTRUE;
// destructor of the shuttle configuration holder
delete fDCSAliases;
+ delete fDCSDataPoints;
}
ClassImp(AliShuttleConfig)
}
fDAQlbPass = anAttribute->GetValue();
+ anAttribute = anEntry->GetAttribute("DAQLogbookDB");
+ if (!anAttribute) {
+ AliError("Can't find DAQLogbookDB attribute!");
+ delete aResult; delete anEntry;
+ return;
+ }
+ fDAQlbDB = anAttribute->GetValue();
+
+ anAttribute = anEntry->GetAttribute("DAQLogbookTable");
+ if (!anAttribute) {
+ AliError("Can't find DAQLogbookTable attribute!");
+ delete aResult; delete anEntry;
+ return;
+ }
+ fDAQlbTable = anAttribute->GetValue();
+
+
anAttribute = anEntry->GetAttribute("MaxRetries");
if (!anAttribute) {
AliError("Can't find MaxRetries attribute!");
delete aResult; delete anEntry;
- // FES configuration (FES logbook and hosts)
+ // FXS configuration (FXS logbook and hosts)
for(int iSys=0;iSys<3;iSys++){
queryFilter = Form("(system=%s)", AliShuttleInterface::GetSystemName(iSys));
}
if (aResult->GetCount() != 1 ) {
- AliError("Error in FES configuration!");
+ AliError("Error in FXS configuration!");
delete aResult;
return;
}
anEntry = aResult->GetNext();
- anAttribute = anEntry->GetAttribute("LogbookHost");
+ anAttribute = anEntry->GetAttribute("DBHost");
if (!anAttribute) {
AliError(Form ("Can't find LogbookHost attribute for %s!!",
AliShuttleInterface::GetSystemName(iSys)));
delete aResult; delete anEntry;
return;
}
- fFESlbHost[iSys] = anAttribute->GetValue();
+ fFXSdbHost[iSys] = anAttribute->GetValue();
- anAttribute = anEntry->GetAttribute("LogbookUser");
+ anAttribute = anEntry->GetAttribute("DBUser");
if (!anAttribute) {
- AliError(Form ("Can't find LogbookUser attribute for %s!!",
+ AliError(Form ("Can't find DBUser attribute for %s!!",
AliShuttleInterface::GetSystemName(iSys)));
delete aResult; delete anEntry;
return;
}
- fFESlbUser[iSys] = anAttribute->GetValue();
+ fFXSdbUser[iSys] = anAttribute->GetValue();
- anAttribute = anEntry->GetAttribute("LogbookPassword");
+ anAttribute = anEntry->GetAttribute("DBPassword");
if (!anAttribute) {
- AliError(Form ("Can't find LogbookPassword attribute for %s!!",
+ AliError(Form ("Can't find DBPassword attribute for %s!!",
AliShuttleInterface::GetSystemName(iSys)));
delete aResult; delete anEntry;
return;
}
- fFESlbPass[iSys] = anAttribute->GetValue();
+ fFXSdbPass[iSys] = anAttribute->GetValue();
+
+ anAttribute = anEntry->GetAttribute("DBName");
+ if (!anAttribute) {
+ AliError(Form ("Can't find DBName attribute for %s!!",
+ AliShuttleInterface::GetSystemName(iSys)));
+ delete aResult; delete anEntry;
+ return;
+ }
+
+ fFXSdbName[iSys] = anAttribute->GetValue();
+ anAttribute = anEntry->GetAttribute("DBTable");
+ if (!anAttribute) {
+ AliError(Form ("Can't find DBTable attribute for %s!!",
+ AliShuttleInterface::GetSystemName(iSys)));
+ delete aResult; delete anEntry;
+ return;
+ }
+ fFXSdbTable[iSys] = anAttribute->GetValue();
anAttribute = anEntry->GetAttribute("FSHost");
if (!anAttribute) {
delete aResult; delete anEntry;
return;
}
- fFESHost[iSys] = anAttribute->GetValue();
+ fFXSHost[iSys] = anAttribute->GetValue();
anAttribute = anEntry->GetAttribute("FSUser");
if (!anAttribute) {
delete aResult; delete anEntry;
return;
}
- fFESUser[iSys] = anAttribute->GetValue();
+ fFXSUser[iSys] = anAttribute->GetValue();
anAttribute = anEntry->GetAttribute("FSPassword");
- if (anAttribute) fFESPass[iSys] = anAttribute->GetValue();
+ if (anAttribute) fFXSPass[iSys] = anAttribute->GetValue();
delete aResult; delete anEntry;
}
return aHolder->GetDCSAliases();
}
+//______________________________________________________________________________________________
+const TObjArray* AliShuttleConfig::GetDCSDataPoints(const char* detector) const
+{
+ //
+ // returns collection of TObjString which represents the set of aliases
+ // which used for data retrieval for particular detector
+ //
+
+ AliShuttleConfigHolder* aHolder = (AliShuttleConfigHolder*) fDetectorMap.GetValue(detector);
+ if (!aHolder) {
+ AliError(Form("There isn't configuration for detector: %s",
+ detector));
+ return NULL;
+ }
+
+ return aHolder->GetDCSDataPoints();
+}
+
//______________________________________________________________________________________________
Bool_t AliShuttleConfig::HostProcessDetector(const char* detector) const
{
result += Form("PP time out = %d - Max total retries = %d\n\n", fPPTimeOut, fMaxRetries);
- result += Form("DAQ Logbook Configuration \n \tHost: %s - User: %s - ",
+ result += Form("DAQ Logbook Configuration \n \tHost: %s; \tUser: %s; ",
fDAQlbHost.Data(), fDAQlbUser.Data());
- result += "Password: ";
- result.Append('*', fDAQlbPass.Length());
+// result += "Password: ";
+// result.Append('*', fDAQlbPass.Length());
+ result += Form("\tDB: %s; \tTable: %s",
+ fDAQlbDB.Data(), fDAQlbTable.Data());
+
result += "\n\n";
for(int iSys=0;iSys<3;iSys++){
- result += Form("FES Configuration for %s system\n", AliShuttleInterface::GetSystemName(iSys));
- result += Form("\tLogbook host: \t%s - \tUser: %s\n",
- fFESlbHost[iSys].Data(), fFESlbUser[iSys].Data());
- // result += Form("Logbook Password:",fFESlbPass[iSys].Data());
- result += Form("\tFES host: \t%s - \tUser: %s\n\n", fFESHost[iSys].Data(), fFESUser[iSys].Data());
- // result += Form("FES Password:",fFESPass[iSys].Data());
+ result += Form("FXS Configuration for %s system\n", AliShuttleInterface::GetSystemName(iSys));
+ result += Form("\tDB host: %s; \tUser: %s; \tName: %s; \tTable: %s\n",
+ fFXSdbHost[iSys].Data(), fFXSdbUser[iSys].Data(),
+ fFXSdbName[iSys].Data(), fFXSdbTable[iSys].Data());
+ // result += Form("DB Password:",fFXSdbPass[iSys].Data());
+ result += Form("\tFXS host: %s; \tUser: %s\n\n", fFXSHost[iSys].Data(), fFXSUser[iSys].Data());
+ // result += Form("FXS Password:",fFXSPass[iSys].Data());
}
TIter iter(fDetectorMap.GetTable());
result += Form("\tStrict run ordering flag: %s \n", aHolder->StrictRunOrder() ? "TRUE" : "FALSE");
if(aHolder->SkipDCSQuery())
{
- result += "\n\n";
+ result += "\n";
continue;
}
result += Form("\tAmanda server: %s:%d \n", aHolder->GetDCSHost(), aHolder->GetDCSPort());
- result += "\tDCS Aliases: ";
const TObjArray* aliases = aHolder->GetDCSAliases();
- TIter it(aliases);
- TObjString* anAlias;
- while ((anAlias = (TObjString*) it.Next())) {
- result += Form("%s ", anAlias->String().Data());
+ if (aliases->GetEntries() != 0)
+ {
+ result += "\tDCS Aliases: ";
+ TIter it(aliases);
+ TObjString* anAlias;
+ while ((anAlias = (TObjString*) it.Next()))
+ {
+ result += Form("%s ", anAlias->String().Data());
+ }
+ result += "\n";
}
- result += "\n\n";
+ const TObjArray* dataPoints = aHolder->GetDCSDataPoints();
+ if (dataPoints->GetEntries() != 0)
+ {
+ result += "\tDCS Data Points: ";
+ TIter it(dataPoints);
+ TObjString* aDataPoint;
+ while ((aDataPoint = (TObjString*) it.Next())) {
+ result += Form("%s ", aDataPoint->String().Data());
+ }
+ result += "\n";
+ }
+ result += "\n";
+
}
if(!fIsValid) result += "\n\n********** !!!!! Configuration is INVALID !!!!! **********\n";
const char* GetDAQlbHost() const {return fDAQlbHost.Data();}
const char* GetDAQlbUser() const {return fDAQlbUser.Data();}
const char* GetDAQlbPass() const {return fDAQlbPass.Data();}
+ const char* GetDAQlbDB() const {return fDAQlbDB.Data();}
+ const char* GetDAQlbTable() const {return fDAQlbTable.Data();}
- const char* GetFESHost(Int_t system) const {return fFESHost[system].Data();}
- const char* GetFESUser(Int_t system) const {return fFESUser[system].Data();}
- const char* GetFESPass(Int_t system) const {return fFESPass[system].Data();}
+ const char* GetFXSHost(Int_t system) const {return fFXSHost[system].Data();}
+ const char* GetFXSUser(Int_t system) const {return fFXSUser[system].Data();}
+ const char* GetFXSPass(Int_t system) const {return fFXSPass[system].Data();}
- const char* GetFESlbHost(Int_t system) const {return fFESlbHost[system].Data();}
- const char* GetFESlbUser(Int_t system) const {return fFESlbUser[system].Data();}
- const char* GetFESlbPass(Int_t system) const {return fFESlbPass[system].Data();}
+ const char* GetFXSdbHost(Int_t system) const {return fFXSdbHost[system].Data();}
+ const char* GetFXSdbUser(Int_t system) const {return fFXSdbUser[system].Data();}
+ const char* GetFXSdbPass(Int_t system) const {return fFXSdbPass[system].Data();}
+ const char* GetFXSdbName(Int_t system) const {return fFXSdbName[system].Data();}
+ const char* GetFXSdbTable(Int_t system) const {return fFXSdbTable[system].Data();}
Int_t GetMaxRetries() const { return fMaxRetries; }
const char* GetDCSHost(const char* detector) const;
Int_t GetDCSPort(const char* detector) const;
const TObjArray* GetDCSAliases(const char* detector) const;
+ const TObjArray* GetDCSDataPoints(const char* detector) const;
Bool_t StrictRunOrder(const char* detector) const;
void SetProcessAll(Bool_t flag=kTRUE) {fProcessAll=flag;}
const char* GetDCSHost() const {return fDCSHost.Data();}
Int_t GetDCSPort() const {return fDCSPort;}
const TObjArray* GetDCSAliases() const {return fDCSAliases;}
+ const TObjArray* GetDCSDataPoints() const {return fDCSDataPoints;}
Bool_t IsValid() const {return fIsValid;}
Bool_t SkipDCSQuery() const {return fSkipDCSQuery;}
TString fDCSHost; // Host name of the DCS server
Int_t fDCSPort; // port of the DCS server
TObjArray* fDCSAliases; // List of DCS aliases to be retrieved
+ TObjArray* fDCSDataPoints; // List of DCS data points to be retrieved
Bool_t fIsValid; // flag for the validity of the configuration
Bool_t fSkipDCSQuery; // flag - if TRUE (-> DCS config empty) skip DCS archive data query
Bool_t fStrictRunOrder; // flag - if TRUE connect data in a strict run ordering
TString fDAQlbHost; //! Host of the DAQ logbook MySQL Server
TString fDAQlbUser; //! username of the DAQ logbook MySQL Server
TString fDAQlbPass; //! password of the DAQ logbook MySQL Server
-
- TString fFESHost[3]; //! Host of the [DAQ, DCS, HLT] File Exchange Server
- TString fFESUser[3]; //! username of the [DAQ, DCS, HLT] File Exchange Server
- TString fFESPass[3]; //! password of the [DAQ, DCS, HLT] File Exchange Server
-
- TString fFESlbHost[3]; //! Host of the [DAQ, DCS, HLT] FES logbook
- TString fFESlbUser[3]; //! username of the [DAQ, DCS, HLT] FES logbook
- TString fFESlbPass[3]; //! password of the [DAQ, DCS, HLT] FES logbook
+ TString fDAQlbDB; //! DB name of the DAQ logbook MySQL Server
+ TString fDAQlbTable; //! Table name of the DAQ logbook MySQL Server
+
+ TString fFXSHost[3]; //! Host of the [DAQ, DCS, HLT] File eXchange Server
+ TString fFXSUser[3]; //! username of the [DAQ, DCS, HLT] File eXchange Server
+ TString fFXSPass[3]; //! password of the [DAQ, DCS, HLT] File eXchange Server
+
+ TString fFXSdbHost[3]; //! Host of the [DAQ, DCS, HLT] FXS database
+ TString fFXSdbUser[3]; //! username of the [DAQ, DCS, HLT] FXS database
+ TString fFXSdbPass[3]; //! password of the [DAQ, DCS, HLT] FXS database
+ TString fFXSdbName[3]; //! name of the [DAQ, DCS, HLT] FXS database
+ TString fFXSdbTable[3]; //! Table name of the [DAQ, DCS, HLT] FXS database
Int_t fMaxRetries; // number of retries of a failed preprocessor
void TestClient(const char* host, Int_t port, const char* request,
UInt_t startShift, UInt_t endShift) {
- gSystem->Load("libSHUTTLE");
+ gSystem->Load("$ALICE_ROOT/SHUTTLE/DCSClient/AliDCSClient");
// AliLog::EnableDebug(kFALSE);
// AliLog::SetGlobalDebugLevel(3);
void TestClientAlias(const char* host, Int_t port, const char* request,
UInt_t startShift, UInt_t endShift) {
- gSystem->Load("AliDCSClient");
+ gSystem->Load("$ALICE_ROOT/SHUTTLE/DCSClient/AliDCSClient");
// AliLog::EnableDebug(kFALSE);
// AliLog::SetGlobalDebugLevel(3);
void TestClientDP(const char* host, Int_t port, const char* request,
UInt_t startShift, UInt_t endShift) {
- gSystem->Load("AliDCSClient");
+ gSystem->Load("$ALICE_ROOT/SHUTTLE/DCSClient/AliDCSClient");
// AliLog::EnableDebug(kFALSE);
// AliLog::SetGlobalDebugLevel(3);
attributetype ( DETECTOR_CONFIG:2 NAME 'DCSHost' DESC '' EQUALITY caseIgnoreMatch SUP name )
attributetype ( DETECTOR_CONFIG:3 NAME 'DCSPort' DESC '' SUP ipServicePort )
attributetype ( DETECTOR_CONFIG:4 NAME 'DCSalias' DESC '' EQUALITY caseIgnoreMatch SUP name )
-attributetype ( DETECTOR_CONFIG:5 NAME 'StrictRunOrder' DESC 'Strict run ordering flag' EQUALITY caseIgnoreMatch SUP name )
+attributetype ( DETECTOR_CONFIG:5 NAME 'DCSdatapoint' DESC '' EQUALITY caseIgnoreMatch SUP name )
+attributetype ( DETECTOR_CONFIG:6 NAME 'StrictRunOrder' DESC 'Strict run ordering flag' EQUALITY caseIgnoreMatch SUP name )
objectclass ( DETECTOR_CONFIG
NAME 'AliShuttleDetector'
DESC 'ALICE: Shuttle configuration object.'
SUP top
- MUST (det)
- MAY (DCSHost $ DCSPort $ DCSalias $ StrictRunOrder) )
+ MUST (det $ StrictRunOrder)
+ MAY (DCSHost $ DCSPort $ DCSalias $ DCSdatapoint) )
objectidentifier SYS_CONFIG SHUTTLE_BASE:2
attributetype ( SYS_CONFIG:1 NAME 'system' DESC 'System name (DAQ, DCS, HLT)' EQUALITY caseIgnoreMatch SUP name )
-attributetype ( SYS_CONFIG:2 NAME 'LogbookHost' DESC '' EQUALITY caseIgnoreMatch SUP name )
-attributetype ( SYS_CONFIG:3 NAME 'LogbookUser' DESC '' EQUALITY caseIgnoreMatch SUP name )
-attributetype ( SYS_CONFIG:4 NAME 'LogbookPassword' DESC '' EQUALITY caseIgnoreMatch SUP name )
-attributetype ( SYS_CONFIG:5 NAME 'FSHost' DESC '' EQUALITY caseIgnoreMatch SUP name )
-attributetype ( SYS_CONFIG:6 NAME 'FSUser' DESC '' EQUALITY caseIgnoreMatch SUP name )
-attributetype ( SYS_CONFIG:7 NAME 'FSPassword' DESC '' EQUALITY caseIgnoreMatch SUP name )
+attributetype ( SYS_CONFIG:2 NAME 'DBHost' DESC '' EQUALITY caseIgnoreMatch SUP name )
+attributetype ( SYS_CONFIG:3 NAME 'DBUser' DESC '' EQUALITY caseIgnoreMatch SUP name )
+attributetype ( SYS_CONFIG:4 NAME 'DBPassword' DESC '' EQUALITY caseIgnoreMatch SUP name )
+attributetype ( SYS_CONFIG:5 NAME 'DBName' DESC '' EQUALITY caseIgnoreMatch SUP name )
+attributetype ( SYS_CONFIG:6 NAME 'DBTable' DESC '' EQUALITY caseIgnoreMatch SUP name )
+attributetype ( SYS_CONFIG:7 NAME 'FSHost' DESC '' EQUALITY caseIgnoreMatch SUP name )
+attributetype ( SYS_CONFIG:8 NAME 'FSUser' DESC '' EQUALITY caseIgnoreMatch SUP name )
+attributetype ( SYS_CONFIG:9 NAME 'FSPassword' DESC '' EQUALITY caseIgnoreMatch SUP name )
objectclass ( SYS_CONFIG
NAME 'AliShuttleSYSConfig'
DESC 'ALICE: Configuration of the Shuttle for access to online network'
SUP top
- MUST (system $ LogbookHost $ LogbookUser $ LogbookPassword $ FSHost $ FSUser )
+ MUST (system $ DBHost $ DBUser $ DBPassword $ DBName $ DBTable $ FSHost $ FSUser )
MAY ( FSPassword ) )
attributetype ( GLOBAL_CONFIG:1 NAME 'DAQLogbookHost' DESC '' EQUALITY caseIgnoreMatch SUP name )
attributetype ( GLOBAL_CONFIG:2 NAME 'DAQLogbookUser' DESC '' EQUALITY caseIgnoreMatch SUP name )
attributetype ( GLOBAL_CONFIG:3 NAME 'DAQLogbookPassword' DESC '' EQUALITY caseIgnoreMatch SUP name )
-attributetype ( GLOBAL_CONFIG:4 NAME 'MaxRetries' DESC 'number of retries for failures of a preprocessor' EQUALITY caseIgnoreMatch SUP name )
-attributetype ( GLOBAL_CONFIG:5 NAME 'PPTimeOut' DESC 'number of seconds until preprocessor is aborted' EQUALITY caseIgnoreMatch SUP name )
+attributetype ( GLOBAL_CONFIG:4 NAME 'DAQLogbookDB' DESC '' EQUALITY caseIgnoreMatch SUP name )
+attributetype ( GLOBAL_CONFIG:5 NAME 'DAQLogbookTable' DESC '' EQUALITY caseIgnoreMatch SUP name )
+attributetype ( GLOBAL_CONFIG:6 NAME 'MaxRetries' DESC 'number of retries for failures of a preprocessor' EQUALITY caseIgnoreMatch SUP name )
+attributetype ( GLOBAL_CONFIG:7 NAME 'PPTimeOut' DESC 'number of seconds until preprocessor is aborted' EQUALITY caseIgnoreMatch SUP name )
objectclass ( GLOBAL_CONFIG
NAME 'AliShuttleGlobalConfig'
DESC 'ALICE: Access to DAQ logbook settings'
SUP top
- MUST (name $ DAQLogbookHost $ DAQLogbookUser $ DAQLogbookPassword $ MaxRetries $ PPTimeOut) )
+ MUST (name $ DAQLogbookHost $ DAQLogbookUser $ DAQLogbookPassword $ DAQLogbookDB $ DAQLogbookTable $ MaxRetries $ PPTimeOut) )
objectidentifier INSTANCE_CONFIG SHUTTLE_BASE:4
// check connection: if already connected return
if(fServer && fServer->IsConnected()) return kTRUE;
- fServer = TSQLServer::Connect("mysql://pcald30.cern.ch","offline","alice");
+// TString serverHost="mysql://pcald30.cern.ch";
+ TString serverHost="mysql://pcepalice62.cern.ch";
+ fServer = TSQLServer::Connect(serverHost.Data(),"offline","alice");
+
+ printf("Connecting to mysql server on %s !!!!!!\n", serverHost.Data());
if (!fServer || !fServer->IsConnected()) {
printf("Can't establish connection to DAQ log book DB!\n");
DeleteEntries();
- AliShuttleLogbookEntry::Status y[17]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
+ AliShuttleLogbookEntry::Status y[18]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
AliShuttleLogbookEntry lb(21242, y);
- lb.SetDetectorStatus("HMP","Unprocessed"); // HMPID
- lb.SetDetectorStatus("ZDC","Unprocessed"); // ZDC
- lb.SetDetectorStatus("TPC","Unprocessed"); // TPC
- lb.SetDetectorStatus("SPD","Unprocessed"); // SPD
+// lb.SetDetectorStatus("HMP","Unprocessed"); // HMPID
+// lb.SetDetectorStatus("ZDC","Unprocessed"); // ZDC
+// lb.SetDetectorStatus("TPC","Unprocessed"); // TPC
+// lb.SetDetectorStatus("SPD","Unprocessed"); // SPD
+ lb.SetDetectorStatus("GRP","Unprocessed"); // GRP
lb.Print();
InsertNewRun(lb);
InsertNewRun(lb,21244);
InsertNewRun(lb,21245);
InsertNewRun(lb,21246);
+ InsertNewRun(lb,1000);
}