CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

smproxy::Configuration Class Reference

#include <Configuration.h>

List of all members.

Public Member Functions

virtual void actionPerformed (xdata::Event &isEvt)
 Configuration (xdata::InfoSpace *infoSpace, unsigned long instanceNumber)
struct AlarmParams getAlarmParams () const
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 setAlarmDefaults ()
void setDataRetrieverDefaults (unsigned long instanceNumber)
void setDQMArchivingDefaults ()
void setDQMProcessingDefaults ()
void setEventServingDefaults ()
void setQueueConfigurationDefaults ()
void setupAlarmInfoSpaceParams (xdata::InfoSpace *infoSpace)
void setupDataRetrieverInfoSpaceParams (xdata::InfoSpace *)
void setupDQMArchivingInfoSpaceParams (xdata::InfoSpace *)
void setupDQMProcessingInfoSpaceParams (xdata::InfoSpace *)
void setupEventServingInfoSpaceParams (xdata::InfoSpace *)
void setupQueueConfigurationInfoSpaceParams (xdata::InfoSpace *)
void updateLocalAlarmData ()
void updateLocalDataRetrieverData ()
void updateLocalDQMArchivingData ()
void updateLocalDQMProcessingData ()
void updateLocalEventServingData ()
void updateLocalQueueConfigurationData ()

Private Attributes

xdata::Integer _DQMactiveConsumerTimeout
xdata::String _DQMconsumerQueuePolicy
xdata::Integer _DQMconsumerQueueSize
xdata::Integer activeConsumerTimeout_
struct AlarmParams alarmParamCopy_
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_
xdata::Double corruptedEventRate_
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::Boolean sendAlarms_
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.3
Date:
2011/05/09 11:03:25

Definition at line 90 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.

virtual smproxy::Configuration::~Configuration ( ) [inline, virtual]

Destructor.

Definition at line 103 of file Configuration.h.

    {
      // should we detach from the infospace???
    }

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 307 of file Configuration.cc.

References generalMutex_.

  {
    boost::mutex::scoped_lock sl(generalMutex_);
  }
struct AlarmParams smproxy::Configuration::getAlarmParams ( ) const [read]

Returns a copy of the alarm 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 66 of file Configuration.cc.

  {
    boost::mutex::scoped_lock sl(generalMutex_);
    return alarmParamCopy_;
  }
struct DataRetrieverParams smproxy::Configuration::getDataRetrieverParams ( ) const [read]

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 36 of file Configuration.cc.

  {
    boost::mutex::scoped_lock sl(generalMutex_);
    return dataRetrieverParamCopy_;
  }
struct DQMArchivingParams smproxy::Configuration::getDQMArchivingParams ( ) const [read]

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 54 of file Configuration.cc.

  {
    boost::mutex::scoped_lock sl(generalMutex_);
    return dqmArchivingParamCopy_;
  }
struct stor::DQMProcessingParams smproxy::Configuration::getDQMProcessingParams ( ) const [read]

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 48 of file Configuration.cc.

  {
    boost::mutex::scoped_lock sl(generalMutex_);
    return dqmProcessingParamCopy_;
  }
struct stor::EventServingParams smproxy::Configuration::getEventServingParams ( ) const [read]

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 42 of file Configuration.cc.

  {
    boost::mutex::scoped_lock sl(generalMutex_);
    return eventServeParamCopy_;
  }
struct QueueConfigurationParams smproxy::Configuration::getQueueConfigurationParams ( ) const [read]

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 60 of file Configuration.cc.

  {
    boost::mutex::scoped_lock sl(generalMutex_);
    return queueConfigParamCopy_;
  }
void smproxy::Configuration::setAlarmDefaults ( ) [private]

Definition at line 137 of file Configuration.cc.

References alarmParamCopy_, smproxy::AlarmParams::corruptedEventRate_, and smproxy::AlarmParams::sendAlarms_.

  {
    // set defaults
    alarmParamCopy_.sendAlarms_ = true;
    alarmParamCopy_.corruptedEventRate_ = 0.1;
  }
void smproxy::Configuration::setDataRetrieverDefaults ( unsigned long  instanceNumber) [private]

Definition at line 83 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_.

  {
    dataRetrieverParamCopy_.smpsInstance_ = instanceNumber;
    dataRetrieverParamCopy_.smRegistrationList_.clear();
    dataRetrieverParamCopy_.allowMissingSM_ = true;
    dataRetrieverParamCopy_.maxConnectionRetries_ = 5;
    dataRetrieverParamCopy_.connectTrySleepTime_ = 10;
    dataRetrieverParamCopy_.headerRetryInterval_ = 5;
    dataRetrieverParamCopy_.retryInterval_ = 1;
    dataRetrieverParamCopy_.sleepTimeIfIdle_ =
      boost::posix_time::milliseconds(100);

    std::string tmpString(toolbox::net::getHostName());
    // strip domainame
    std::string::size_type pos = tmpString.find('.');  
    if (pos != std::string::npos) {  
      std::string basename = tmpString.substr(0,pos);  
      tmpString = basename;
    }
    dataRetrieverParamCopy_.hostName_ = tmpString;
  }
