CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
smproxy::Configuration Class Reference

#include <Configuration.h>

Inheritance diagram for smproxy::Configuration:

Public Member Functions

virtual void actionPerformed (xdata::Event &isEvt)
 
 Configuration (xdata::InfoSpace *infoSpace, unsigned long instanceNumber)
 
struct DataRetrieverParams getDataRetrieverParams () const
 
struct DQMArchivingParams getDQMArchivingParams () const
 
struct stor::DQMProcessingParams getDQMProcessingParams () const
 
struct stor::EventServingParams getEventServingParams () const
 
struct QueueConfigurationParams getQueueConfigurationParams () const
 
void updateAllParams ()
 
virtual ~Configuration ()
 

Private Member Functions

void setDataRetrieverDefaults (unsigned long instanceNumber)
 
void setDQMArchivingDefaults ()
 
void setDQMProcessingDefaults ()
 
void setEventServingDefaults ()
 
void setQueueConfigurationDefaults ()
 
void setupDataRetrieverInfoSpaceParams (xdata::InfoSpace *)
 
void setupDQMArchivingInfoSpaceParams (xdata::InfoSpace *)
 
void setupDQMProcessingInfoSpaceParams (xdata::InfoSpace *)
 
void setupEventServingInfoSpaceParams (xdata::InfoSpace *)
 
void setupQueueConfigurationInfoSpaceParams (xdata::InfoSpace *)
 
void updateLocalDataRetrieverData ()
 
void updateLocalDQMArchivingData ()
 
void updateLocalDQMProcessingData ()
 
void updateLocalEventServingData ()
 
void updateLocalQueueConfigurationData ()
 

Private Attributes

xdata::Integer _DQMactiveConsumerTimeout
 
xdata::String _DQMconsumerQueuePolicy
 
xdata::Integer _DQMconsumerQueueSize
 
xdata::Integer activeConsumerTimeout_
 
xdata::Boolean allowMissingSM_
 
xdata::Boolean archiveDQM_
 
xdata::Integer archiveIntervalDQM_
 
xdata::String archiveTopLevelFolder_
 
xdata::Boolean collateDQM_
 
xdata::Integer compressionLevelDQM_
 
xdata::UnsignedInteger32 connectTrySleepTime_
 
xdata::String consumerQueuePolicy_
 
xdata::Integer consumerQueueSize_
 
struct DataRetrieverParams dataRetrieverParamCopy_
 
struct DQMArchivingParams dqmArchivingParamCopy_
 
struct stor::DQMProcessingParams dqmProcessingParamCopy_
 
struct stor::EventServingParams eventServeParamCopy_
 
xdata::String filePrefixDQM_
 
boost::mutex generalMutex_
 
xdata::UnsignedInteger32 headerRetryInterval_
 
xdata::UnsignedInteger32 maxConnectionRetries_
 
xdata::Double monitoringSleepSec_
 
struct QueueConfigurationParams queueConfigParamCopy_
 
xdata::Integer readyTimeDQM_
 
xdata::UnsignedInteger32 registrationQueueSize_
 
xdata::UnsignedInteger32 retryInterval_
 
xdata::UnsignedInteger32 sleepTimeIfIdle_
 
xdata::Vector< xdata::String > smRegistrationList_
 
xdata::Boolean useCompressionDQM_
 

Detailed Description

Class for managing configuration information from the infospace and providing local copies of that information that are updated only at requested times.

Author:
mommsen
Revision:
1.1.2.14
Date:
2011/03/02 10:59:37

Definition at line 75 of file Configuration.h.

Constructor & Destructor Documentation

smproxy::Configuration::Configuration ( xdata::InfoSpace *  infoSpace,
unsigned long  instanceNumber 
)

Constructs a Configuration instance for the specified infospace and application instance number.

Definition at line 14 of file Configuration.cc.

18  {
19  // default values are used to initialize infospace values,
20  // so they should be set first
21  setDataRetrieverDefaults(instanceNumber);
26 
32  }
void setupDQMArchivingInfoSpaceParams(xdata::InfoSpace *)
void setupQueueConfigurationInfoSpaceParams(xdata::InfoSpace *)
void setupEventServingInfoSpaceParams(xdata::InfoSpace *)
void setupDQMProcessingInfoSpaceParams(xdata::InfoSpace *)
void setupDataRetrieverInfoSpaceParams(xdata::InfoSpace *)
void setDataRetrieverDefaults(unsigned long instanceNumber)
virtual smproxy::Configuration::~Configuration ( )
inlinevirtual

