]>
Commit | Line | Data |
---|---|---|
73abe331 | 1 | #ifndef ALI_SHUTTLE_H |
2 | #define ALI_SHUTTLE_H | |
3 | ||
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
7 | /* $Id$ */ | |
8 | ||
9 | ||
10 | // | |
11 | // This class is the main manager for | |
12 | // AliShuttle. It organizes the data retrieval | |
13 | // from DCS and call the interface methods of | |
a7160fe9 | 14 | // AliPreprocessor. |
73abe331 | 15 | // |
16 | ||
73abe331 | 17 | #include <TMap.h> |
b948db8d | 18 | #include <TString.h> |
57f50b3c | 19 | #include <TList.h> |
b948db8d | 20 | |
21 | #include "AliShuttleInterface.h" | |
5164a766 | 22 | #include "AliShuttleStatus.h" |
73abe331 | 23 | |
58bc3020 | 24 | class TObject; |
73abe331 | 25 | class AliShuttleConfig; |
b948db8d | 26 | class AliPreprocessor; |
73abe331 | 27 | class AliCDBMetaData; |
57f50b3c | 28 | class TSQLServer; |
5164a766 | 29 | class AliCDBEntry; |
84090f85 | 30 | class AliCDBPath; |
73abe331 | 31 | |
b948db8d | 32 | class AliShuttle: public AliShuttleInterface { |
73abe331 | 33 | public: |
b948db8d | 34 | AliShuttle(const AliShuttleConfig* config, UInt_t timeout = 5000, Int_t retries = 5); |
73abe331 | 35 | virtual ~AliShuttle(); |
36 | ||
b948db8d | 37 | virtual void RegisterPreprocessor(AliPreprocessor* preprocessor); |
38 | ||
d477ad88 | 39 | Bool_t Process(Int_t run, UInt_t startTime, UInt_t endTime); |
5164a766 | 40 | Bool_t Process(); |
73abe331 | 41 | |
42 | Int_t GetCurrentRun() const {return fCurrentRun;}; | |
43 | UInt_t GetCurrentStartTime() const {return fCurrentStartTime;}; | |
44 | UInt_t GetCurrentEndTime() const {return fCurrentEndTime;}; | |
45 | ||
84090f85 | 46 | virtual UInt_t Store(const AliCDBPath& path, TObject* object, AliCDBMetaData* metaData, |
47 | Int_t validityStart = 0, Bool_t validityInfinite = kFALSE); | |
48 | virtual UInt_t StoreReferenceData(const AliCDBPath& path, TObject* object, AliCDBMetaData* metaData, | |
49 | Int_t validityStart = 0, Bool_t validityInfinite = kFALSE); | |
b948db8d | 50 | virtual const char* GetFile(Int_t system, const char* detector, |
51 | const char* id, const char* source); | |
52 | virtual TList* GetFileSources(Int_t system, const char* detector, const char* id); | |
53 | virtual void Log(const char* detector, const char* message); | |
54 | ||
4f0ab988 | 55 | static TString GetMainCDB () {return fgkMainCDB;} |
56 | static void SetMainCDB (TString mainCDB) {fgkMainCDB = mainCDB;} | |
84090f85 | 57 | static TString GetLocalCDB () {return fgkLocalCDB;} |
58 | static void SetLocalCDB (TString localCDB) {fgkLocalCDB = localCDB;} | |
59 | ||
60 | static TString GetMainRefStorage() {return fgkMainRefStorage;} | |
61 | static void SetMainRefStorage (TString mainRefStorage) {fgkMainRefStorage = mainRefStorage;} | |
84090f85 | 62 | static TString GetLocalRefStorage() {return fgkLocalRefStorage;} |
63 | static void SetLocalRefStorage (TString localRefStorage) {fgkLocalRefStorage = localRefStorage;} | |
73abe331 | 64 | |
57f50b3c | 65 | // TODO Test only, remove later! |
66 | void SetCurrentRun(int run) {fCurrentRun=run;} | |
4f0ab988 | 67 | //TODO Test only, remove later ! |
68 | void SetProcessDCS(Bool_t process) {fgkProcessDCS = process;} | |
57f50b3c | 69 | |
70 | static const char* GetDetCode(const char* detector); | |
71 | static const char* GetShuttleTempDir() {return fgkShuttleTempDir;} | |
72 | ||
73 | Bool_t Connect(Int_t system); | |
74 | ||
75 | ||
73abe331 | 76 | private: |
57f50b3c | 77 | AliShuttle(const AliShuttle& other); |
78 | AliShuttle& operator= (const AliShuttle& other); | |
79 | ||
80 | Bool_t GetValueSet(const char* host, Int_t port, const char* alias, | |
81 | TObjArray& result); | |
82 | ||
83 | const char* GetDAQFileName(const char* detector, const char* id, const char* source); | |
84 | Bool_t RetrieveDAQFile(const char* daqFileName, const char* localFileName); | |
85 | TList* GetDAQFileSources(const char* detector, const char* id); | |
5164a766 | 86 | Bool_t UpdateDAQTable(); |
57f50b3c | 87 | |
88 | const char* GetDCSFileName(const char* detector, const char* id, const char* source); | |
89 | // Bool_t RetrieveDCSFile(const char* daqFileName const char* localFileName); | |
90 | TList* GetDCSFileSources(const char* detector, const char* id); | |
91 | ||
92 | const char* GetHLTFileName(const char* detector, const char* id, const char* source); | |
93 | // Bool_t RetrieveHLTFile(const char* daqFileName, const char* localFileName; | |
94 | TList* GetHLTFileSources(const char* detector, const char* id); | |
95 | ||
4f0ab988 | 96 | AliShuttleStatus* ReadShuttleStatus(); |
97 | Bool_t WriteShuttleStatus(AliShuttleStatus* status); | |
98 | Bool_t ContinueProcessing(); | |
99 | void UpdateShuttleStatus(AliShuttleStatus::Status newStatus, Bool_t increaseCount = kFALSE); | |
b948db8d | 100 | |
57f50b3c | 101 | const AliShuttleConfig* fConfig; //! pointer to configuration object |
b948db8d | 102 | |
57f50b3c | 103 | static const Int_t fgkNDetectors = 17; //! number of detectors |
104 | static const char* fgkDetectorName[fgkNDetectors]; //! names of detectors | |
105 | static const char* fgkDetectorCode[fgkNDetectors]; //! codes of detectors | |
4f0ab988 | 106 | static TString fgkMainCDB; //! URI of the main (Grid) CDB storage |
107 | static TString fgkLocalCDB; //! URI of the local backup CDB storage | |
84090f85 | 108 | static TString fgkMainRefStorage; //! URI of the main (Grid) REFERENCE storage |
109 | static TString fgkLocalRefStorage; //! URI of the local REFERENCE storage | |
57f50b3c | 110 | static const char* fgkShuttleTempDir; //! base path of SHUTTLE temp folder |
5164a766 | 111 | static const char* fgkShuttleLogDir; //! path of SHUTTLE log folder |
b948db8d | 112 | |
57f50b3c | 113 | UInt_t fTimeout; //! DCS server connection timeout parameter |
114 | Int_t fRetries; //! Number of DCS server connection retries | |
73abe331 | 115 | |
57f50b3c | 116 | TMap fPreprocessorMap; //! list of detector Preprocessors ("DET", "Preprocessor") |
73abe331 | 117 | |
57f50b3c | 118 | Int_t fCurrentRun; //! run currenty processed |
119 | UInt_t fCurrentStartTime; //! Run Start time | |
120 | UInt_t fCurrentEndTime; //! Run end time | |
121 | ||
4f0ab988 | 122 | TString fCurrentDetector; // current detector |
5164a766 | 123 | |
57f50b3c | 124 | TSQLServer *fServer[3]; //! pointer to the three FS logbook servers |
125 | ||
126 | Bool_t fFESCalled[3]; //! FES call status | |
127 | TList fFESlist[3]; //! List of files retrieved from each FES | |
128 | ||
4f0ab988 | 129 | AliCDBEntry* fStatusEntry; //! last CDB entry containing a AliShuttleStatus retrieved |
130 | ||
131 | //TODO Test only, remove later ! | |
132 | static Bool_t fgkProcessDCS; // flag to enable DCS archive data processing | |
b948db8d | 133 | |
73abe331 | 134 | ClassDef(AliShuttle, 0); |
135 | }; | |
136 | ||
137 | #endif |