void smproxy::Configuration::setDQMArchivingDefaults ( ) [private]
void smproxy::Configuration::setDQMProcessingDefaults ( ) [private]
void smproxy::Configuration::setEventServingDefaults ( ) [private]
void smproxy::Configuration::setQueueConfigurationDefaults ( ) [private]
void smproxy::Configuration::setupAlarmInfoSpaceParams ( xdata::InfoSpace *  infoSpace) [private]

Definition at line 232 of file Configuration.cc.

References alarmParamCopy_, corruptedEventRate_, smproxy::AlarmParams::corruptedEventRate_, smproxy::AlarmParams::sendAlarms_, and sendAlarms_.

  {
    // copy the initial defaults to the xdata variables
    sendAlarms_ = alarmParamCopy_.sendAlarms_;
    corruptedEventRate_ = alarmParamCopy_.corruptedEventRate_;
 
    // bind the local xdata variables to the infospace
    infoSpace->fireItemAvailable("sendAlarms", &sendAlarms_);
    infoSpace->fireItemAvailable("corruptedEventRate", &corruptedEventRate_);
  }
void smproxy::Configuration::setupDataRetrieverInfoSpaceParams ( xdata::InfoSpace *  infoSpace) [private]

Definition at line 145 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_, retryInterval_, smproxy::DataRetrieverParams::retryInterval_, sleepTimeIfIdle_, smproxy::DataRetrieverParams::sleepTimeIfIdle_, smproxy::DataRetrieverParams::smRegistrationList_, and smRegistrationList_.

  {
    // copy the initial defaults into the xdata variables
    stor::utils::getXdataVector(dataRetrieverParamCopy_.smRegistrationList_, smRegistrationList_);
    allowMissingSM_ = dataRetrieverParamCopy_.allowMissingSM_;
    maxConnectionRetries_ = dataRetrieverParamCopy_.maxConnectionRetries_;
    connectTrySleepTime_ = dataRetrieverParamCopy_.connectTrySleepTime_;
    headerRetryInterval_ = dataRetrieverParamCopy_.headerRetryInterval_;
    retryInterval_ = dataRetrieverParamCopy_.retryInterval_;
    sleepTimeIfIdle_ = dataRetrieverParamCopy_.sleepTimeIfIdle_.total_milliseconds();

    // bind the local xdata variables to the infospace
    infoSpace->fireItemAvailable("SMRegistrationList", &smRegistrationList_);
    infoSpace->fireItemAvailable("allowMissingSM", &allowMissingSM_);
    infoSpace->fireItemAvailable("maxConnectionRetries", &maxConnectionRetries_);
    infoSpace->fireItemAvailable("connectTrySleepTime", &connectTrySleepTime_);
    infoSpace->fireItemAvailable("headerRetryInterval", &headerRetryInterval_);
    infoSpace->fireItemAvailable("retryInterval", &retryInterval_);
    infoSpace->fireItemAvailable("sleepTimeIfIdle", &sleepTimeIfIdle_);
  }
void smproxy::Configuration::setupDQMArchivingInfoSpaceParams ( xdata::InfoSpace *  infoSpace) [private]

Definition at line 203 of file Configuration.cc.

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

  {
    // copy the initial defaults to the xdata variables
    archiveDQM_ = dqmArchivingParamCopy_.archiveDQM_;
    archiveTopLevelFolder_ = dqmArchivingParamCopy_.archiveTopLevelFolder_;
    archiveIntervalDQM_ = dqmArchivingParamCopy_.archiveIntervalDQM_;
    filePrefixDQM_ = dqmArchivingParamCopy_.filePrefixDQM_;

    // bind the local xdata variables to the infospace
    infoSpace->fireItemAvailable("archiveDQM", &archiveDQM_);
    infoSpace->fireItemAvailable("archiveTopLevelFolder", &archiveTopLevelFolder_);
    infoSpace->fireItemAvailable("archiveIntervalDQM", &archiveIntervalDQM_);
    infoSpace->fireItemAvailable("filePrefixDQM", &filePrefixDQM_);
  }
void smproxy::Configuration::setupDQMProcessingInfoSpaceParams ( xdata::InfoSpace *  infoSpace) [private]

