CMS 3D CMS Logo

JobController.h

Go to the documentation of this file.
00001 #ifndef HLT_JOB_CNTLER_HPP
00002 #define HLT_JOB_CNTLER_HPP
00003 // $Id: JobController.h,v 1.23 2008/12/19 23:25:27 biery Exp $
00004 
00005 #include "EventFilter/StorageManager/interface/FragmentCollector.h"
00006 #include "EventFilter/StorageManager/interface/EventServer.h"
00007 #include "EventFilter/StorageManager/interface/DQMEventServer.h"
00008 #include "EventFilter/StorageManager/interface/InitMsgCollection.h"
00009 #include "EventFilter/StorageManager/interface/SMPerformanceMeter.h"
00010 #include "EventFilter/StorageManager/interface/SMFUSenderList.h"
00011 
00012 #include "IOPool/Streamer/interface/EventBuffer.h"
00013 #include "IOPool/Streamer/interface/EventMessage.h"
00014 #include "IOPool/Streamer/interface/Messages.h"
00015 
00016 #include "boost/shared_ptr.hpp"
00017 #include "boost/thread/thread.hpp"
00018 
00019 #include "log4cplus/logger.h"
00020 
00021 #include <string>
00022 
00023 namespace stor
00024 {
00025 
00026   class JobController
00027   {
00028   public:
00029     JobController(const std::string& my_config,
00030                   log4cplus::Logger& applicationLogger,
00031                   FragmentCollector::Deleter);
00032 
00033     ~JobController();
00034 
00035     void start();
00036     void stop();
00037     void join();
00038 
00039     void receiveMessage(FragEntry& entry);
00040 
00041     edm::EventBuffer& getFragmentQueue()
00042     { return collector_->getFragmentQueue(); }
00043 
00044     void setEventServer(boost::shared_ptr<EventServer>& es)
00045     {
00046       if (collector_.get() != NULL) collector_->setEventServer(es);
00047       eventServer_ = es;
00048     }
00049     boost::shared_ptr<EventServer>& getEventServer() { return eventServer_; }
00050 
00051     void setDQMEventServer(boost::shared_ptr<DQMEventServer>& es)
00052     {
00053       if (collector_.get() != NULL) collector_->setDQMEventServer(es);
00054       DQMeventServer_ = es;
00055     }
00056     boost::shared_ptr<DQMEventServer>& getDQMEventServer() { return DQMeventServer_; }
00057 
00058     void setInitMsgCollection(boost::shared_ptr<InitMsgCollection>& imColl)
00059     {
00060       if (collector_.get() != NULL) collector_->setInitMsgCollection(imColl);
00061       initMsgCollection_ = imColl;
00062     }
00063     boost::shared_ptr<InitMsgCollection>& getInitMsgCollection() { return initMsgCollection_; }
00064 
00065     void setSMRBSenderList(SMFUSenderList* senderList) {
00066       if (collector_.get() != NULL) collector_->setSMRBSenderList(senderList);
00067       smRBSenderList_ = senderList;
00068     }
00069 
00070     void setNumberOfFileSystems(int disks)    { collector_->setNumberOfFileSystems(disks); }
00071     void setFileCatalog(std::string catalog)  { collector_->setFileCatalog(catalog); }
00072     void setSourceId(std::string sourceId)    { collector_->setSourceId(sourceId); }
00073     void setCollateDQM(bool collateDQM)       { collector_->setCollateDQM(collateDQM);}
00074     void setArchiveDQM(bool archiveDQM)       { collector_->setArchiveDQM(archiveDQM);}
00075     void setArchiveIntervalDQM(int archiveInterval) {
00076       collector_->setArchiveIntervalDQM(archiveInterval);
00077     }
00078     void setPurgeTimeDQM(int purgeTimeDQM)    { collector_->setPurgeTimeDQM(purgeTimeDQM);}
00079     void setReadyTimeDQM(int readyTimeDQM)    { collector_->setReadyTimeDQM(readyTimeDQM);}
00080     void setFilePrefixDQM(std::string filePrefixDQM)  { collector_->setFilePrefixDQM(filePrefixDQM);}
00081     void setUseCompressionDQM(bool useCompressionDQM)
00082     { collector_->setUseCompressionDQM(useCompressionDQM);}
00083     void setCompressionLevelDQM(bool compressionLevelDQM)
00084     { collector_->setCompressionLevelDQM(compressionLevelDQM);}
00085     void setFileClosingTestInterval(int value) { fileClosingTestInterval_ = value; }
00086 
00087     std::list<std::string>& get_filelist() { return collector_->get_filelist(); }
00088     std::list<std::string>& get_currfiles() { return collector_->get_currfiles(); }
00089     std::vector<uint32>& get_storedEvents() { return collector_->get_storedEvents(); }
00090     std::vector<std::string>& get_storedNames() { return collector_->get_storedNames(); }
00091     boost::shared_ptr<stor::SMOnlyStats> get_stats() { return collector_->get_stats(); }
00092 
00093   private:
00094     void init(const std::string& my_config,FragmentCollector::Deleter);
00095     void processCommands();
00096     static void run(JobController*);
00097 
00098     boost::shared_ptr<FragmentCollector> collector_;
00099     boost::shared_ptr<EventServer> eventServer_;
00100     boost::shared_ptr<DQMEventServer> DQMeventServer_;
00101     boost::shared_ptr<InitMsgCollection> initMsgCollection_;
00102     SMFUSenderList* smRBSenderList_;
00103 
00104     int fileClosingTestInterval_;
00105     log4cplus::Logger& applicationLogger_;
00106 
00107     boost::shared_ptr<boost::thread> me_;
00108   };
00109 }
00110 
00111 #endif
00112 

Generated on Tue Jun 9 17:34:52 2009 for CMSSW by  doxygen 1.5.4