blob: 7dbe04ac86089f55ed8e0a1e4ae8ddb02e72a546 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "monitoring_search_iterator.h"
namespace search::queryeval {
/**
* Search iterator that dumps the search stats of the underlying
* monitoring search iterator upon destruction.
*/
class MonitoringDumpIterator : public SearchIterator
{
private:
MonitoringSearchIterator::UP _search;
public:
MonitoringDumpIterator(MonitoringSearchIterator::UP iterator);
~MonitoringDumpIterator();
// Overrides SearchIterator
void doSeek(uint32_t docId) override;
void doUnpack(uint32_t docId) override;
Trinary is_strict() const override { return _search->is_strict(); }
void initRange(uint32_t beginid, uint32_t endid) override {
_search->initRange(beginid, endid);
SearchIterator::initRange(_search->getDocId()+1, _search->getEndId());
}
};
}
|