Definition at line 187 of file Configuration.cc.

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

  {
    // copy the initial defaults to the xdata variables
    collateDQM_ = dqmProcessingParamCopy_.collateDQM_;
    readyTimeDQM_ = dqmProcessingParamCopy_.readyTimeDQM_.total_seconds();
    useCompressionDQM_ = dqmProcessingParamCopy_.useCompressionDQM_;
    compressionLevelDQM_ = dqmProcessingParamCopy_.compressionLevelDQM_;

    // bind the local xdata variables to the infospace
    infoSpace->fireItemAvailable("collateDQM", &collateDQM_);
    infoSpace->fireItemAvailable("readyTimeDQM", &readyTimeDQM_);
    infoSpace->fireItemAvailable("useCompressionDQM", &useCompressionDQM_);
    infoSpace->fireItemAvailable("compressionLevelDQM", &compressionLevelDQM_);
  }
void smproxy::Configuration::setupEventServingInfoSpaceParams ( xdata::InfoSpace *  infoSpace) [private]

Definition at line 167 of file Configuration.cc.

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

  {
    // copy the initial defaults to the xdata variables
    activeConsumerTimeout_ = eventServeParamCopy_.activeConsumerTimeout_.total_seconds();
    consumerQueueSize_ = eventServeParamCopy_.consumerQueueSize_;
    consumerQueuePolicy_ = eventServeParamCopy_.consumerQueuePolicy_;
    _DQMactiveConsumerTimeout = eventServeParamCopy_._DQMactiveConsumerTimeout.total_seconds();
    _DQMconsumerQueueSize = eventServeParamCopy_._DQMconsumerQueueSize;
    _DQMconsumerQueuePolicy = eventServeParamCopy_._DQMconsumerQueuePolicy;

    // bind the local xdata variables to the infospace
    infoSpace->fireItemAvailable("activeConsumerTimeout", &activeConsumerTimeout_);
    infoSpace->fireItemAvailable("consumerQueueSize", &consumerQueueSize_);
    infoSpace->fireItemAvailable("consumerQueuePolicy", &consumerQueuePolicy_);
    infoSpace->fireItemAvailable("DQMactiveConsumerTimeout", &_DQMactiveConsumerTimeout);
    infoSpace->fireItemAvailable("DQMconsumerQueueSize", &_DQMconsumerQueueSize);
    infoSpace->fireItemAvailable("DQMconsumerQueuePolicy",&_DQMconsumerQueuePolicy);
  }
void smproxy::Configuration::setupQueueConfigurationInfoSpaceParams ( xdata::InfoSpace *  infoSpace) [private]

Definition at line 219 of file Configuration.cc.

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

  {
    // copy the initial defaults to the xdata variables
    registrationQueueSize_ = queueConfigParamCopy_.registrationQueueSize_;
    monitoringSleepSec_ =
      stor::utils::durationToSeconds(queueConfigParamCopy_.monitoringSleepSec_);
    
    // bind the local xdata variables to the infospace
    infoSpace->fireItemAvailable("registrationQueueSize", &registrationQueueSize_);
    infoSpace->fireItemAvailable("monitoringSleepSec", &monitoringSleepSec_);
  }
void smproxy::Configuration::updateAllParams ( )
void smproxy::Configuration::updateLocalAlarmData ( ) [private]
void smproxy::Configuration::updateLocalDataRetrieverData ( ) [private]
void smproxy::Configuration::updateLocalDQMArchivingData ( ) [private]
void smproxy::Configuration::updateLocalDQMProcessingData ( ) [private]
void smproxy::Configuration::updateLocalEventServingData ( ) [private]
void smproxy::Configuration::updateLocalQueueConfigurationData ( ) [private]

Member Data Documentation

xdata::Boolean smproxy::Configuration::allowMissingSM_ [private]
xdata::Boolean smproxy::Configuration::archiveDQM_ [private]
xdata::Boolean smproxy::Configuration::collateDQM_ [private]
xdata::UnsignedInteger32 smproxy::Configuration::connectTrySleepTime_ [private]

Definition at line 226 of file Configuration.h.

Referenced by setupAlarmInfoSpaceParams(), and updateLocalAlarmData().

xdata::String smproxy::Configuration::filePrefixDQM_ [private]

Definition at line 195 of file Configuration.h.

Referenced by actionPerformed(), and updateAllParams().

xdata::UnsignedInteger32 smproxy::Configuration::headerRetryInterval_ [private]
xdata::UnsignedInteger32 smproxy::Configuration::maxConnectionRetries_ [private]
xdata::Integer smproxy::Configuration::readyTimeDQM_ [private]
xdata::UnsignedInteger32 smproxy::Configuration::registrationQueueSize_ [private]
xdata::UnsignedInteger32 smproxy::Configuration::retryInterval_ [private]
xdata::Boolean smproxy::Configuration::sendAlarms_ [private]

Definition at line 225 of file Configuration.h.

Referenced by setupAlarmInfoSpaceParams(), and updateLocalAlarmData().

xdata::UnsignedInteger32 smproxy::Configuration::sleepTimeIfIdle_ [private]