1 #ifndef ARTDAQ_DAQRATE_DATASENDERMANAGER_HH
2 #define ARTDAQ_DAQRATE_DATASENDERMANAGER_HH
7 #include <netinet/in.h>
9 #include "fhiclcpp/fwd.h"
11 #include "artdaq-core/Data/Fragment.hh"
12 #include "artdaq/TransferPlugins/TransferInterface.hh"
13 #include "artdaq/DAQrate/detail/FragCounter.hh"
14 #include "artdaq-utilities/Plugins/MetricManager.hh"
15 #include "artdaq/DAQrate/detail/RoutingPacket.hh"
19 class DataSenderManager;
66 std::pair<int, TransferInterface::CopyStatus>
sendFragment(Fragment&& frag);
101 int calcDest_(Fragment::sequence_id_t)
const;
103 void setupTableListener_();
105 void startTableReceiverThread_();
107 void receiveTableUpdatesLoop_();
110 std::map<int, std::unique_ptr<artdaq::TransferInterface>> destinations_;
111 std::set<int> enabled_destinations_;
115 bool broadcast_sends_;
116 bool non_blocking_mode_;
117 size_t send_timeout_us_;
118 size_t send_retry_count_;
120 bool use_routing_master_;
122 std::atomic<bool> should_stop_;
124 std::string table_address_;
126 std::string ack_address_;
127 struct sockaddr_in ack_addr_;
130 std::map<Fragment::sequence_id_t, int> routing_table_;
131 mutable std::mutex routing_mutex_;
132 boost::thread routing_thread_;
133 mutable std::atomic<size_t> routing_wait_time_;
135 int routing_timeout_ms_;
136 int routing_retry_count_;
144 return sent_frag_count_.
count();
152 return sent_frag_count_.slotCount(rank);
154 #endif //ARTDAQ_DAQRATE_DATASENDERMANAGER_HH
RoutingMasterMode
Mode indicating whether the RoutingMaster is routing events by Sequence ID or by Send Count...
size_t destinationCount() const
Get the number of configured destinations.
Sends Fragment objects using TransferInterface plugins. Uses Routing Tables if confgiured, otherwise will Round-Robin Fragments to the destinations.
virtual ~DataSenderManager()
DataSenderManager Destructor.
size_t slotCount(size_t rank) const
Get the count of Fragment objects sent by this DataSenderManager to a given destination.
Keep track of the count of Fragments received from a set of sources.
std::pair< int, TransferInterface::CopyStatus > sendFragment(Fragment &&frag)
Send the given Fragment. Return the rank of the destination to which the Fragment was sent...
DataSenderManager(const fhicl::ParameterSet &ps)
DataSenderManager Constructor.
size_t GetRoutingTableEntryCount() const
Gets the current size of the Routing Table, in case other parts of the system want to use this inform...
size_t count() const
Return the count of Fragment objects sent by this DataSenderManagerq.
std::set< int > enabled_destinations() const
Get the list of enabled destinations.
size_t count() const
Get the total number of Fragments received.