]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
update (alberto):
authorjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 7 Dec 2006 08:51:26 +0000 (08:51 +0000)
committerjgrosseo <jgrosseo@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 7 Dec 2006 08:51:26 +0000 (08:51 +0000)
table, db names in ldap configuration
added GRP preprocessor
DCS data can also be retrieved by data point

SHUTTLE/AliShuttle.cxx
SHUTTLE/AliShuttle.h
SHUTTLE/AliShuttleConfig.cxx
SHUTTLE/AliShuttleConfig.h
SHUTTLE/DCSClient/macros/TestClient.C
SHUTTLE/DCSClient/macros/TestClientAlias.C
SHUTTLE/DCSClient/macros/TestClientDP.C
SHUTTLE/schema/shuttle.schema
SHUTTLE/test/TestHMPIDPreprocessor.cxx [moved from SHUTTLE/test/TestRICHPreprocessor.cxx with 100% similarity]
SHUTTLE/test/TestHMPIDPreprocessor.h [moved from SHUTTLE/test/TestRICHPreprocessor.h with 100% similarity]
SHUTTLE/test/TestShuttleLogbook.C

index afa94a777f5bb3594ee883093f9f418214a2ea9a..2fc32d1453b32e58bcc809699da9648faa6cae86 100644 (file)
 
 /*
 $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
@@ -193,7 +197,7 @@ fLastAction()
        for(int iSys=0;iSys<4;iSys++) {
                fServer[iSys]=0;
                if (iSys < 3)
-                       fFESlist[iSys].SetOwner(kTRUE);
+                       fFXSlist[iSys].SetOwner(kTRUE);
        }
        fPreprocessorMap.SetOwner(kTRUE);
 
@@ -419,7 +423,7 @@ void AliShuttle::UpdateShuttleStatus(AliShuttleStatus::Status newStatus, Bool_t
                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));
@@ -545,7 +549,7 @@ Bool_t AliShuttle::Process(AliShuttleLogbookEntry* entry)
 
        // 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());
@@ -656,22 +660,22 @@ Bool_t AliShuttle::Process(AliShuttleLogbookEntry* entry)
 
                        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();
                                //}
                        }
 
@@ -735,37 +739,67 @@ UInt_t AliShuttle::ProcessCurrentDetector()
 
        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;
+                       }
                }
        }
 
@@ -776,7 +810,7 @@ UInt_t AliShuttle::ProcessCurrentDetector()
                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
@@ -793,7 +827,7 @@ UInt_t AliShuttle::ProcessCurrentDetector()
                returnValue = 2;
        }
 
-       aliasMap.DeleteAll();
+       dcsMap.DeleteAll();
 
        return returnValue;
 }
@@ -875,7 +909,7 @@ AliShuttleLogbookEntry* AliShuttle::QueryRunParameters(Int_t run)
                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) {
@@ -1004,7 +1038,8 @@ Bool_t AliShuttle::TryToStoreAgain(TString& gridURI)
                                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;
@@ -1057,27 +1092,41 @@ Bool_t AliShuttle::TryToStoreAgain(TString& gridURI)
 }
 
 //______________________________________________________________________________________________
-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()));
                }
@@ -1138,31 +1187,33 @@ TList* AliShuttle::GetFileSources(Int_t system, const char* detector, const char
 //______________________________________________________________________________________________
 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.");
@@ -1176,16 +1227,16 @@ Bool_t AliShuttle::Connect(Int_t system)
        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;
        }
 
@@ -1196,8 +1247,8 @@ Bool_t AliShuttle::Connect(Int_t system)
 //______________________________________________________________________________________________
 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
@@ -1207,12 +1258,12 @@ const char* AliShuttle::GetDAQFileName(const char* detector, const char* id, con
        // 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());
@@ -1231,7 +1282,7 @@ const char* AliShuttle::GetDAQFileName(const char* detector, const char* id, con
        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;
@@ -1239,7 +1290,7 @@ const char* AliShuttle::GetDAQFileName(const char* detector, const char* id, con
 
        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;
@@ -1265,20 +1316,20 @@ const char* AliShuttle::GetDAQFileName(const char* detector, const char* id, con
        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();
 
@@ -1289,7 +1340,7 @@ Bool_t AliShuttle::RetrieveDAQFile(const char* daqFileName, const char* localFil
 {
 
        // 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);
@@ -1303,11 +1354,11 @@ Bool_t AliShuttle::RetrieveDAQFile(const char* daqFileName, const char* localFil
                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);
@@ -1330,16 +1381,16 @@ Bool_t AliShuttle::RetrieveDAQFile(const char* daqFileName, const char* localFil
 //______________________________________________________________________________________________
 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());
@@ -1356,7 +1407,7 @@ TList* AliShuttle::GetDAQFileSources(const char* detector, const char* id)
 
        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;
        }
@@ -1380,7 +1431,7 @@ TList* AliShuttle::GetDAQFileSources(const char* detector, const char* id)
 
 //______________________________________________________________________________________________
 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";
 
@@ -1388,7 +1439,7 @@ 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;
 
@@ -1396,7 +1447,7 @@ 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";
 
@@ -1404,7 +1455,7 @@ 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;
 
@@ -1417,32 +1468,33 @@ Bool_t AliShuttle::UpdateDAQTable()
 
        // 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()));
 
index 037d17690ce77033e6c2d3c2e59063d7a3e38d08..0ca82eaee65e958b3ff5b5a468b243fa993b746b 100644 (file)
@@ -33,6 +33,8 @@ class TMutex;
 
 class AliShuttle: public AliShuttleInterface {
 public:
+       enum DCSType {kAlias=0, kDP};
+
        AliShuttle(const AliShuttleConfig* config, UInt_t timeout = 5000, Int_t retries = 5);
        virtual ~AliShuttle();
 
@@ -87,7 +89,8 @@ private:
        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);
@@ -134,9 +137,9 @@ private:
        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
index 3bd09021b163f3194a85f68c91ec14ab7122cc43..c638661554f4c963fd179276e0099a78d9ea1852 100644 (file)
 
 /*
 $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
@@ -117,8 +121,15 @@ fStrictRunOrder(kFALSE)
        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
@@ -137,7 +148,8 @@ fStrictRunOrder(kFALSE)
        }
 
        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()));
@@ -149,7 +161,8 @@ fStrictRunOrder(kFALSE)
        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;
@@ -157,16 +170,24 @@ fStrictRunOrder(kFALSE)
        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;
@@ -180,6 +201,7 @@ AliShuttleConfig::AliShuttleConfigHolder::~AliShuttleConfigHolder()
 // destructor of the shuttle configuration holder
 
        delete fDCSAliases;
+       delete fDCSDataPoints;
 }
 
 ClassImp(AliShuttleConfig)
@@ -330,6 +352,23 @@ AliShuttleConfig::AliShuttleConfig(const char* host, Int_t port,
        }
        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!");
@@ -350,7 +389,7 @@ AliShuttleConfig::AliShuttleConfig(const char* host, Int_t port,
 
        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));
@@ -362,39 +401,57 @@ AliShuttleConfig::AliShuttleConfig(const char* host, Int_t port,
                }
 
                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) {
@@ -403,7 +460,7 @@ AliShuttleConfig::AliShuttleConfig(const char* host, Int_t port,
                        delete aResult; delete anEntry;
                        return;
                }
-               fFESHost[iSys] = anAttribute->GetValue();
+               fFXSHost[iSys] = anAttribute->GetValue();
 
                anAttribute = anEntry->GetAttribute("FSUser");
                if (!anAttribute) {
@@ -412,10 +469,10 @@ AliShuttleConfig::AliShuttleConfig(const char* host, Int_t port,
                        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;
        }
@@ -506,6 +563,24 @@ const TObjArray* AliShuttleConfig::GetDCSAliases(const char* detector) const
        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
 {
@@ -560,20 +635,24 @@ void AliShuttleConfig::Print(Option_t* /*option*/) 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());
@@ -584,21 +663,38 @@ void AliShuttleConfig::Print(Option_t* /*option*/) const
                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";