Destructor.

Definition at line 88 of file Configuration.h.

89  {
90  // should we detach from the infospace???
91  }

Member Function Documentation

void smproxy::Configuration::actionPerformed ( xdata::Event &  isEvt)
virtual

Gets invoked when a operation is performed on the infospace that we are interested in knowing about.

Definition at line 273 of file Configuration.cc.

References generalMutex_.

274  {
275  boost::mutex::scoped_lock sl(generalMutex_);
276  }
boost::mutex generalMutex_
struct DataRetrieverParams smproxy::Configuration::getDataRetrieverParams ( ) const

Returns a copy of the event retriever parameters. These values will be current as of the most recent global update of the local cache from the infospace (see the updateAllParams() method) or the most recent update of only the event retrieved parameters (see the updateDataRetrieverParams() method).

Definition at line 34 of file Configuration.cc.

35  {
36  boost::mutex::scoped_lock sl(generalMutex_);
38  }
boost::mutex generalMutex_
struct DataRetrieverParams dataRetrieverParamCopy_
struct DQMArchivingParams smproxy::Configuration::getDQMArchivingParams ( ) const

Returns a copy of the DQM archiving parameters. These values will be current as of the most recent global update of the local cache from the infospace (see the updateAllParams() method).

Definition at line 52 of file Configuration.cc.

53  {
54  boost::mutex::scoped_lock sl(generalMutex_);
56  }
struct DQMArchivingParams dqmArchivingParamCopy_
boost::mutex generalMutex_
struct stor::DQMProcessingParams smproxy::Configuration::getDQMProcessingParams ( ) const

Returns a copy of the DQM processing parameters. These values will be current as of the most recent global update of the local cache from the infospace (see the updateAllParams() method).

Definition at line 46 of file Configuration.cc.

47  {
48  boost::mutex::scoped_lock sl(generalMutex_);
50  }
boost::mutex generalMutex_
struct stor::DQMProcessingParams dqmProcessingParamCopy_
struct stor::EventServingParams smproxy::Configuration::getEventServingParams ( ) const

Returns a copy of the event serving parameters. These values will be current as of the most recent global update of the local cache from the infospace (see the updateAllParams() method).

Definition at line 40 of file Configuration.cc.

41  {
42  boost::mutex::scoped_lock sl(generalMutex_);
43  return eventServeParamCopy_;
44  }
struct stor::EventServingParams eventServeParamCopy_
boost::mutex generalMutex_
struct QueueConfigurationParams smproxy::Configuration::getQueueConfigurationParams ( ) const

Returns a copy of the queue configuration parameters. These values will be current as of the most recent global update of the local cache from the infospace (see the updateAllParams() method).

Definition at line 58 of file Configuration.cc.

59  {
60  boost::mutex::scoped_lock sl(generalMutex_);
61  return queueConfigParamCopy_;
62  }
boost::mutex generalMutex_
struct QueueConfigurationParams queueConfigParamCopy_
void smproxy::Configuration::setDataRetrieverDefaults ( unsigned long  instanceNumber)
private

Definition at line 74 of file Configuration.cc.

References smproxy::DataRetrieverParams::allowMissingSM_, smproxy::DataRetrieverParams::connectTrySleepTime_, dataRetrieverParamCopy_, smproxy::DataRetrieverParams::headerRetryInterval_, smproxy::DataRetrieverParams::hostName_, smproxy::DataRetrieverParams::maxConnectionRetries_, pos, smproxy::DataRetrieverParams::retryInterval_, smproxy::DataRetrieverParams::sleepTimeIfIdle_, smproxy::DataRetrieverParams::smpsInstance_, and smproxy::DataRetrieverParams::smRegistrationList_.

