CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EventRetriever.h
Go to the documentation of this file.
1 // $Id: EventRetriever.h,v 1.1.2.17 2011/03/01 08:32:14 mommsen Exp $
3 
4 #ifndef EventFilter_SMProxyServer_EventRetriever_h
5 #define EventFilter_SMProxyServer_EventRetriever_h
6 
18 
19 #include <boost/scoped_ptr.hpp>
20 #include <boost/shared_ptr.hpp>
21 #include <boost/thread/thread.hpp>
22 
23 #include <string>
24 #include <vector>
25 
26 
27 
28 namespace smproxy {
29 
30  class StateMachine;
31 
32 
41  template<class RegInfo, class QueueCollectionPtr>
43  {
44  public:
45 
46  typedef boost::shared_ptr<RegInfo> RegInfoPtr;
47 
49  (
50  StateMachine*,
51  const RegInfoPtr
52  );
53 
55 
59  void addConsumer(const RegInfoPtr);
60 
64  void stop();
65 
69  const stor::QueueIDs& getQueueIDs() const
70  { return queueIDs_; }
71 
75  size_t getConnectedSMCount() const
76  { return eventServers_.size(); }
77 
78 
79  private:
80 
81  void activity(const edm::ParameterSet&);
82  void doIt(const edm::ParameterSet&);
83  void do_stop();
84  bool connect(const edm::ParameterSet&);
85  void connectToSM(const std::string& sourceURL, const edm::ParameterSet&);
86  bool openConnection(const ConnectionID&, const RegInfoPtr);
87  bool tryToReconnect();
88  void getInitMsg();
92  bool anyActiveConsumers(QueueCollectionPtr) const;
95 
96  //Prevent copying of the EventRetriever
99 
103 
106 
107  boost::scoped_ptr<boost::thread> thread_;
108  static size_t retrieverCount_;
109  size_t instance_;
110 
112  typedef boost::shared_ptr<EventServer> EventServerPtr;
113  typedef std::map<ConnectionID, EventServerPtr> EventServers;
115  typename EventServers::iterator nextSMtoUse_;
116 
117  typedef std::vector<ConnectionID> ConnectionIDs;
120 
122 
125 
130 
131  };
132 
133 } // namespace smproxy
134 
135 #endif // EventFilter_SMProxyServer_EventRetriever_h
136 
137 
void doIt(const edm::ParameterSet &)
const stor::QueueIDs & getQueueIDs() const
static boost::mutex mutex
Definition: LHEProxy.cc:11
static size_t retrieverCount_
stor::QueueIDs queueIDs_
std::vector< QueueID > QueueIDs
Definition: QueueID.h:80
std::vector< ConnectionID > ConnectionIDs
bool openConnection(const ConnectionID &, const RegInfoPtr)
boost::mutex connectionIDsLock_
EventRetriever(StateMachine *, const RegInfoPtr)
bool anyActiveConsumers(QueueCollectionPtr) const
DataRetrieverMonitorCollection & dataRetrieverMonitorCollection_
StateMachine * stateMachine_
boost::scoped_ptr< boost::thread > thread_
boost::posix_time::time_duration Duration_t
Definition: Utils.h:41
void processCompletedTopLevelFolders()
boost::posix_time::ptime TimePoint_t
Definition: Utils.h:35
EventServers::iterator nextSMtoUse_
stor::EventServerProxy< RegInfo > EventServer
void addConsumer(const RegInfoPtr)
stor::utils::TimePoint_t nextReconnectTry_
void activity(const edm::ParameterSet &)
EventRetriever & operator=(EventRetriever const &)
stor::utils::TimePoint_t nextRequestTime_
ConnectionIDs connectionIDs_
stor::DQMEventStore< DQMEventMsg, EventRetriever< RegInfo, QueueCollectionPtr >, StateMachine > dqmEventStore_
stor::utils::Duration_t minEventRequestInterval_
bool getNextEvent(stor::CurlInterface::Content &)
void connectToSM(const std::string &sourceURL, const edm::ParameterSet &)
boost::shared_ptr< EventServer > EventServerPtr
void updateConsumersSetting(const stor::utils::Duration_t &)
std::map< ConnectionID, EventServerPtr > EventServers
bool adjustMinEventRequestInterval(const stor::utils::Duration_t &)
size_t getConnectedSMCount() const
bool connect(const edm::ParameterSet &)
const DataRetrieverParams dataRetrieverParams_
boost::shared_ptr< RegInfo > RegInfoPtr
std::vector< char > Content
Definition: CurlInterface.h:27