DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DefaultSkipListRequestHandler.hxx
Go to the documentation of this file.
1// Declarations for DefaultSkipListRequestHandler
2
3namespace dunedaq {
4namespace datahandlinglibs {
5
6template<class T>
7void
9{
10 size_t removed_ctr = 0;
11 uint64_t tailts = 0; // oldest // NOLINT(build/unsigned)
12 uint64_t headts = 0; // newest // NOLINT(build/unsigned)
13 {
14 SkipListAcc acc(inherited::m_latency_buffer->get_skip_list());
15 auto tail = acc.last();
16 auto head = acc.first();
17 if (tail && head) {
18 tailts = (*tail).get_timestamp(); // tailptr->get_timestamp();
19 headts = (*head).get_timestamp(); // headptr->get_timestamp();
20 TLOG_DEBUG(TLVL_WORK_STEPS) << "Cleanup REQUEST with "
21 << "Oldest stored TS=" << headts << " "
22 << "Newest stored TS=" << tailts;
23 if (tailts - headts > m_max_ts_diff) { // ts differnce exceeds maximum
24 ++(inherited::m_pop_reqs);
25 uint64_t timediff = m_max_ts_diff; // NOLINT(build/unsigned)
26 while (timediff >= m_max_ts_diff) {
27 bool removed = acc.remove(*head);
28 if (!removed) {
29 TLOG_DEBUG(TLVL_WORK_STEPS) << "Unsuccesfull remove from SKL during cleanup: " << removed;
30 } else {
31 ++removed_ctr;
32 }
33 head = acc.first();
34 headts = (*head).get_timestamp();
35 timediff = tailts - headts;
36 }
37 inherited::m_pops_count += removed_ctr;
38 }
39 } else {
40 TLOG_DEBUG(TLVL_WORK_STEPS) << "Didn't manage to get SKL head and tail!";
41 }
42 }
43 inherited::m_num_buffer_cleanups++;
44}
45
46} // namespace datahandlinglibs
47} // namespace dunedaq
typename folly::ConcurrentSkipList< T >::Accessor SkipListAcc
#define TLOG_DEBUG(lvl,...)
Definition Logging.hpp:112
Including Qt Headers.