75  {
76  dataRetrieverParamCopy_.smpsInstance_ = instanceNumber;
84  boost::posix_time::milliseconds(100);
85 
86  std::string tmpString(toolbox::net::getHostName());
87  // strip domainame
88  std::string::size_type pos = tmpString.find('.');
89  if (pos != std::string::npos) {
90  std::string basename = tmpString.substr(0,pos);
91  tmpString = basename;
92  }
94  }
SMRegistrationList smRegistrationList_
Definition: Configuration.h:30
stor::utils::Duration_t sleepTimeIfIdle_
Definition: Configuration.h:36
uint16_t size_type
struct DataRetrieverParams dataRetrieverParamCopy_
void smproxy::Configuration::setDQMArchivingDefaults ( )
private
void smproxy::Configuration::setDQMProcessingDefaults ( )
private
void smproxy::Configuration::setEventServingDefaults ( )
private

Definition at line 96 of file Configuration.cc.

References stor::EventServingParams::_DQMactiveConsumerTimeout, stor::EventServingParams::_DQMconsumerQueuePolicy, stor::EventServingParams::_DQMconsumerQueueSize, stor::EventServingParams::activeConsumerTimeout_, stor::EventServingParams::consumerQueuePolicy_, stor::EventServingParams::consumerQueueSize_, eventServeParamCopy_, and seconds().

void smproxy::Configuration::setQueueConfigurationDefaults ( )
private
void smproxy::Configuration::setupDataRetrieverInfoSpaceParams ( xdata::InfoSpace *  infoSpace)
private

Definition at line 129 of file Configuration.cc.

References smproxy::DataRetrieverParams::allowMissingSM_, allowMissingSM_, smproxy::DataRetrieverParams::connectTrySleepTime_, connectTrySleepTime_, dataRetrieverParamCopy_, stor::utils::getXdataVector(), smproxy::DataRetrieverParams::headerRetryInterval_, headerRetryInterval_, smproxy::DataRetrieverParams::maxConnectionRetries_, maxConnectionRetries_, smproxy::DataRetrieverParams::retryInterval_, retryInterval_, smproxy::DataRetrieverParams::sleepTimeIfIdle_, sleepTimeIfIdle_, smproxy::DataRetrieverParams::smRegistrationList_, and smRegistrationList_.

130  {
131  // copy the initial defaults into the xdata variables
139 
140  // bind the local xdata variables to the infospace
141  infoSpace->fireItemAvailable("SMRegistrationList", &smRegistrationList_);
142  infoSpace->fireItemAvailable("allowMissingSM", &allowMissingSM_);
143  infoSpace->fireItemAvailable("maxConnectionRetries", &maxConnectionRetries_);
144  infoSpace->fireItemAvailable("connectTrySleepTime", &connectTrySleepTime_);
145  infoSpace->fireItemAvailable("headerRetryInterval", &headerRetryInterval_);
146  infoSpace->fireItemAvailable("retryInterval", &retryInterval_);
147  infoSpace->fireItemAvailable("sleepTimeIfIdle", &sleepTimeIfIdle_);
148  }
xdata::Boolean allowMissingSM_
SMRegistrationList smRegistrationList_
Definition: Configuration.h:30
xdata::UnsignedInteger32 connectTrySleepTime_
xdata::UnsignedInteger32 retryInterval_
stor::utils::Duration_t sleepTimeIfIdle_
Definition: Configuration.h:36
xdata::UnsignedInteger32 headerRetryInterval_
xdata::UnsignedInteger32 sleepTimeIfIdle_
struct DataRetrieverParams dataRetrieverParamCopy_
void getXdataVector(const std::vector< std::string > &, xdata::Vector< xdata::String > &)
Definition: Utils.cc:119
xdata::UnsignedInteger32 maxConnectionRetries_
xdata::Vector< xdata::String > smRegistrationList_
void smproxy::Configuration::setupDQMArchivingInfoSpaceParams ( xdata::InfoSpace *  infoSpace)
private

Definition at line 187 of file Configuration.cc.

References smproxy::DQMArchivingParams::archiveDQM_, archiveDQM_, smproxy::DQMArchivingParams::archiveIntervalDQM_, archiveIntervalDQM_, smproxy::DQMArchivingParams::archiveTopLevelFolder_, archiveTopLevelFolder_, dqmArchivingParamCopy_, smproxy::DQMArchivingParams::filePrefixDQM_, and filePrefixDQM_.

