CMS 3D CMS Logo

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

#include <StateMachine.h>

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

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 ()
 
- Public Member Functions inherited from stor::Operations
void moveToFailedState (xcept::Exception &exception) const
 
void noFragmentToProcess () const
 
 Operations ()
 
void processI2OFragment (I2OChain &frag) const
 
std::string stateName () const
 
virtual ~Operations ()=0
 

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
 

Additional Inherited Members

- Protected Member Functions inherited from stor::Operations
virtual void do_noFragmentToProcess () const
 
virtual void do_processI2OFragment (I2OChain &frag) const
 
void safeEntryAction ()
 
void safeExitAction ()
 

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.

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().

22  : my_base(c)
23 {
25 }
void safeEntryAction()
Definition: Operations.cc:77
Ready::~Ready ( )
virtual

Definition at line 123 of file Ready.cc.

References stor::Operations::safeExitAction().

124 {
125  safeExitAction();
126 }
void safeExitAction()
Definition: Operations.cc:108

Member Function Documentation

void Ready::do_entryActionWork ( )
privatevirtual

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, cppFunctionSkipper::exception, edm::hlt::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_.

28 {
29  TransitionRecord tr( stateName(), true );
30  outermost_context().updateHistory( tr );
31 
32  SharedResourcesPtr sharedResources =
33  outermost_context().getSharedResources();
34 
35  // update all configuration parameters
36  std::string errorMsg = "Failed to update configuration parameters in Ready state";
37  try
38  {
39  sharedResources->configuration_->updateAllParams();
40  }
41  catch(xcept::Exception &e)
42  {
43  XCEPT_DECLARE_NESTED(stor::exception::Configuration,
44  sentinelException, errorMsg, e);
45  sharedResources->alarmHandler_->moveToFailedState( sentinelException );
46  return;
47  }
48  catch( std::exception &e )
49  {
50  errorMsg.append(": ");
51  errorMsg.append( e.what() );
52 
53  XCEPT_DECLARE(stor::exception::Configuration,
54  sentinelException, errorMsg);
55  sharedResources->alarmHandler_->moveToFailedState( sentinelException );
56  return;
57  }
58  catch(...)
59  {
60  errorMsg.append(": unknown exception");
61 
62  XCEPT_DECLARE(stor::exception::Configuration,
63  sentinelException, errorMsg);
64  sharedResources->alarmHandler_->moveToFailedState( sentinelException );
65  return;
66  }
67 
68  // configure the various queue sizes
69  QueueConfigurationParams queueParams =
70  sharedResources->configuration_->getQueueConfigurationParams();
71  sharedResources->commandQueue_->
72  setCapacity(queueParams.commandQueueSize_);
73  sharedResources->fragmentQueue_->
74  setCapacity(queueParams.fragmentQueueSize_);
75  sharedResources->fragmentQueue_->
76  setMemory(queueParams.fragmentQueueMemoryLimitMB_ * 1024*1024);
77  sharedResources->registrationQueue_->
78  setCapacity(queueParams.registrationQueueSize_);
79  sharedResources->streamQueue_->
80  setCapacity(queueParams.streamQueueSize_);
81  sharedResources->streamQueue_->
82  setMemory(queueParams.streamQueueMemoryLimitMB_ * 1024*1024);
83  sharedResources->dqmEventQueue_->
84  setCapacity(queueParams.dqmEventQueueSize_);
85  sharedResources->dqmEventQueue_->
86  setMemory(queueParams.dqmEventQueueMemoryLimitMB_ * 1024*1024);
87 
88  // convert the SM configuration string into ConfigInfo objects
89  // and store them for later use
90  DiskWritingParams dwParams =
91  sharedResources->configuration_->getDiskWritingParams();
92  EvtStrConfigListPtr evtCfgList(new EvtStrConfigList);
93  ErrStrConfigListPtr errCfgList(new ErrStrConfigList);
94 
96  errCfgList);
97  sharedResources->configuration_->setCurrentEventStreamConfig(evtCfgList);
98  sharedResources->configuration_->setCurrentErrorStreamConfig(errCfgList);
99 
100  // reset all alarms
101  sharedResources->alarmHandler_->clearAllAlarms();
102 
103  // configure the disk monitoring
105  sharedResources->statisticsReporter_->getResourceMonitorCollection();
106  AlarmParams ap =
107  sharedResources->configuration_->getAlarmParams();
109  sharedResources->configuration_->getResourceMonitorParams();
110  rmc.configureAlarms(ap);
111  rmc.configureResources(rmp);
112  rmc.configureDisks(dwParams);
113 
114  // configure the run monitoring
115  RunMonitorCollection& run_mc =
116  sharedResources->statisticsReporter_->getRunMonitorCollection();
117  run_mc.configureAlarms(ap);
118 
119  // configure the discard manager
120  sharedResources->discardManager_->configure();
121 }
void configureAlarms(AlarmParams const &)
std::string stateName() const
Definition: Operations.cc:39
boost::shared_ptr< ErrStrConfigList > ErrStrConfigListPtr
std::vector< ErrorStreamConfigurationInfo > ErrStrConfigList
unsigned int dqmEventQueueMemoryLimitMB_
Definition: Configuration.h:91
std::vector< EventStreamConfigurationInfo > EvtStrConfigList
unsigned int fragmentQueueMemoryLimitMB_
Definition: Configuration.h:93
unsigned int streamQueueMemoryLimitMB_
Definition: Configuration.h:96
boost::shared_ptr< SharedResources > SharedResourcesPtr
boost::shared_ptr< EvtStrConfigList > EvtStrConfigListPtr
void configureDisks(DiskWritingParams const &)
void parseStreamConfiguration(std::string cfgString, EvtStrConfigListPtr evtCfgList, ErrStrConfigListPtr errCfgList)
void configureResources(ResourceMonitorParams const &)
std::string streamConfiguration_
Definition: Configuration.h:32
void Ready::do_exitActionWork ( )
privatevirtual

Implements stor::Operations.

Definition at line 128 of file Ready.cc.

References stor::Operations::stateName().

129 {
130  TransitionRecord tr( stateName(), false );
131  outermost_context().updateHistory( tr );
132 }
std::string stateName() const
Definition: Operations.cc:39
void Ready::do_moveToFailedState ( xcept::Exception &  exception) const
privatevirtual

Implements stor::Operations.

Definition at line 139 of file Ready.cc.

140 {
141  outermost_context().getSharedResources()->alarmHandler_->moveToFailedState( exception );
142 }
string Ready::do_stateName ( ) const
privatevirtual

Implements stor::Operations.

Definition at line 134 of file Ready.cc.

135 {
136  return std::string( "Ready" );
137 }