CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Configuration.h
Go to the documentation of this file.
1 // $Id: Configuration.h,v 1.3 2011/05/09 11:03:25 mommsen Exp $
3 
4 #ifndef EventFilter_SMProxyServer_Configuration_h
5 #define EventFilter_SMProxyServer_Configuration_h
6 
9 
10 #include "xdata/InfoSpace.h"
11 #include "xdata/String.h"
12 #include "xdata/Integer.h"
13 #include "xdata/UnsignedInteger32.h"
14 #include "xdata/Double.h"
15 #include "xdata/Boolean.h"
16 #include "xdata/Vector.h"
17 
18 #include "boost/thread/mutex.hpp"
19 
20 
21 namespace smproxy
22 {
28  {
29  typedef std::vector<std::string> SMRegistrationList;
35  uint32_t retryInterval_;
37 
38  // not mapped to infospace params
39  uint32_t smpsInstance_;
40  std::string hostName_;
41  };
42 
48  {
51  std::string filePrefixDQM_;
52  unsigned int archiveIntervalDQM_;
53  };
54 
60  {
63  };
64 
69  struct AlarmParams
70  {
71  bool sendAlarms_; // enable alarms to be sent
72  double corruptedEventRate_; // rate of recently received corrupted events
73 
75  sendAlarms_(false) {}; // Initialize default to false, as this struct
76  // might be used before it is actual values
77  // are read from the configuration
78  };
79 
90  class Configuration : public xdata::ActionListener
91  {
92  public:
93 
98  Configuration(xdata::InfoSpace* infoSpace, unsigned long instanceNumber);
99 
103  virtual ~Configuration()
104  {
105  // should we detach from the infospace???
106  }
107 
116 
123 
130 
137 
144 
151 
156  void updateAllParams();
157 
162  virtual void actionPerformed(xdata::Event& isEvt);
163 
164 
165  private:
166 
167  void setDataRetrieverDefaults(unsigned long instanceNumber);
172  void setAlarmDefaults();
173 
174  void setupDataRetrieverInfoSpaceParams(xdata::InfoSpace*);
175  void setupEventServingInfoSpaceParams(xdata::InfoSpace*);
176  void setupDQMProcessingInfoSpaceParams(xdata::InfoSpace*);
177  void setupDQMArchivingInfoSpaceParams(xdata::InfoSpace*);
178  void setupQueueConfigurationInfoSpaceParams(xdata::InfoSpace*);
179  void setupAlarmInfoSpaceParams(xdata::InfoSpace* infoSpace);
180 
186  void updateLocalAlarmData();
187 
194 
196 
197  xdata::Vector<xdata::String> smRegistrationList_;
198  xdata::Boolean allowMissingSM_;
199  xdata::UnsignedInteger32 maxConnectionRetries_;
200  xdata::UnsignedInteger32 connectTrySleepTime_; // seconds
201  xdata::UnsignedInteger32 headerRetryInterval_; // seconds
202  xdata::UnsignedInteger32 retryInterval_; // seconds
203  xdata::UnsignedInteger32 sleepTimeIfIdle_; // milliseconds
204 
205  xdata::Boolean collateDQM_;
206  xdata::Integer readyTimeDQM_; // seconds
207  xdata::Boolean useCompressionDQM_;
208  xdata::Integer compressionLevelDQM_;
209 
210  xdata::Boolean archiveDQM_;
211  xdata::String archiveTopLevelFolder_;
212  xdata::String filePrefixDQM_;
213  xdata::Integer archiveIntervalDQM_; // lumi sections
214 
215  xdata::Integer activeConsumerTimeout_; // seconds
216  xdata::Integer consumerQueueSize_;
217  xdata::String consumerQueuePolicy_;
218  xdata::Integer _DQMactiveConsumerTimeout; // seconds
219  xdata::Integer _DQMconsumerQueueSize;
220  xdata::String _DQMconsumerQueuePolicy;
221 
222  xdata::UnsignedInteger32 registrationQueueSize_;
223  xdata::Double monitoringSleepSec_; // seconds
224 
225  xdata::Boolean sendAlarms_;
226  xdata::Double corruptedEventRate_; // Hz
227  };
228 
229  typedef boost::shared_ptr<Configuration> ConfigurationPtr;
230 
231 } // namespace smproxy
232 
233 #endif // EventFilter_SMProxyServer_Configuration_h
234 
235 
242 
xdata::Boolean useCompressionDQM_
xdata::Integer consumerQueueSize_
xdata::Boolean allowMissingSM_
struct DataRetrieverParams getDataRetrieverParams() const
std::vector< std::string > SMRegistrationList
Definition: Configuration.h:29
struct AlarmParams getAlarmParams() const
SMRegistrationList smRegistrationList_
Definition: Configuration.h:30
xdata::Integer _DQMconsumerQueueSize
xdata::UnsignedInteger32 connectTrySleepTime_
unsigned int archiveIntervalDQM_
Definition: Configuration.h:52
static boost::mutex mutex
Definition: LHEProxy.cc:11
xdata::Double monitoringSleepSec_
xdata::UnsignedInteger32 retryInterval_
xdata::Boolean sendAlarms_
void setupDQMArchivingInfoSpaceParams(xdata::InfoSpace *)
struct stor::EventServingParams eventServeParamCopy_
xdata::Boolean archiveDQM_
stor::utils::Duration_t sleepTimeIfIdle_
Definition: Configuration.h:36
void setupAlarmInfoSpaceParams(xdata::InfoSpace *infoSpace)
struct QueueConfigurationParams getQueueConfigurationParams() const
struct DQMArchivingParams dqmArchivingParamCopy_
xdata::Integer _DQMactiveConsumerTimeout
xdata::UnsignedInteger32 headerRetryInterval_
xdata::Boolean collateDQM_
virtual void actionPerformed(xdata::Event &isEvt)
boost::posix_time::time_duration Duration_t
Definition: Utils.h:41
xdata::String _DQMconsumerQueuePolicy
xdata::Integer compressionLevelDQM_
struct AlarmParams alarmParamCopy_
void setupQueueConfigurationInfoSpaceParams(xdata::InfoSpace *)
struct DQMArchivingParams getDQMArchivingParams() const
xdata::String consumerQueuePolicy_
void setupEventServingInfoSpaceParams(xdata::InfoSpace *)
xdata::Integer readyTimeDQM_
xdata::String filePrefixDQM_
Configuration(xdata::InfoSpace *infoSpace, unsigned long instanceNumber)
void setupDQMProcessingInfoSpaceParams(xdata::InfoSpace *)
xdata::Integer activeConsumerTimeout_
xdata::UnsignedInteger32 sleepTimeIfIdle_
void setupDataRetrieverInfoSpaceParams(xdata::InfoSpace *)
boost::mutex generalMutex_
struct stor::DQMProcessingParams getDQMProcessingParams() const
struct DataRetrieverParams dataRetrieverParamCopy_
string const
Definition: compareJSON.py:14
xdata::UnsignedInteger32 maxConnectionRetries_
boost::shared_ptr< Configuration > ConfigurationPtr
xdata::Double corruptedEventRate_
struct QueueConfigurationParams queueConfigParamCopy_
xdata::UnsignedInteger32 registrationQueueSize_
std::string archiveTopLevelFolder_
Definition: Configuration.h:50
void setDataRetrieverDefaults(unsigned long instanceNumber)
xdata::String archiveTopLevelFolder_
stor::utils::Duration_t monitoringSleepSec_
Definition: Configuration.h:62
struct stor::EventServingParams getEventServingParams() const
xdata::Integer archiveIntervalDQM_
struct stor::DQMProcessingParams dqmProcessingParamCopy_
xdata::Vector< xdata::String > smRegistrationList_
void updateLocalQueueConfigurationData()