188  {
189  // copy the initial defaults to the xdata variables
194 
195  // bind the local xdata variables to the infospace
196  infoSpace->fireItemAvailable("archiveDQM", &archiveDQM_);
197  infoSpace->fireItemAvailable("archiveTopLevelFolder", &archiveTopLevelFolder_);
198  infoSpace->fireItemAvailable("archiveIntervalDQM", &archiveIntervalDQM_);
199  infoSpace->fireItemAvailable("filePrefixDQM", &filePrefixDQM_);
200  }
unsigned int archiveIntervalDQM_
Definition: Configuration.h:52
xdata::Boolean archiveDQM_
struct DQMArchivingParams dqmArchivingParamCopy_
xdata::String filePrefixDQM_
std::string archiveTopLevelFolder_
Definition: Configuration.h:50
xdata::String archiveTopLevelFolder_
xdata::Integer archiveIntervalDQM_
void smproxy::Configuration::setupDQMProcessingInfoSpaceParams ( xdata::InfoSpace *  infoSpace)
private

Definition at line 171 of file Configuration.cc.

References stor::DQMProcessingParams::collateDQM_, collateDQM_, stor::DQMProcessingParams::compressionLevelDQM_, compressionLevelDQM_, dqmProcessingParamCopy_, stor::DQMProcessingParams::readyTimeDQM_, readyTimeDQM_, stor::DQMProcessingParams::useCompressionDQM_, and useCompressionDQM_.

172  {
173  // copy the initial defaults to the xdata variables
178 
179  // bind the local xdata variables to the infospace
180  infoSpace->fireItemAvailable("collateDQM", &collateDQM_);
181  infoSpace->fireItemAvailable("readyTimeDQM", &readyTimeDQM_);
182  infoSpace->fireItemAvailable("useCompressionDQM", &useCompressionDQM_);
183  infoSpace->fireItemAvailable("compressionLevelDQM", &compressionLevelDQM_);
184  }
xdata::Boolean useCompressionDQM_
utils::Duration_t readyTimeDQM_
Definition: Configuration.h:63
xdata::Boolean collateDQM_
xdata::Integer compressionLevelDQM_
xdata::Integer readyTimeDQM_
struct stor::DQMProcessingParams dqmProcessingParamCopy_
void smproxy::Configuration::setupEventServingInfoSpaceParams ( xdata::InfoSpace *  infoSpace)
private

Definition at line 151 of file Configuration.cc.

References stor::EventServingParams::_DQMactiveConsumerTimeout, _DQMactiveConsumerTimeout, stor::EventServingParams::_DQMconsumerQueuePolicy, _DQMconsumerQueuePolicy, stor::EventServingParams::_DQMconsumerQueueSize, _DQMconsumerQueueSize, stor::EventServingParams::activeConsumerTimeout_, activeConsumerTimeout_, stor::EventServingParams::consumerQueuePolicy_, consumerQueuePolicy_, stor::EventServingParams::consumerQueueSize_, consumerQueueSize_, and eventServeParamCopy_.

152  {
153  // copy the initial defaults to the xdata variables
160 
161  // bind the local xdata variables to the infospace
162  infoSpace->fireItemAvailable("activeConsumerTimeout", &activeConsumerTimeout_);
163  infoSpace->fireItemAvailable("consumerQueueSize", &consumerQueueSize_);
164  infoSpace->fireItemAvailable("consumerQueuePolicy", &consumerQueuePolicy_);
165  infoSpace->fireItemAvailable("DQMactiveConsumerTimeout", &_DQMactiveConsumerTimeout);
166  infoSpace->fireItemAvailable("DQMconsumerQueueSize", &_DQMconsumerQueueSize);
167  infoSpace->fireItemAvailable("DQMconsumerQueuePolicy",&_DQMconsumerQueuePolicy);
168  }
xdata::Integer consumerQueueSize_
xdata::Integer _DQMconsumerQueueSize
struct stor::EventServingParams eventServeParamCopy_
xdata::Integer _DQMactiveConsumerTimeout
std::string consumerQueuePolicy_
Definition: Configuration.h:77
std::string _DQMconsumerQueuePolicy
Definition: Configuration.h:80
xdata::String _DQMconsumerQueuePolicy
utils::Duration_t activeConsumerTimeout_
Definition: Configuration.h:75
xdata::String consumerQueuePolicy_
xdata::Integer activeConsumerTimeout_
utils::Duration_t _DQMactiveConsumerTimeout
Definition: Configuration.h:78
void smproxy::Configuration::setupQueueConfigurationInfoSpaceParams ( xdata::InfoSpace *  infoSpace)
private