index dcabee43be31eeccf95e085b6146f1ee39873d3a..4db461edc43ff6d665b53779c9598cfc9aa4ba4e 100644 (file)
@@ -30,14 +30,18 @@ public:
        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; }
 
@@ -49,6 +53,7 @@ public:
        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;}
@@ -69,6 +74,7 @@ private:
                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;}
@@ -79,6 +85,7 @@ private:
                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
@@ -93,14 +100,18 @@ private:
        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
 
index 90a2a2330929d7093393514e1f21ff2b592f697f..37b00dd34e4a0bdae57b62c8d0db12cef60eb89a 100644 (file)
@@ -87,7 +87,7 @@ void GetValues(const char* host, Int_t port, const char* request,
 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);
index 727aa11836e85dbeb0459a2cdca7898f01f8d595..38a706951852021b83b47d2ace6ae25c1d2c9990 100644 (file)
@@ -95,7 +95,7 @@ void GetValues(const char* host, Int_t port, const char* request,
 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);
index 4ff54d38ec47549e7df0ae2f29cbd7b8dc9196ad..f99de6c991808897ec541c01e178fd279ce0bce5 100644 (file)
@@ -96,7 +96,7 @@ void GetValues(const char* host, Int_t port, const char* request,
 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);
index ef6841ac2cd32ea16c37c2458682b706648faeb8..9e365e8a651f73d170e54c39f635a883a92bc554 100644 (file)
@@ -6,31 +6,34 @@ attributetype ( DETECTOR_CONFIG:1 NAME 'det'         DESC 'Detector name'
 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 ) )
 
 
@@ -39,14 +42,16 @@ objectidentifier GLOBAL_CONFIG SHUTTLE_BASE:3
 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
index 5ef9795168080350d87924773ae22fc9498e7618..fc5e0f4673be009640d3eba4037794797151faac 100644 (file)
@@ -8,7 +8,11 @@ Bool_t Connect(){
        // 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");
@@ -282,12 +286,13 @@ void TestShuttleLogbook(){
        
        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);
@@ -295,5 +300,6 @@ void TestShuttleLogbook(){
        InsertNewRun(lb,21244);
        InsertNewRun(lb,21245);
        InsertNewRun(lb,21246);
+       InsertNewRun(lb,1000);
 
 }