/*
$Log$
+Revision 1.4 2006/07/04 14:59:57 jgrosseo
+revision of AliDCSValue: Removed wrapper classes, reduced storage size per value by factor 2
+
Revision 1.3 2006/06/12 09:11:16 jgrosseo
coding conventions (Alberto)
fSocket->SetOption(kNoBlock, 1);
break;
}
-
+
AliDebug(1, Form("Connection timeout! tries <%d> ...", tries));
delete fSocket;
//______________________________________________________________________
AliDCSClient::AliDCSClient(const AliDCSClient& /*other*/):
-TObject()
+ TObject(), fSocket(NULL), fTimeout(0), fRetries(0),
+ fServerErrorCode(AliDCSMessage::kNoneError), fServerError("")
+
{
// copy constructor (not implemented)
/*
$Log$
+Revision 1.5 2006/07/20 09:54:40 jgrosseo
+introducing status management: The processing per subdetector is divided into several steps,
+after each step the status is stored on disk. If the system crashes in any of the steps the Shuttle
+can keep track of the number of failures and skips further processing after a certain threshold is
+exceeded. These thresholds can be configured in LDAP.
+
Revision 1.4 2006/07/04 14:59:57 jgrosseo
revision of AliDCSValue: Removed wrapper classes, reduced storage size per value by factor 2
//______________________________________________________________________
AliDCSMessage::AliDCSMessage():
- fMessage(NULL), fMessageSize(0), fType(kInvalid)
+ fMessage(NULL), fMessageSize(0), fType(kInvalid),
+ fStartTime(0), fEndTime(0),
+ fRequestString(""), fCount(0),
+ fValueType(AliDCSValue::kInvalid), fValues(),
+ fErrorCode(kNoneError), fErrorString(""),
+ fRequestStrings()
{
// default constructor
//______________________________________________________________________
AliDCSMessage::AliDCSMessage(const char* message, UInt_t size):
- fMessageSize(size), fType(kInvalid)
+ fMessageSize(size), fType(kInvalid),
+ fStartTime(0), fEndTime(0),
+ fRequestString(""), fCount(0),
+ fValueType(AliDCSValue::kInvalid), fValues(),
+ fErrorCode(kNoneError), fErrorString(""),
+ fRequestStrings()
{
// default constructor
//______________________________________________________________________
AliDCSMessage::AliDCSMessage(const AliDCSMessage& /*other*/):
-TObject()
+ TObject(), fMessage(NULL), fMessageSize(0), fType(kInvalid),
+ fStartTime(0), fEndTime(0),
+ fRequestString(""), fCount(0),
+ fValueType(AliDCSValue::kInvalid), fValues(),
+ fErrorCode(kNoneError), fErrorString(""),
+ fRequestStrings()
{
// copy constructor (not implemented)
/*
$Log$
+Revision 1.12 2006/08/08 14:19:29 jgrosseo
+Update to shuttle classes (Alberto)
+
+- Possibility to set the full object's path in the Preprocessor's and
+Shuttle's Store functions
+- Possibility to extend the object's run validity in the same classes
+("startValidity" and "validityInfinite" parameters)
+- Implementation of the StoreReferenceData function to store reference
+data in a dedicated CDB storage.
+
Revision 1.11 2006/07/21 07:37:20 jgrosseo
last run is stored after each run
ClassImp(AliShuttle)
+TString AliShuttle::fgkMainCDB("alien://DBFolder=ShuttleCDB");
TString AliShuttle::fgkLocalCDB("local://LocalShuttleCDB");
TString AliShuttle::fgkMainRefStorage("alien://DBFolder=ShuttleReference");
TString AliShuttle::fgkLocalRefStorage("local://LocalReferenceStorage");
+Bool_t AliShuttle::fgkProcessDCS(kTRUE);
+
+
const char* AliShuttle::fgkShuttleTempDir = gSystem->ExpandPathName("$ALICE_ROOT/SHUTTLE/temp");
const char* AliShuttle::fgkShuttleLogDir = gSystem->ExpandPathName("$ALICE_ROOT/SHUTTLE/log");
//______________________________________________________________________________________________
AliShuttle::AliShuttle(const AliShuttleConfig* config,
UInt_t timeout, Int_t retries):
- fConfig(config),
- fTimeout(timeout),
- fRetries(retries), fCurrentRun(-1), fCurrentStartTime(0),
- fCurrentEndTime(0), fStatusEntry(0)
+fConfig(config),
+fTimeout(timeout), fRetries(retries),
+fPreprocessorMap(),
+fCurrentRun(-1),
+fCurrentStartTime(0), fCurrentEndTime(0),
+fCurrentDetector(""),
+fStatusEntry(0)
{
//
// config: AliShuttleConfig used
//______________________________________________________________________
AliShuttle::AliShuttle(const AliShuttle& /*other*/):
-AliShuttleInterface()
+AliShuttleInterface(),
+fConfig(0),
+fTimeout(0), fRetries(0),
+fPreprocessorMap(),
+fCurrentRun(-1),
+fCurrentStartTime(0), fCurrentEndTime(0),
+fCurrentDetector(""),
+fStatusEntry(0)
+
{
// copy constructor (not implemented)
UInt_t result = 0;
- if (!(AliCDBManager::Instance()->IsDefaultStorageSet())) {
- Log(fCurrentDetector, "No CDB storage set!");
+ if (!(AliCDBManager::Instance()->GetStorage(fgkMainCDB))) {
+ Log(fCurrentDetector, "Cannot activate main CDB storage!");
} else {
- result = (UInt_t) AliCDBManager::Instance()->Put(object, id, metaData);
+ result = (UInt_t) AliCDBManager::Instance()->GetStorage(fgkMainCDB)
+ ->Put(object, id, metaData);
}
+
if(!result) {
Log(fCurrentDetector,
while ((anAlias = (TObjString*) iter.Next())) {
TObjArray valueSet;
- //result = GetValueSet(host, port, anAlias->String(), valueSet);
- AliInfo(Form("Port = %d",port));
- result = kTRUE;
+ // TODO Test only... I've added a flag that allows to
+ // exclude DCS archive DB query
+ if(fgkProcessDCS){
+ AliInfo("Querying DCS archive DB data...");
+ result = GetValueSet(host, port, anAlias->String(), valueSet);
+ } else {
+ AliInfo(Form("Skipping DCS processing. Port = %d",port));
+ result = kTRUE;
+ }
if(result) {
aliasMap.Add(anAlias->Clone(), valueSet.Clone());
}else{
if(aPreprocessor)
{
aPreprocessor->Initialize(fCurrentRun, fCurrentStartTime, fCurrentEndTime);
+
+ // TODO Think about what to do in case of "Grid storage error"
+ // (-> object put in local backup storage, return 2)
hasError = (aPreprocessor->Process(&aliasMap) == 0);
}else{
// TODO default behaviour?
virtual TList* GetFileSources(Int_t system, const char* detector, const char* id);
virtual void Log(const char* detector, const char* message);
+ static TString GetMainCDB () {return fgkMainCDB;}
+ static void SetMainCDB (TString mainCDB) {fgkMainCDB = mainCDB;}
static TString GetLocalCDB () {return fgkLocalCDB;}
static void SetLocalCDB (TString localCDB) {fgkLocalCDB = localCDB;}
static TString GetMainRefStorage() {return fgkMainRefStorage;}
static void SetMainRefStorage (TString mainRefStorage) {fgkMainRefStorage = mainRefStorage;}
-
static TString GetLocalRefStorage() {return fgkLocalRefStorage;}
static void SetLocalRefStorage (TString localRefStorage) {fgkLocalRefStorage = localRefStorage;}
// TODO Test only, remove later!
void SetCurrentRun(int run) {fCurrentRun=run;}
+ //TODO Test only, remove later !
+ void SetProcessDCS(Bool_t process) {fgkProcessDCS = process;}
static const char* GetDetCode(const char* detector);
static const char* GetShuttleTempDir() {return fgkShuttleTempDir;}
// Bool_t RetrieveHLTFile(const char* daqFileName, const char* localFileName;
TList* GetHLTFileSources(const char* detector, const char* id);
- AliShuttleStatus* ReadShuttleStatus();
- Bool_t WriteShuttleStatus(AliShuttleStatus* status);
- Bool_t ContinueProcessing();
- void UpdateShuttleStatus(AliShuttleStatus::Status newStatus, Bool_t increaseCount = kFALSE);
+ AliShuttleStatus* ReadShuttleStatus();
+ Bool_t WriteShuttleStatus(AliShuttleStatus* status);
+ Bool_t ContinueProcessing();
+ void UpdateShuttleStatus(AliShuttleStatus::Status newStatus, Bool_t increaseCount = kFALSE);
const AliShuttleConfig* fConfig; //! pointer to configuration object
static const Int_t fgkNDetectors = 17; //! number of detectors
static const char* fgkDetectorName[fgkNDetectors]; //! names of detectors
static const char* fgkDetectorCode[fgkNDetectors]; //! codes of detectors
- static TString fgkLocalCDB; //! URI of the local backup storage
+ static TString fgkMainCDB; //! URI of the main (Grid) CDB storage
+ static TString fgkLocalCDB; //! URI of the local backup CDB storage
static TString fgkMainRefStorage; //! URI of the main (Grid) REFERENCE storage
static TString fgkLocalRefStorage; //! URI of the local REFERENCE storage
static const char* fgkShuttleTempDir; //! base path of SHUTTLE temp folder
UInt_t fCurrentStartTime; //! Run Start time
UInt_t fCurrentEndTime; //! Run end time
- TString fCurrentDetector; // current detector
+ TString fCurrentDetector; // current detector
TSQLServer *fServer[3]; //! pointer to the three FS logbook servers
Bool_t fFESCalled[3]; //! FES call status
TList fFESlist[3]; //! List of files retrieved from each FES
- AliCDBEntry* fStatusEntry; //! last CDB entry containing a AliShuttleStatus retrieved
+ AliCDBEntry* fStatusEntry; //! last CDB entry containing a AliShuttleStatus retrieved
+
+ //TODO Test only, remove later !
+ static Bool_t fgkProcessDCS; // flag to enable DCS archive data processing
ClassDef(AliShuttle, 0);
};
/*
$Log$
+Revision 1.7 2006/07/20 09:54:40 jgrosseo
+introducing status management: The processing per subdetector is divided into several steps,
+after each step the status is stored on disk. If the system crashes in any of the steps the Shuttle
+can keep track of the number of failures and skips further processing after a certain threshold is
+exceeded. These thresholds can be configured in LDAP.
+
Revision 1.6 2006/07/19 10:09:55 jgrosseo
new configuration, accesst to DAQ FES (Alberto)
AliShuttleConfig::AliShuttleConfig(const char* host, Int_t port,
const char* binddn, const char* password, const char* basedn):
fIsValid(kFALSE),
+ fDAQlbHost(""), fDAQlbUser(""), fDAQlbPass(""),
+ fMaxPPRetries(0), fMaxRetries(0),
+ fDetectorMap(), fDetectorList(),
+ fShuttleInstanceHost(""), fProcessedDetectors(),
fProcessAll(kFALSE)
{
//
/*
$Log$
+Revision 1.1 2006/07/20 13:20:13 jgrosseo
+introducing status management: The processing per subdetector is divided into several steps,
+after each step the status is stored on disk. If the system crashes in any of the steps the Shuttle
+can keep track of the number of failures and skips further processing after a certain threshold is
+exceeded. These thresholds can be configured in LDAP.
+
*/
//
fTimeStamp = time(0);
}
-AliShuttleStatus::AliShuttleStatus(const AliShuttleStatus& c) : TObject(c)
+AliShuttleStatus::AliShuttleStatus(const AliShuttleStatus& c) :
+TObject(c), fTimeStamp(0),
+fStatus(kInvalid),
+fCount(1)
{
// copy constructor
/*
$Log$
+ Revision 1.9 2006/08/08 14:19:29 jgrosseo
+ Update to shuttle classes (Alberto)
+
+ - Possibility to set the full object's path in the Preprocessor's and
+ Shuttle's Store functions
+ - Possibility to extend the object's run validity in the same classes
+ ("startValidity" and "validityInfinite" parameters)
+ - Implementation of the StoreReferenceData function to store reference
+ data in a dedicated CDB storage.
+
Revision 1.8 2006/07/21 07:37:20 jgrosseo
last run is stored after each run
//______________________________________________________________________
TerminateSignalHandler::TerminateSignalHandler(const TerminateSignalHandler& /*other*/):
-TSignalHandler()
+TSignalHandler(), fTrigger()
{
// copy constructor (not implemented)
AliShuttleTrigger::AliShuttleTrigger(const AliShuttleConfig* config,
UInt_t timeout, Int_t retries):
fConfig(config), fShuttle(NULL),
- fNotified(kFALSE), fTerminate(kFALSE), fLastRun(0), fCondition(&fMutex),
- fQuitSignalHandler(this, kSigQuit),
+ fNotified(kFALSE), fTerminate(kFALSE), fLastRun(0),
+ fMutex(), fCondition(&fMutex),
+ fQuitSignalHandler(this, kSigQuit),
fInterruptSignalHandler(this, kSigInterrupt)
{
//
//______________________________________________________________________
AliShuttleTrigger::AliShuttleTrigger(const AliShuttleTrigger& /*other*/):
-TObject()
+ TObject(), fConfig(), fShuttle(NULL),
+ fNotified(kFALSE), fTerminate(kFALSE), fLastRun(0),
+ fMutex(), fCondition(&fMutex),
+ fQuitSignalHandler(this, kSigQuit),
+ fInterruptSignalHandler(this, kSigInterrupt)
+
{
// copy constructor (not implemented)
#include "AliShuttleTrigger.h"
-void DATENotifier::infoHandler() {
+//______________________________________________________________________
+void DATENotifier::infoHandler()
+{
+// Info handler
+
AliInfoGeneral("DATENotifier::infoHandler()",
"DATE notification received ...");
fTrigger->Notify();
}
-void DATENotifier::errorHandler(int severity, int code, char *msg) {
+//______________________________________________________________________
+void DATENotifier::errorHandler(int severity, int code, char *msg)
+{
+// Error handler
AliInfoGeneral("DATENotifier::errorHandler()",
Form("DIM Error: severity<%d>, code<%d> , message<%s>",
severity, code, msg));
}
+
+//______________________________________________________________________
+DATENotifier::DATENotifier(const DATENotifier& /*other*/):
+DimInfo(), fTrigger(0) {
+// copy constructor (not implemented)
+
+}
void infoHandler();
- void errorHandler(int severity, int code, char *msg);
+ void errorHandler(int severity, int code, char *msg);
+private:
+ DATENotifier(const DATENotifier& other);
};
#endif
void Shuttle(const char* param = "listen") {
+ // WARNING: if ldap is built with ssl support it may cause confilcts with the
+ // AliEn interface. If this happens, grid storage activation must be done BEFORE
+ // loading LDAP libraries!!!
+
+ gSystem->Load("libRLDAP.so");
gSystem->Load("libSHUTTLE");
gSystem->Load("$ROOTSYS/lib/libThread");
gSystem->Load("$ALICE_ROOT/SHUTTLE/test/libTest.so");
// AliLog::SetGlobalDebugLevel(1);
- AliCDBManager *man = AliCDBManager::Instance();
- man->SetDefaultStorage("local://MainCDB");
+ // Setting local CDB and reference storage locations
+ AliShuttle::SetMainCDB("alien://DBFolder=ShuttleCDB");
+ AliShuttle::SetLocalCDB("local://LocalShuttleCDB");
+ AliShuttle::SetMainRefStorage("alien://DBFolder=GridReferenceStorage");
+ AliShuttle::SetLocalRefStorage("local://LocalReferenceStorage");
+
+ AliShuttle::SetProcessDCS(kTRUE);
+
+
+// AliCDBManager *man = AliCDBManager::Instance();
+// man->SetDefaultStorage("local://MainCDB");
// man->SetDefaultStorage("alien://DBFolder=ShuttleMainCDB");
- AliShuttleConfig config("pcalice290.cern.ch", 389,
- "o=alice,dc=cern,dc=ch");
+
+ AliShuttleConfig config("pcalice290.cern.ch", 389, "o=alice,dc=cern,dc=ch");
config.SetProcessAll(kTRUE);
config.Print();
AliShuttle* shuttle = trigger.GetShuttle();
// Add here detectors preprocessor ...
- //TestTPCPreprocessor *tpcPrep = new TestTPCPreprocessor("TPC",shuttle);
- //TestITSPreprocessor *itsPrep = new TestITSPreprocessor("ITS",shuttle);
+ TestTPCPreprocessor *tpcPrep = new TestTPCPreprocessor("TPC",shuttle);
+ TestITSPreprocessor *itsPrep = new TestITSPreprocessor("ITS",shuttle);
TestRICHPreprocessor *richPrep = new TestRICHPreprocessor("RICH",shuttle);
TString paramStr(param);
cout<<"new - collect data only for the new runs"<<endl;
cout<<"all - collect data for all runs"<<endl;
cout<<"listen - start listening for DAQ notification"<<endl;
- cout<<"lastrun=<run> - sets last run manually. use with caution!" << endl
+ cout<<"lastrun=<run> - sets last run manually. use with caution!" << endl;
cout<<"<empty parameter> - the same as 'listen'"<<endl;
}