Definition at line 203 of file Configuration.cc.

References stor::utils::durationToSeconds(), smproxy::QueueConfigurationParams::monitoringSleepSec_, monitoringSleepSec_, queueConfigParamCopy_, smproxy::QueueConfigurationParams::registrationQueueSize_, and registrationQueueSize_.

204  {
205  // copy the initial defaults to the xdata variables
209 
210  // bind the local xdata variables to the infospace
211  infoSpace->fireItemAvailable("registrationQueueSize", &registrationQueueSize_);
212  infoSpace->fireItemAvailable("monitoringSleepSec", &monitoringSleepSec_);
213  }
xdata::Double monitoringSleepSec_
struct QueueConfigurationParams queueConfigParamCopy_
xdata::UnsignedInteger32 registrationQueueSize_
double durationToSeconds(Duration_t const &)
Definition: Utils.h:147
stor::utils::Duration_t monitoringSleepSec_
Definition: Configuration.h:62
void smproxy::Configuration::updateAllParams ( )

Updates the local copy of all configuration parameters from the infospace.

Definition at line 64 of file Configuration.cc.

References generalMutex_, updateLocalDataRetrieverData(), updateLocalDQMArchivingData(), updateLocalDQMProcessingData(), updateLocalEventServingData(), and updateLocalQueueConfigurationData().

void smproxy::Configuration::updateLocalDataRetrieverData ( )
private

Definition at line 215 of file Configuration.cc.

References smproxy::DataRetrieverParams::allowMissingSM_, allowMissingSM_, smproxy::DataRetrieverParams::connectTrySleepTime_, connectTrySleepTime_, dataRetrieverParamCopy_, stor::utils::getStdVector(), smproxy::DataRetrieverParams::headerRetryInterval_, headerRetryInterval_, smproxy::DataRetrieverParams::maxConnectionRetries_, maxConnectionRetries_, smproxy::DataRetrieverParams::retryInterval_, retryInterval_, smproxy::DataRetrieverParams::sleepTimeIfIdle_, sleepTimeIfIdle_, smproxy::DataRetrieverParams::smRegistrationList_, and smRegistrationList_.

Referenced by updateAllParams().

216  {
224  boost::posix_time::milliseconds(sleepTimeIfIdle_);
225  }
xdata::Boolean allowMissingSM_
SMRegistrationList smRegistrationList_
Definition: Configuration.h:30
xdata::UnsignedInteger32 connectTrySleepTime_
xdata::UnsignedInteger32 retryInterval_
stor::utils::Duration_t sleepTimeIfIdle_
Definition: Configuration.h:36
xdata::UnsignedInteger32 headerRetryInterval_
void getStdVector(xdata::Vector< xdata::String > &, std::vector< std::string > &)
Definition: Utils.cc:105
xdata::UnsignedInteger32 sleepTimeIfIdle_
struct DataRetrieverParams dataRetrieverParamCopy_
xdata::UnsignedInteger32 maxConnectionRetries_
xdata::Vector< xdata::String > smRegistrationList_
void smproxy::Configuration::updateLocalDQMArchivingData ( )
private

Definition at line 258 of file Configuration.cc.

References smproxy::DQMArchivingParams::archiveDQM_, archiveDQM_, smproxy::DQMArchivingParams::archiveIntervalDQM_, archiveIntervalDQM_, smproxy::DQMArchivingParams::archiveTopLevelFolder_, archiveTopLevelFolder_, dqmArchivingParamCopy_, smproxy::DQMArchivingParams::filePrefixDQM_, and filePrefixDQM_.

Referenced by updateAllParams().

void smproxy::Configuration::updateLocalDQMProcessingData ( )
private

Definition at line 249 of file Configuration.cc.

References stor::DQMProcessingParams::collateDQM_, collateDQM_, stor::DQMProcessingParams::compressionLevelDQM_, compressionLevelDQM_, dqmProcessingParamCopy_, stor::DQMProcessingParams::readyTimeDQM_, readyTimeDQM_, seconds(), stor::DQMProcessingParams::useCompressionDQM_, and useCompressionDQM_.

