aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/tests/attribute/benchmark/attributesearcher.h
diff options
context:
space:
mode:
Diffstat (limited to 'searchlib/src/tests/attribute/benchmark/attributesearcher.h')
-rw-r--r--searchlib/src/tests/attribute/benchmark/attributesearcher.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/searchlib/src/tests/attribute/benchmark/attributesearcher.h b/searchlib/src/tests/attribute/benchmark/attributesearcher.h
index d6e14d6793d..ea2d7190f25 100644
--- a/searchlib/src/tests/attribute/benchmark/attributesearcher.h
+++ b/searchlib/src/tests/attribute/benchmark/attributesearcher.h
@@ -2,7 +2,6 @@
#pragma once
-#include <vespa/searchlib/util/runnable.h>
#include <vespa/searchlib/attribute/attribute.h>
#include <vespa/searchlib/attribute/attributeguard.h>
#include <vespa/searchlib/attribute/search_context.h>
@@ -59,7 +58,7 @@ public:
};
-class AttributeSearcher : public Runnable
+class AttributeSearcher
{
protected:
using AttributePtr = AttributeVector::SP;
@@ -67,17 +66,23 @@ protected:
const AttributePtr & _attrPtr;
vespalib::Timer _timer;
AttributeSearcherStatus _status;
-
+ std::thread _thread;
+
public:
- AttributeSearcher(const AttributePtr & attrPtr) :
- Runnable(), _attrPtr(attrPtr), _timer(), _status()
+ AttributeSearcher(const AttributePtr & attrPtr)
+ : _attrPtr(attrPtr), _timer(), _status(), _thread()
{
_status._numClients = 1;
}
- virtual void doRun() override = 0;
+ virtual ~AttributeSearcher();
+ virtual void doRun() = 0;
+ void start() { _thread = std::thread([this](){doRun();}); }
+ void join() { _thread.join(); }
AttributeSearcherStatus & getStatus() { return _status; }
void buildTermQuery(std::vector<char> & buffer, const vespalib::string & index, const char * term, bool prefix = false);
};
+AttributeSearcher::~AttributeSearcher() = default;
+
void
AttributeSearcher::buildTermQuery(std::vector<char> & buffer, const vespalib::string & index, const char * term, bool prefix)