CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DiskWriter.h
Go to the documentation of this file.
1 // $Id: DiskWriter.h,v 1.14 2011/06/20 09:07:22 mommsen Exp $
3 
4 #ifndef EventFilter_StorageManager_DiskWriter_h
5 #define EventFilter_StorageManager_DiskWriter_h
6 
7 #include "boost/date_time/posix_time/posix_time_types.hpp"
8 #include "boost/shared_ptr.hpp"
9 
10 #include <stdint.h>
11 #include <vector>
12 
13 #include "toolbox/lang/Class.h"
14 #include "toolbox/task/WaitingWorkLoop.h"
15 #include "xdaq/Application.h"
16 
24 
25 
26 namespace stor {
27 
28  class I2OChain;
29  class StreamHandler;
30 
42  class DiskWriter : public toolbox::lang::Class
43  {
44  public:
45 
46 
47  DiskWriter(xdaq::Application*, SharedResourcesPtr sr);
48 
49  ~DiskWriter();
50 
51 
56  bool writeAction(toolbox::task::WorkLoop*);
57 
61  void startWorkLoop(std::string workloopName);
62 
63 
64  private:
65 
66  //Prevent copying of the DiskWriter
67  DiskWriter(DiskWriter const&);
69 
70 
74  void writeNextEvent();
75 
79  void writeEventToStreams(const I2OChain&);
80 
85 
90  void checkForFileTimeOuts(const bool doItNow = false);
91 
96 
101 
106 
110  void makeFaultyEventStream();
111 
116 
121 
125  void destroyStreams();
126 
131  void processEndOfLumiSection(const I2OChain&);
132 
137 
141  void writeEndOfRunMarker();
142 
143 
144  xdaq::Application* app_;
148 
149  unsigned int runNumber_;
150  boost::posix_time::time_duration timeout_; // Timeout on stream queue
151  utils::TimePoint_t lastFileTimeoutCheckTime_; // Last time we checked for time-out files
152 
153  typedef boost::shared_ptr<StreamHandler> StreamHandlerPtr;
154  typedef std::vector<StreamHandlerPtr> StreamHandlers;
156 
158 
160  toolbox::task::WorkLoop* writingWL_;
161 
162  };
163 
164 } // namespace stor
165 
166 #endif // EventFilter_StorageManager_DiskWriter_h
167 
168 
void checkForFileTimeOuts(const bool doItNow=false)
Definition: DiskWriter.cc:201
boost::shared_ptr< ErrStrConfigList > ErrStrConfigListPtr
void writeEndOfRunMarker()
Definition: DiskWriter.cc:302
DiskWriter & operator=(DiskWriter const &)
utils::TimePoint_t lastFileTimeoutCheckTime_
Definition: DiskWriter.h:151
SharedResourcesPtr sharedResources_
Definition: DiskWriter.h:145
boost::shared_ptr< SharedResources > SharedResourcesPtr
void checkStreamChangeRequest()
Definition: DiskWriter.cc:173
void writeEventToStreams(const I2OChain &)
Definition: DiskWriter.cc:148
DiskWritingParams dwParams_
Definition: DiskWriter.h:146
boost::shared_ptr< EndOfRunReport > EndOfRunReportPtr
boost::shared_ptr< EvtStrConfigList > EvtStrConfigListPtr
void makeEventStream(EventStreamConfigurationInfo &)
Definition: DiskWriter.cc:260
void configureEventStreams(EvtStrConfigListPtr)
Definition: DiskWriter.cc:220
boost::shared_ptr< DbFileHandler > DbFileHandlerPtr
Definition: DbFileHandler.h:65
void configureErrorStreams(ErrStrConfigListPtr)
Definition: DiskWriter.cc:235
void reportRemainingLumiSections()
Definition: DiskWriter.cc:293
boost::posix_time::ptime TimePoint_t
Definition: Utils.h:35
void closeTimedOutFiles(const utils::TimePoint_t)
Definition: DiskWriter.cc:213
unsigned int runNumber_
Definition: DiskWriter.h:149
std::vector< StreamHandlerPtr > StreamHandlers
Definition: DiskWriter.h:154
boost::posix_time::time_duration timeout_
Definition: DiskWriter.h:150
void processEndOfLumiSection(const I2OChain &)
Definition: DiskWriter.cc:314
boost::shared_ptr< StreamHandler > StreamHandlerPtr
Definition: DiskWriter.h:153
StreamHandlers streamHandlers_
Definition: DiskWriter.h:155
DiskWriter(xdaq::Application *, SharedResourcesPtr sr)
Definition: DiskWriter.cc:24
void makeFaultyEventStream()
Definition: DiskWriter.cc:249
const DbFileHandlerPtr dbFileHandler_
Definition: DiskWriter.h:147
void makeErrorStream(ErrorStreamConfigurationInfo &)
Definition: DiskWriter.cc:270
bool writeAction(toolbox::task::WorkLoop *)
Definition: DiskWriter.cc:79
xdaq::Application * app_
Definition: DiskWriter.h:144
void startWorkLoop(std::string workloopName)
Definition: DiskWriter.cc:52
StreamsMonitorCollection::EndOfRunReportPtr endOfRunReport_
Definition: DiskWriter.h:157
void writeNextEvent()
Definition: DiskWriter.cc:112
void destroyStreams()
Definition: DiskWriter.cc:280
toolbox::task::WorkLoop * writingWL_
Definition: DiskWriter.h:160