Referenced by updateAllParams().

void smproxy::Configuration::updateLocalEventServingData ( )
private

Definition at line 227 of file Configuration.cc.

References stor::EventServingParams::_DQMactiveConsumerTimeout, _DQMactiveConsumerTimeout, stor::EventServingParams::_DQMconsumerQueuePolicy, _DQMconsumerQueuePolicy, stor::EventServingParams::_DQMconsumerQueueSize, _DQMconsumerQueueSize, stor::EventServingParams::activeConsumerTimeout_, activeConsumerTimeout_, stor::EventServingParams::consumerQueuePolicy_, consumerQueuePolicy_, stor::EventServingParams::consumerQueueSize_, consumerQueueSize_, eventServeParamCopy_, and seconds().

Referenced by updateAllParams().

228  {
237 
238  // validation
240  {
242  }
244  {
246  }
247  }
xdata::Integer consumerQueueSize_
double seconds()
xdata::Integer _DQMconsumerQueueSize
struct stor::EventServingParams eventServeParamCopy_
xdata::Integer _DQMactiveConsumerTimeout
std::string consumerQueuePolicy_
Definition: Configuration.h:77
std::string _DQMconsumerQueuePolicy
Definition: Configuration.h:80
xdata::String _DQMconsumerQueuePolicy
utils::Duration_t activeConsumerTimeout_
Definition: Configuration.h:75
xdata::String consumerQueuePolicy_
xdata::Integer activeConsumerTimeout_
utils::Duration_t _DQMactiveConsumerTimeout
Definition: Configuration.h:78
void smproxy::Configuration::updateLocalQueueConfigurationData ( )
private

Member Data Documentation

xdata::Integer smproxy::Configuration::_DQMactiveConsumerTimeout
private
xdata::String smproxy::Configuration::_DQMconsumerQueuePolicy
private
xdata::Integer smproxy::Configuration::_DQMconsumerQueueSize
private
xdata::Integer smproxy::Configuration::activeConsumerTimeout_
private
xdata::Boolean smproxy::Configuration::allowMissingSM_
private
xdata::Boolean smproxy::Configuration::archiveDQM_
private
xdata::Integer smproxy::Configuration::archiveIntervalDQM_
private
xdata::String smproxy::Configuration::archiveTopLevelFolder_
private
xdata::Boolean smproxy::Configuration::collateDQM_
private
xdata::Integer smproxy::Configuration::compressionLevelDQM_
private
xdata::UnsignedInteger32 smproxy::Configuration::connectTrySleepTime_
private
xdata::String smproxy::Configuration::consumerQueuePolicy_
private
xdata::Integer smproxy::Configuration::consumerQueueSize_
private
struct DataRetrieverParams smproxy::Configuration::dataRetrieverParamCopy_
private
struct DQMArchivingParams smproxy::Configuration::dqmArchivingParamCopy_
private
struct stor::DQMProcessingParams smproxy::Configuration::dqmProcessingParamCopy_
private
struct stor::EventServingParams smproxy::Configuration::eventServeParamCopy_
private
xdata::String smproxy::Configuration::filePrefixDQM_
private
boost::mutex smproxy::Configuration::generalMutex_
mutableprivate

Definition at line 169 of file Configuration.h.

Referenced by actionPerformed(), and updateAllParams().

xdata::UnsignedInteger32 smproxy::Configuration::headerRetryInterval_
private
xdata::UnsignedInteger32 smproxy::Configuration::maxConnectionRetries_
private
xdata::Double smproxy::Configuration::monitoringSleepSec_
private
struct QueueConfigurationParams smproxy::Configuration::queueConfigParamCopy_
private
xdata::Integer smproxy::Configuration::readyTimeDQM_
private
xdata::UnsignedInteger32 smproxy::Configuration::registrationQueueSize_
private
xdata::UnsignedInteger32 smproxy::Configuration::retryInterval_
private
xdata::UnsignedInteger32 smproxy::Configuration::sleepTimeIfIdle_
private
xdata::Vector<xdata::String> smproxy::Configuration::smRegistrationList_
private
xdata::Boolean smproxy::Configuration::useCompressionDQM_
private