CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions

stor::Ready Class Reference

#include <StateMachine.h>

Inheritance diagram for stor::Ready:
state stor::Operations

List of all members.

Public Types

typedef bsc::transition
< HaltDone, Halted
DT
typedef bsc::transition< Halt,
Halted
HT
typedef boost::mpl::list< ST,
HT, DT
reactions
typedef bsc::transition
< Reconfigure, Ready
ST

Public Member Functions

 Ready (my_context)
virtual ~Ready ()

Private Member Functions

virtual void do_entryActionWork ()
virtual void do_exitActionWork ()
virtual void do_moveToFailedState (xcept::Exception &exception) const
virtual std::string do_stateName () const

Detailed Description

Ready state

Author:
mommsen
Revision:
1.11
Date:
2011/03/07 15:31:32

Definition at line 278 of file StateMachine.h.


Member Typedef Documentation

typedef bsc::transition<HaltDone,Halted> stor::Ready::DT

Definition at line 285 of file StateMachine.h.

typedef bsc::transition<Halt,Halted> stor::Ready::HT

Definition at line 284 of file StateMachine.h.

typedef boost::mpl::list<ST,HT,DT> stor::Ready::reactions

Definition at line 286 of file StateMachine.h.

typedef bsc::transition<Reconfigure,Ready> stor::Ready::ST

Definition at line 283 of file StateMachine.h.


Constructor & Destructor Documentation

Ready::Ready ( my_context  c)

Definition at line 22 of file Ready.cc.

References stor::Operations::safeEntryAction().

                          : my_base(c)
{
  safeEntryAction();
}
Ready::~Ready ( ) [virtual]

Definition at line 123 of file Ready.cc.

References stor::Operations::safeExitAction().


Member Function Documentation

void Ready::do_entryActionWork ( ) [private, virtual]

Implements stor::Operations.

Definition at line 27 of file Ready.cc.

References stor::QueueConfigurationParams::commandQueueSize_, edm::errors::Configuration, stor::RunMonitorCollection::configureAlarms(), stor::ResourceMonitorCollection::configureAlarms(), stor::ResourceMonitorCollection::configureDisks(), stor::ResourceMonitorCollection::configureResources(), stor::QueueConfigurationParams::dqmEventQueueMemoryLimitMB_, stor::QueueConfigurationParams::dqmEventQueueSize_, alignCSCRings::e, exception, Exception, stor::QueueConfigurationParams::fragmentQueueMemoryLimitMB_, stor::QueueConfigurationParams::fragmentQueueSize_, stor::parseStreamConfiguration(), stor::QueueConfigurationParams::registrationQueueSize_, stor::Operations::stateName(), stor::DiskWritingParams::streamConfiguration_, stor::QueueConfigurationParams::streamQueueMemoryLimitMB_, and stor::QueueConfigurationParams::streamQueueSize_.

{
  TransitionRecord tr( stateName(), true );
  outermost_context().updateHistory( tr );

  SharedResourcesPtr sharedResources =
    outermost_context().getSharedResources();

  // update all configuration parameters
  std::string errorMsg = "Failed to update configuration parameters in Ready state";
  try
  {
    sharedResources->configuration_->updateAllParams();
  }
  catch(xcept::Exception &e)
  {
    XCEPT_DECLARE_NESTED(stor::exception::Configuration,
      sentinelException, errorMsg, e);
    sharedResources->alarmHandler_->moveToFailedState( sentinelException );
    return;
  }
  catch( std::exception &e )
  {
    errorMsg.append(": ");
    errorMsg.append( e.what() );

    XCEPT_DECLARE(stor::exception::Configuration,
      sentinelException, errorMsg);
    sharedResources->alarmHandler_->moveToFailedState( sentinelException );
    return;
  }
  catch(...)
  {
    errorMsg.append(": unknown exception");

    XCEPT_DECLARE(stor::exception::Configuration,
      sentinelException, errorMsg);
    sharedResources->alarmHandler_->moveToFailedState( sentinelException );
    return;
  }

  // configure the various queue sizes
  QueueConfigurationParams queueParams =
    sharedResources->configuration_->getQueueConfigurationParams();
  sharedResources->commandQueue_->
    setCapacity(queueParams.commandQueueSize_);
  sharedResources->fragmentQueue_->
    setCapacity(queueParams.fragmentQueueSize_);
  sharedResources->fragmentQueue_->
    setMemory(queueParams.fragmentQueueMemoryLimitMB_ * 1024*1024);
  sharedResources->registrationQueue_->
    setCapacity(queueParams.registrationQueueSize_);
  sharedResources->streamQueue_->
    setCapacity(queueParams.streamQueueSize_);
  sharedResources->streamQueue_->
    setMemory(queueParams.streamQueueMemoryLimitMB_ * 1024*1024);
  sharedResources->dqmEventQueue_->
    setCapacity(queueParams.dqmEventQueueSize_);
  sharedResources->dqmEventQueue_->
    setMemory(queueParams.dqmEventQueueMemoryLimitMB_ * 1024*1024);

  // convert the SM configuration string into ConfigInfo objects
  // and store them for later use
  DiskWritingParams dwParams =
    sharedResources->configuration_->getDiskWritingParams();
  EvtStrConfigListPtr evtCfgList(new EvtStrConfigList);
  ErrStrConfigListPtr errCfgList(new ErrStrConfigList);

  parseStreamConfiguration(dwParams.streamConfiguration_, evtCfgList,
                           errCfgList);
  sharedResources->configuration_->setCurrentEventStreamConfig(evtCfgList);
  sharedResources->configuration_->setCurrentErrorStreamConfig(errCfgList);

  // reset all alarms
  sharedResources->alarmHandler_->clearAllAlarms();

  // configure the disk monitoring
  ResourceMonitorCollection& rmc =
    sharedResources->statisticsReporter_->getResourceMonitorCollection();
  AlarmParams ap =
    sharedResources->configuration_->getAlarmParams();
  ResourceMonitorParams rmp =
    sharedResources->configuration_->getResourceMonitorParams();
  rmc.configureAlarms(ap);
  rmc.configureResources(rmp);
  rmc.configureDisks(dwParams);
  
  // configure the run monitoring
  RunMonitorCollection& run_mc =
    sharedResources->statisticsReporter_->getRunMonitorCollection();
  run_mc.configureAlarms(ap);

  // configure the discard manager
  sharedResources->discardManager_->configure();
}
void Ready::do_exitActionWork ( ) [private, virtual]

Implements stor::Operations.

Definition at line 128 of file Ready.cc.

References stor::Operations::stateName().

{
  TransitionRecord tr( stateName(), false );
  outermost_context().updateHistory( tr );
}
void Ready::do_moveToFailedState ( xcept::Exception exception) const [private, virtual]

Implements stor::Operations.

Definition at line 139 of file Ready.cc.

{
  outermost_context().getSharedResources()->alarmHandler_->moveToFailedState( exception );
}
string Ready::do_stateName ( ) const [private, virtual]

Implements stor::Operations.

Definition at line 134 of file Ready.cc.

{
  return std::string( "Ready" );
}