]>
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; |
73abe331 | 30 | |
b948db8d | 31 | class AliShuttle: public AliShuttleInterface { |
73abe331 | 32 | public: |
b948db8d | 33 | AliShuttle(const AliShuttleConfig* config, UInt_t timeout = 5000, Int_t retries = 5); |
73abe331 | 34 | virtual ~AliShuttle(); |
35 | ||
b948db8d | 36 | virtual void RegisterPreprocessor(AliPreprocessor* preprocessor); |
37 | ||
d477ad88 | 38 | Bool_t Process(Int_t run, UInt_t startTime, UInt_t endTime); |
5164a766 | 39 | Bool_t Process(); |
73abe331 | 40 | |
41 | Int_t GetCurrentRun() const {return fCurrentRun;}; | |
42 | UInt_t GetCurrentStartTime() const {return fCurrentStartTime;}; | |
43 | UInt_t GetCurrentEndTime() const {return fCurrentEndTime;}; | |
44 | ||
17111222 | 45 | virtual UInt_t Store(const char* detector, TObject* object, AliCDBMetaData* metaData, Int_t validityStart = 0, Bool_t validityInfinite = kFALSE); |
b948db8d | 46 | virtual const char* GetFile(Int_t system, const char* detector, |
47 | const char* id, const char* source); | |
48 | virtual TList* GetFileSources(Int_t system, const char* detector, const char* id); | |
49 | virtual void Log(const char* detector, const char* message); | |
50 | ||
51 | static TString GetLocalURI () {return fgkLocalUri;} | |
52 | static void SetLocalURI (TString localUri) {fgkLocalUri = localUri;} | |
73abe331 | 53 | |
57f50b3c | 54 | // TODO Test only, remove later! |
55 | void SetCurrentRun(int run) {fCurrentRun=run;} | |
56 | ||
57 | static const char* GetDetCode(const char* detector); | |
58 | static const char* GetShuttleTempDir() {return fgkShuttleTempDir;} | |
59 | ||
60 | Bool_t Connect(Int_t system); | |
61 | ||
62 | ||
73abe331 | 63 | private: |
57f50b3c | 64 | AliShuttle(const AliShuttle& other); |
65 | AliShuttle& operator= (const AliShuttle& other); | |
66 | ||
67 | Bool_t GetValueSet(const char* host, Int_t port, const char* alias, | |
68 | TObjArray& result); | |
69 | ||
70 | const char* GetDAQFileName(const char* detector, const char* id, const char* source); | |
71 | Bool_t RetrieveDAQFile(const char* daqFileName, const char* localFileName); | |
72 | TList* GetDAQFileSources(const char* detector, const char* id); | |
5164a766 | 73 | Bool_t UpdateDAQTable(); |
57f50b3c | 74 | |
75 | const char* GetDCSFileName(const char* detector, const char* id, const char* source); | |
76 | // Bool_t RetrieveDCSFile(const char* daqFileName const char* localFileName); | |
77 | TList* GetDCSFileSources(const char* detector, const char* id); | |
78 | ||
79 | const char* GetHLTFileName(const char* detector, const char* id, const char* source); | |
80 | // Bool_t RetrieveHLTFile(const char* daqFileName, const char* localFileName; | |
81 | TList* GetHLTFileSources(const char* detector, const char* id); | |
82 | ||
5164a766 | 83 | AliShuttleStatus* ReadShuttleStatus(); |
7bfb2090 | 84 | Bool_t WriteShuttleStatus(AliShuttleStatus* status); |
5164a766 | 85 | Bool_t ContinueProcessing(); |
86 | void UpdateShuttleStatus(AliShuttleStatus::Status newStatus, Bool_t increaseCount = kFALSE); | |
b948db8d | 87 | |
57f50b3c | 88 | const AliShuttleConfig* fConfig; //! pointer to configuration object |
b948db8d | 89 | |
57f50b3c | 90 | static const Int_t fgkNDetectors = 17; //! number of detectors |
91 | static const char* fgkDetectorName[fgkNDetectors]; //! names of detectors | |
92 | static const char* fgkDetectorCode[fgkNDetectors]; //! codes of detectors | |
93 | static TString fgkLocalUri; //! URI of the local backup storage location | |
94 | static const char* fgkShuttleTempDir; //! base path of SHUTTLE temp folder | |
5164a766 | 95 | static const char* fgkShuttleLogDir; //! path of SHUTTLE log folder |
b948db8d | 96 | |
57f50b3c | 97 | UInt_t fTimeout; //! DCS server connection timeout parameter |
98 | Int_t fRetries; //! Number of DCS server connection retries | |
73abe331 | 99 | |
57f50b3c | 100 | TMap fPreprocessorMap; //! list of detector Preprocessors ("DET", "Preprocessor") |
73abe331 | 101 | |
57f50b3c | 102 | Int_t fCurrentRun; //! run currenty processed |
103 | UInt_t fCurrentStartTime; //! Run Start time | |
104 | UInt_t fCurrentEndTime; //! Run end time | |
105 | ||
5164a766 | 106 | TString fCurrentDetector; // current detector |
107 | ||
57f50b3c | 108 | TSQLServer *fServer[3]; //! pointer to the three FS logbook servers |
109 | ||
110 | Bool_t fFESCalled[3]; //! FES call status | |
111 | TList fFESlist[3]; //! List of files retrieved from each FES | |
112 | ||
5164a766 | 113 | AliCDBEntry* fStatusEntry; //! last CDB entry containing a AliShuttleStatus retrieved |
b948db8d | 114 | |
73abe331 | 115 | ClassDef(AliShuttle, 0); |
116 | }; | |
117 | ||
118 | #endif |