aboutsummaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-12-15 15:44:55 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-12-15 15:49:37 +0000
commit3a1502c2e21eec47d34d73bb5ba641dfec51a5c2 (patch)
tree10ad6d5d3d4d49b89f32f2ef974e1aad2e64a5e6 /searchcore
parent28f8cf3e298d51ca703ceee36a992297d38637cc (diff)
Remove most of the now void clock indirection.
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/tests/grouping/grouping_test.cpp24
-rw-r--r--searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp4
-rw-r--r--searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp2
-rw-r--r--searchcore/src/tests/proton/documentdb/executor_threading_service/executor_threading_service_test.cpp1
-rw-r--r--searchcore/src/tests/proton/index/indexcollection_test.cpp3
-rw-r--r--searchcore/src/tests/proton/matching/matching_test.cpp2
-rw-r--r--searchcore/src/tests/proton/matching/request_context/request_context_test.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/grouping/groupingcontext.cpp10
-rw-r--r--searchcore/src/vespa/searchcore/grouping/groupingcontext.h22
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/fakesearchcontext.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/match_tools.h1
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/matcher.cpp10
-rw-r--r--searchcore/src/vespa/searchcore/proton/matching/matcher.h24
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentdb.cpp5
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp5
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h4
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/matchers.cpp4
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/matchers.h4
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp8
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.h5
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp2
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h7
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/threading_service_observer.h1
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/transport_helper.cpp11
-rw-r--r--searchcore/src/vespa/searchcore/proton/test/transport_helper.h8
-rw-r--r--searchcore/src/vespa/searchcorespi/index/indexmaintainer.cpp3
-rw-r--r--searchcore/src/vespa/searchcorespi/index/ithreadingservice.h1
-rw-r--r--searchcore/src/vespa/searchcorespi/index/warmupindexcollection.cpp13
-rw-r--r--searchcore/src/vespa/searchcorespi/index/warmupindexcollection.h5
31 files changed, 85 insertions, 114 deletions
diff --git a/searchcore/src/tests/grouping/grouping_test.cpp b/searchcore/src/tests/grouping/grouping_test.cpp
index 951b0bf2857..905384416e6 100644
--- a/searchcore/src/tests/grouping/grouping_test.cpp
+++ b/searchcore/src/tests/grouping/grouping_test.cpp
@@ -178,7 +178,7 @@ TEST_F("testGroupingContextInitialization", DoomFixture()) {
baseRequest.serialize(nos);
AllocatedBitVector bv(1);
- GroupingContext context(bv, f1.clock.clock(), f1.timeOfDoom, os.data(), os.size());
+ GroupingContext context(bv, f1.clock.nowRef(), f1.timeOfDoom, os.data(), os.size());
ASSERT_TRUE(!context.empty());
GroupingContext::GroupingList list = context.getGroupingList();
ASSERT_TRUE(list.size() == 1);
@@ -209,7 +209,7 @@ TEST_F("testGroupingContextUsage", DoomFixture()) {
auto r1 = std::make_shared<Grouping>(request1);
auto r2 = std::make_shared<Grouping>(request2);
AllocatedBitVector bv(1);
- GroupingContext context(bv, f1.clock.clock(), f1.timeOfDoom);
+ GroupingContext context(bv, f1.clock.nowRef(), f1.timeOfDoom);
ASSERT_TRUE(context.empty());
context.addGrouping(r1);
ASSERT_TRUE(context.getGroupingList().size() == 1);
@@ -232,7 +232,7 @@ TEST_F("testGroupingContextSerializing", DoomFixture()) {
baseRequest.serialize(nos);
AllocatedBitVector bv(1);
- GroupingContext context(bv, f1.clock.clock(), f1.timeOfDoom);
+ GroupingContext context(bv, f1.clock.nowRef(), f1.timeOfDoom);
auto bp = std::make_shared<Grouping>(baseRequest);
context.addGrouping(bp);
context.serialize();
@@ -251,7 +251,7 @@ TEST_F("testGroupingManager", DoomFixture()) {
.addLevel(createGL(MU<AttributeNode>("attr2"), MU<AttributeNode>("attr3")));
AllocatedBitVector bv(1);
- GroupingContext context(bv, f1.clock.clock(), f1.timeOfDoom);
+ GroupingContext context(bv, f1.clock.nowRef(), f1.timeOfDoom);
auto bp = std::make_shared<Grouping>(request1);
context.addGrouping(bp);
GroupingManager manager(context);
@@ -285,7 +285,7 @@ TEST_F("testGroupingSession", DoomFixture()) {
auto r1 = std::make_shared<Grouping>(request1);
auto r2 = std::make_shared<Grouping>(request2);
- GroupingContext initContext(world.bv, f1.clock.clock(), f1.timeOfDoom);
+ GroupingContext initContext(world.bv, f1.clock.nowRef(), f1.timeOfDoom);
initContext.addGrouping(r1);
initContext.addGrouping(r2);
SessionId id("foo");
@@ -317,7 +317,7 @@ TEST_F("testGroupingSession", DoomFixture()) {
}
// Test second pass
{
- GroupingContext context(world.bv, f1.clock.clock(), f1.timeOfDoom);
+ GroupingContext context(world.bv, f1.clock.nowRef(), f1.timeOfDoom);
auto r = std::make_shared<Grouping>(request1);
r->setFirstLevel(1);
r->setLastLevel(1);
@@ -328,7 +328,7 @@ TEST_F("testGroupingSession", DoomFixture()) {
}
// Test last pass. Session should be marked as finished
{
- GroupingContext context(world.bv, f1.clock.clock(), f1.timeOfDoom);
+ GroupingContext context(world.bv, f1.clock.nowRef(), f1.timeOfDoom);
auto r = std::make_shared<Grouping>(request1);
r->setFirstLevel(2);
r->setLastLevel(2);
@@ -351,7 +351,7 @@ TEST_F("testEmptySessionId", DoomFixture()) {
.addLevel(createGL(MU<AttributeNode>("attr2"), MU<AttributeNode>("attr3")));
auto r1 = std::make_shared<Grouping>(request1);
- GroupingContext initContext(world.bv, f1.clock.clock(), f1.timeOfDoom);
+ GroupingContext initContext(world.bv, f1.clock.nowRef(), f1.timeOfDoom);
initContext.addGrouping(r1);
SessionId id;
@@ -383,7 +383,7 @@ TEST_F("testSessionManager", DoomFixture()) {
.setResult(Int64ResultNode(0))));
auto r1 = std::make_shared<Grouping>(request1);
- GroupingContext initContext(world.bv, f1.clock.clock(), f1.timeOfDoom);
+ GroupingContext initContext(world.bv, f1.clock.nowRef(), f1.timeOfDoom);
initContext.addGrouping(r1);
SessionManager mgr(2);
@@ -440,7 +440,7 @@ TEST_F("test grouping fork/join", DoomFixture()) {
.setLastLevel(1);
auto g1 = std::make_shared<Grouping>(request);
- GroupingContext context(world.bv, f1.clock.clock(), f1.timeOfDoom);
+ GroupingContext context(world.bv, f1.clock.nowRef(), f1.timeOfDoom);
context.addGrouping(g1);
GroupingSession session(SessionId(), context, world.attributeContext);
session.prepareThreadContextCreation(4);
@@ -481,8 +481,8 @@ TEST_F("test session timeout", DoomFixture()) {
SessionId id1("foo");
SessionId id2("bar");
- GroupingContext initContext1(world.bv, f1.clock.clock(), steady_time(duration(10)));
- GroupingContext initContext2(world.bv, f1.clock.clock(), steady_time(duration(20)));
+ GroupingContext initContext1(world.bv, f1.clock.nowRef(), steady_time(duration(10)));
+ GroupingContext initContext2(world.bv, f1.clock.nowRef(), steady_time(duration(20)));
auto s1 = std::make_unique<GroupingSession>(id1, initContext1, world.attributeContext);
auto s2 = std::make_unique<GroupingSession>(id2, initContext2, world.attributeContext);
mgr.insert(std::move(s1));
diff --git a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
index 90c08d2eb19..2504bca17e4 100644
--- a/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/configurer/configurer_test.cpp
@@ -202,7 +202,7 @@ Fixture::Fixture()
std::filesystem::create_directory(std::filesystem::path(BASE_DIR));
initViewSet(_views);
_configurer = std::make_unique<Configurer>(_views._summaryMgr, _views.searchView, _views.feedView, _queryLimiter,
- _constantValueFactory, _clock.clock(), "test", 0);
+ _constantValueFactory, _clock.nowRef(), "test", 0);
}
Fixture::~Fixture() = default;
@@ -212,7 +212,7 @@ Fixture::initViewSet(ViewSet &views)
using IndexManager = proton::index::IndexManager;
using IndexConfig = proton::index::IndexConfig;
RankingAssetsRepo ranking_assets_repo_source(_constantValueFactory, {}, {}, {});
- auto matchers = std::make_shared<Matchers>(_clock.clock(), _queryLimiter, ranking_assets_repo_source);
+ auto matchers = std::make_shared<Matchers>(_clock.nowRef(), _queryLimiter, ranking_assets_repo_source);
auto indexMgr = make_shared<IndexManager>(BASE_DIR, IndexConfig(searchcorespi::index::WarmupConfig(), 2, 0), Schema(), 1,
views._reconfigurer, views._service.write(), _summaryExecutor,
TuneFileIndexManager(), TuneFileAttributes(), views._fileHeaderContext);
diff --git a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
index 596ebb933a4..da8e842b9e4 100644
--- a/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/document_subdbs/document_subdbs_test.cpp
@@ -256,7 +256,7 @@ MySearchableContext::MySearchableContext(IThreadingService &writeService,
IBucketDBHandlerInitializer & bucketDBHandlerInitializer)
: _fastUpdCtx(writeService, bucketDB, bucketDBHandlerInitializer),
_queryLimiter(), _clock(),
- _ctx(_fastUpdCtx._ctx, _queryLimiter, _clock.clock(), writeService.shared())
+ _ctx(_fastUpdCtx._ctx, _queryLimiter, _clock.nowRef(), writeService.shared())
{}
MySearchableContext::~MySearchableContext() = default;
diff --git a/searchcore/src/tests/proton/documentdb/executor_threading_service/executor_threading_service_test.cpp b/searchcore/src/tests/proton/documentdb/executor_threading_service/executor_threading_service_test.cpp
index 322f3c389ad..8a354ded706 100644
--- a/searchcore/src/tests/proton/documentdb/executor_threading_service/executor_threading_service_test.cpp
+++ b/searchcore/src/tests/proton/documentdb/executor_threading_service/executor_threading_service_test.cpp
@@ -28,7 +28,6 @@ public:
field_writer_executor(SequencedTaskExecutor::create(my_field_writer_executor, 3, 200)),
service(std::make_unique<ExecutorThreadingService>(_transport.shared(),
_transport.transport(),
- _transport.clock(),
*field_writer_executor,
nullptr,
ThreadingServiceConfig::make()))
diff --git a/searchcore/src/tests/proton/index/indexcollection_test.cpp b/searchcore/src/tests/proton/index/indexcollection_test.cpp
index 24460000596..0e699fd1443 100644
--- a/searchcore/src/tests/proton/index/indexcollection_test.cpp
+++ b/searchcore/src/tests/proton/index/indexcollection_test.cpp
@@ -47,7 +47,6 @@ public:
std::shared_ptr<IndexSearchable> _source2;
std::shared_ptr<IndexSearchable> _fusion_source;
vespalib::ThreadStackExecutor _executor;
- vespalib::TestClock _clock;
std::shared_ptr<IndexSearchable> _warmup;
void expect_searchable_can_be_appended(ISearchableIndexCollection & collection) {
@@ -84,7 +83,7 @@ public:
std::shared_ptr<WarmupIndexCollection>
create_warmup(const IndexCollection::SP& prev, const IndexCollection::SP& next) {
- return std::make_shared<WarmupIndexCollection>(WarmupConfig(1s, false), prev, next, *_warmup, _executor, _clock.clock(), *this);
+ return std::make_shared<WarmupIndexCollection>(WarmupConfig(1s, false), prev, next, *_warmup, _executor, *this);
}
void warmupDone(std::shared_ptr<WarmupIndexCollection> current) override {
diff --git a/searchcore/src/tests/proton/matching/matching_test.cpp b/searchcore/src/tests/proton/matching/matching_test.cpp
index 5f4f26c6c6b..02506afa709 100644
--- a/searchcore/src/tests/proton/matching/matching_test.cpp
+++ b/searchcore/src/tests/proton/matching/matching_test.cpp
@@ -356,7 +356,7 @@ struct MyWorld {
}
Matcher::SP createMatcher() {
- return std::make_shared<Matcher>(schema, config, clock.clock(), queryLimiter, constantValueRepo, 0);
+ return std::make_shared<Matcher>(schema, config, clock.nowRef(), queryLimiter, constantValueRepo, 0);
}
struct MySearchHandler : ISearchHandler {
diff --git a/searchcore/src/tests/proton/matching/request_context/request_context_test.cpp b/searchcore/src/tests/proton/matching/request_context/request_context_test.cpp
index 8b223c3ef3a..36636d58429 100644
--- a/searchcore/src/tests/proton/matching/request_context/request_context_test.cpp
+++ b/searchcore/src/tests/proton/matching/request_context/request_context_test.cpp
@@ -53,7 +53,7 @@ private:
public:
RequestContextTest()
: _clock(),
- _doom(_clock.clock(), vespalib::steady_time(), vespalib::steady_time(), false),
+ _doom(_clock.nowRef(), vespalib::steady_time(), vespalib::steady_time(), false),
_thread_bundle(1),
_attr_ctx(),
_index_env(),
diff --git a/searchcore/src/vespa/searchcore/grouping/groupingcontext.cpp b/searchcore/src/vespa/searchcore/grouping/groupingcontext.cpp
index 882a4d1509d..e21cb4c1282 100644
--- a/searchcore/src/vespa/searchcore/grouping/groupingcontext.cpp
+++ b/searchcore/src/vespa/searchcore/grouping/groupingcontext.cpp
@@ -51,10 +51,10 @@ GroupingContext::setDistributionKey(uint32_t distributionKey)
}
}
-GroupingContext::GroupingContext(const BitVector & validLids, const vespalib::Clock & clock, vespalib::steady_time timeOfDoom,
+GroupingContext::GroupingContext(const BitVector & validLids, const std::atomic<steady_time> & now_ref, vespalib::steady_time timeOfDoom,
const char *groupSpec, uint32_t groupSpecLen)
: _validLids(validLids),
- _clock(clock),
+ _now_ref(now_ref),
_timeOfDoom(timeOfDoom),
_os(),
_groupingList()
@@ -62,9 +62,9 @@ GroupingContext::GroupingContext(const BitVector & validLids, const vespalib::Cl
deserialize(groupSpec, groupSpecLen);
}
-GroupingContext::GroupingContext(const BitVector & validLids, const vespalib::Clock & clock, vespalib::steady_time timeOfDoom)
+GroupingContext::GroupingContext(const BitVector & validLids, const std::atomic<steady_time> & now_ref, vespalib::steady_time timeOfDoom)
: _validLids(validLids),
- _clock(clock),
+ _now_ref(now_ref),
_timeOfDoom(timeOfDoom),
_os(),
_groupingList()
@@ -72,7 +72,7 @@ GroupingContext::GroupingContext(const BitVector & validLids, const vespalib::Cl
GroupingContext::GroupingContext(const GroupingContext & rhs)
: _validLids(rhs._validLids),
- _clock(rhs._clock),
+ _now_ref(rhs._now_ref),
_timeOfDoom(rhs._timeOfDoom),
_os(),
_groupingList()
diff --git a/searchcore/src/vespa/searchcore/grouping/groupingcontext.h b/searchcore/src/vespa/searchcore/grouping/groupingcontext.h
index e1b296df99b..34e96847d63 100644
--- a/searchcore/src/vespa/searchcore/grouping/groupingcontext.h
+++ b/searchcore/src/vespa/searchcore/grouping/groupingcontext.h
@@ -3,8 +3,9 @@
#include <vespa/searchlib/aggregation/grouping.h>
#include <vespa/vespalib/objects/nbostream.h>
-#include <vespa/vespalib/util/clock.h>
+#include <vespa/vespalib/util/time.h>
#include <vector>
+#include <atomic>
namespace search::grouping {
@@ -19,6 +20,7 @@ public:
using UP = std::unique_ptr<GroupingContext>;
using Grouping = search::aggregation::Grouping;
using GroupingList = std::vector<std::shared_ptr<Grouping>>;
+ using steady_time = vespalib::steady_time;
/**
* Deserialize a grouping spec into this context.
@@ -33,7 +35,7 @@ public:
* @param groupSpec The grouping specification to use for initialization.
* @param groupSpecLen The length of the grouping specification, in bytes.
**/
- GroupingContext(const BitVector & validLids, const vespalib::Clock & clock, vespalib::steady_time timeOfDoom,
+ GroupingContext(const BitVector & validLids, const std::atomic<steady_time> & now_ref, steady_time timeOfDoom,
const char *groupSpec, uint32_t groupSpecLen);
/**
@@ -41,7 +43,7 @@ public:
* @param groupSpec The grouping specification to use for initialization.
* @param groupSpecLen The length of the grouping specification, in bytes.
**/
- GroupingContext(const BitVector & validLids, const vespalib::Clock & clock, vespalib::steady_time timeOfDoom);
+ GroupingContext(const BitVector & validLids, const std::atomic<steady_time> & now_ref, steady_time timeOfDoom);
/**
* Shallow copy of references
@@ -99,8 +101,8 @@ public:
/**
* Obtain the time of doom.
*/
- vespalib::steady_time getTimeOfDoom() const noexcept { return _timeOfDoom; }
- bool hasExpired() const noexcept { return _clock.getTimeNS() > _timeOfDoom; }
+ steady_time getTimeOfDoom() const noexcept { return _timeOfDoom; }
+ bool hasExpired() const noexcept { return _now_ref.load(std::memory_order_relaxed) > _timeOfDoom; }
/**
* Figure out if ranking is necessary for any of the grouping requests here.
* @return true if ranking is required.
@@ -116,11 +118,11 @@ private:
unsigned int aggregateRanked(Grouping & grouping, const RankedHit * rankedHit, unsigned int len) const;
void aggregate(Grouping & grouping, const BitVector * bv, unsigned int lidLimit) const;
void aggregate(Grouping & grouping, const BitVector * bv, unsigned int , unsigned int topN) const;
- const BitVector & _validLids;
- const vespalib::Clock & _clock;
- vespalib::steady_time _timeOfDoom;
- vespalib::nbostream _os;
- GroupingList _groupingList;
+ const BitVector & _validLids;
+ const std::atomic<steady_time> & _now_ref;
+ steady_time _timeOfDoom;
+ vespalib::nbostream _os;
+ GroupingList _groupingList;
};
}
diff --git a/searchcore/src/vespa/searchcore/proton/matching/fakesearchcontext.cpp b/searchcore/src/vespa/searchcore/proton/matching/fakesearchcontext.cpp
index e442bb5fdfa..8bf92ec1709 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/fakesearchcontext.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/fakesearchcontext.cpp
@@ -8,7 +8,7 @@ namespace proton::matching {
FakeSearchContext::FakeSearchContext(size_t initialNumDocs)
: _clock(std::make_unique<vespalib::TestClock>()),
- _doom(_clock->clock(), vespalib::steady_time()),
+ _doom(_clock->nowRef(), vespalib::steady_time()),
_selector(std::make_shared<search::FixedSourceSelector>(0, "fs", initialNumDocs)),
_indexes(std::make_shared<IndexCollection>(_selector)),
_attrSearchable(),
diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_tools.h b/searchcore/src/vespa/searchcore/proton/matching/match_tools.h
index ce1a9ff0b0a..5dcd874f82b 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/match_tools.h
+++ b/searchcore/src/vespa/searchcore/proton/matching/match_tools.h
@@ -16,7 +16,6 @@
#include <vespa/searchlib/common/stringmap.h>
#include <vespa/searchlib/queryeval/idiversifier.h>
#include <vespa/vespalib/util/doom.h>
-#include <vespa/vespalib/util/clock.h>
namespace vespalib { class ExecutionProfiler; }
namespace vespalib { struct ThreadBundle; }
diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
index 3e8909aa593..c4a0593a865 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
+++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.cpp
@@ -116,7 +116,7 @@ handleGroupingSession(SessionManager &sessionMgr, GroupingContext & groupingCont
} // namespace proton::matching::<unnamed>
-Matcher::Matcher(const search::index::Schema &schema, Properties props, const vespalib::Clock &clock,
+Matcher::Matcher(const search::index::Schema &schema, Properties props, const std::atomic<steady_time> & now_ref,
QueryLimiter &queryLimiter, const search::fef::IRankingAssetsRepo &rankingAssetsRepo, uint32_t distributionKey)
: _indexEnv(distributionKey, schema, std::move(props), rankingAssetsRepo),
_blueprintFactory(),
@@ -125,7 +125,7 @@ Matcher::Matcher(const search::index::Schema &schema, Properties props, const ve
_statsLock(),
_stats(softtimeout::Factor::lookup(_indexEnv.getProperties())),
_startTime(my_clock::now()),
- _clock(clock),
+ _now_ref(now_ref),
_queryLimiter(queryLimiter),
_distributionKey(distributionKey)
{
@@ -166,12 +166,12 @@ Matcher::create_match_tools_factory(const search::engine::Request &request, ISea
: _stats.softDoomFactor())
: 0.95;
vespalib::duration safeLeft = std::chrono::duration_cast<vespalib::duration>(request.getTimeLeft() * factor);
- vespalib::steady_time safeDoom(_clock.getTimeNS() + safeLeft);
+ vespalib::steady_time safeDoom(_now_ref.load(std::memory_order_relaxed) + safeLeft);
if (softTimeoutEnabled) {
LOG(debug, "Soft-timeout computed factor=%1.3f, used factor=%1.3f, userSupplied=%d, softTimeout=%" PRId64,
_stats.softDoomFactor(), factor, hasFactorOverride, vespalib::count_ns(safeLeft));
}
- vespalib::Doom doom(_clock, safeDoom, request.getTimeOfDoom(), hasFactorOverride);
+ vespalib::Doom doom(_now_ref, safeDoom, request.getTimeOfDoom(), hasFactorOverride);
return std::make_unique<MatchToolsFactory>(_queryLimiter, doom, searchContext, attrContext,
request.trace(), request.getStackRef(), request.location,
_viewResolver, metaStore, _indexEnv, *_rankSetup,
@@ -248,7 +248,7 @@ Matcher::match(const SearchRequest &request, vespalib::ThreadBundle &threadBundl
bool isDoomExplicit = false;
{ // we want to measure full set-up and tear-down time as part of
// collateral time
- GroupingContext groupingContext(metaStore.getValidLids(), _clock, request.getTimeOfDoom(),
+ GroupingContext groupingContext(metaStore.getValidLids(), _now_ref, request.getTimeOfDoom(),
request.groupSpec.data(), request.groupSpec.size());
SessionId sessionId(request.sessionId.data(), request.sessionId.size());
bool shouldCacheSearchSession = false;
diff --git a/searchcore/src/vespa/searchcore/proton/matching/matcher.h b/searchcore/src/vespa/searchcore/proton/matching/matcher.h
index ab9b8ed88f3..bf75dd9da89 100644
--- a/searchcore/src/vespa/searchcore/proton/matching/matcher.h
+++ b/searchcore/src/vespa/searchcore/proton/matching/matcher.h
@@ -16,7 +16,6 @@
#include <vespa/searchlib/fef/i_ranking_assets_repo.h>
#include <vespa/searchlib/queryeval/blueprint.h>
#include <vespa/searchlib/query/base.h>
-#include <vespa/vespalib/util/clock.h>
#include <vespa/vespalib/util/featureset.h>
#include <vespa/vespalib/util/thread_bundle.h>
#include <mutex>
@@ -59,16 +58,17 @@ private:
using my_clock = std::chrono::steady_clock;
using MatchingElements = search::MatchingElements;
using MatchingElementsFields = search::MatchingElementsFields;
- IndexEnvironment _indexEnv;
- search::fef::BlueprintFactory _blueprintFactory;
- std::shared_ptr<RankSetup> _rankSetup;
- ViewResolver _viewResolver;
- std::mutex _statsLock;
- MatchingStats _stats;
- my_clock::time_point _startTime;
- const vespalib::Clock &_clock;
- QueryLimiter &_queryLimiter;
- uint32_t _distributionKey;
+ using steady_time = vespalib::steady_time;
+ IndexEnvironment _indexEnv;
+ search::fef::BlueprintFactory _blueprintFactory;
+ std::shared_ptr<RankSetup> _rankSetup;
+ ViewResolver _viewResolver;
+ std::mutex _statsLock;
+ MatchingStats _stats;
+ my_clock::time_point _startTime;
+ const std::atomic<steady_time> &_now_ref;
+ QueryLimiter &_queryLimiter;
+ uint32_t _distributionKey;
size_t computeNumThreadsPerSearch(search::queryeval::Blueprint::HitEstimate hits,
const Properties & rankProperties) const;
@@ -91,7 +91,7 @@ public:
* @param clock used for timeout handling
**/
Matcher(const search::index::Schema &schema, Properties props,
- const vespalib::Clock &clock, QueryLimiter &queryLimiter,
+ const std::atomic<steady_time> & now_ref, QueryLimiter &queryLimiter,
const search::fef::IRankingAssetsRepo &rankingAssetsRepo, uint32_t distributionKey);
const search::fef::IIndexEnvironment &get_index_env() const { return _indexEnv; }
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
index eb7a664ae24..6682214927b 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp
@@ -37,6 +37,7 @@
#include <vespa/searchlib/engine/searchreply.h>
#include <vespa/vespalib/util/destructor_callbacks.h>
#include <vespa/vespalib/util/exceptions.h>
+#include <vespa/vespalib/util/clock.h>
#include <vespa/log/log.h>
#include <vespa/searchcorespi/index/warmupconfig.h>
@@ -188,7 +189,7 @@ DocumentDB::DocumentDB(const vespalib::string &baseDir,
_baseDir(baseDir + "/" + _docTypeName.toString()),
// Only one thread per executor, or performDropFeedView() will fail.
_writeServiceConfig(configSnapshot->get_threading_service_config()),
- _writeService(shared_service.shared(), shared_service.transport(), shared_service.clock(), shared_service.field_writer(),
+ _writeService(shared_service.shared(), shared_service.transport(), shared_service.field_writer(),
&shared_service.invokeService(), _writeServiceConfig),
_initializeThreads(std::move(initializeThreads)),
_initConfigSnapshot(),
@@ -218,7 +219,7 @@ DocumentDB::DocumentDB(const vespalib::string &baseDir,
_feedHandler(std::make_unique<FeedHandler>(_writeService, tlsSpec, docTypeName, *this, _writeFilter, *this, tlsWriterFactory)),
_subDBs(*this, *this, *_feedHandler, _docTypeName,
_writeService, shared_service.shared(), fileHeaderContext, std::move(attribute_interlock),
- metricsWireService, getMetrics(), queryLimiter, shared_service.clock(),
+ metricsWireService, getMetrics(), queryLimiter, shared_service.clock().nowRef(),
_configMutex, _baseDir, hwInfo),
_maintenanceController(shared_service.transport(), _writeService.master(), _refCount, _docTypeName),
_jobTrackers(),
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
index 5989e9c1433..4bf21b814fe 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.cpp
@@ -34,7 +34,7 @@ DocumentSubDBCollection::DocumentSubDBCollection(
MetricsWireService &metricsWireService,
DocumentDBTaggedMetrics &metrics,
matching::QueryLimiter &queryLimiter,
- const vespalib::Clock &clock,
+ const std::atomic<vespalib::steady_time> & now_ref,
std::mutex &configMutex,
const vespalib::string &baseDir,
const vespalib::HwInfo &hwInfo)
@@ -64,7 +64,7 @@ DocumentSubDBCollection::DocumentSubDBCollection(
metrics.ready.attributes,
metricsWireService,
attribute_interlock),
- queryLimiter, clock, warmupExecutor)));
+ queryLimiter, now_ref, warmupExecutor)));
_subDBs.push_back
(new StoreOnlyDocSubDB(StoreOnlyDocSubDB::Config(docTypeName, "1.removed", baseDir, _remSubDbId, SubDbType::REMOVED),
diff --git a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h
index 7c823d72bac..60a99a7d98a 100644
--- a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h
+++ b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h
@@ -91,7 +91,7 @@ public:
MetricsWireService &metricsWireService,
DocumentDBTaggedMetrics &metrics,
matching::QueryLimiter & queryLimiter,
- const vespalib::Clock &clock,
+ const std::atomic<vespalib::steady_time> & now_ref,
std::mutex &configMutex,
const vespalib::string &baseDir,
const vespalib::HwInfo &hwInfo);
diff --git a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp
index dd475484b6f..a169aed4af4 100644
--- a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.cpp
@@ -44,21 +44,18 @@ VESPA_THREAD_STACK_TAG(summary_executor)
ExecutorThreadingService::ExecutorThreadingService(vespalib::Executor& sharedExecutor,
FNET_Transport& transport,
- const vespalib::Clock& clock,
vespalib::ISequencedTaskExecutor& field_writer)
- : ExecutorThreadingService(sharedExecutor, transport, clock, field_writer, nullptr, ThreadingServiceConfig::make())
+ : ExecutorThreadingService(sharedExecutor, transport, field_writer, nullptr, ThreadingServiceConfig::make())
{}
ExecutorThreadingService::ExecutorThreadingService(vespalib::Executor & sharedExecutor,
FNET_Transport & transport,
- const vespalib::Clock & clock,
vespalib::ISequencedTaskExecutor& field_writer,
vespalib::InvokeService * invokerService,
const ThreadingServiceConfig & cfg)
: _sharedExecutor(sharedExecutor),
_transport(transport),
- _clock(clock),
_masterExecutor(1, CpuUsage::wrap(master_executor, CpuUsage::Category::WRITE)),
_master_task_limit(cfg.master_task_limit()),
_indexExecutor(createExecutorWithOneThread(cfg, CpuUsage::wrap(index_executor, CpuUsage::Category::WRITE))),
diff --git a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h
index f09083c9682..28ab4b8977a 100644
--- a/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h
+++ b/searchcore/src/vespa/searchcore/proton/server/executorthreadingservice.h
@@ -22,7 +22,6 @@ private:
using Registration = std::unique_ptr<vespalib::IDestructorCallback>;
vespalib::Executor & _sharedExecutor;
FNET_Transport & _transport;
- const vespalib::Clock & _clock;
vespalib::ThreadStackExecutor _masterExecutor;
std::atomic<uint32_t> _master_task_limit;
std::unique_ptr<vespalib::SyncableThreadExecutor> _indexExecutor;
@@ -39,12 +38,10 @@ public:
*/
ExecutorThreadingService(vespalib::Executor& sharedExecutor,
FNET_Transport& transport,
- const vespalib::Clock& clock,
vespalib::ISequencedTaskExecutor& field_writer);
ExecutorThreadingService(vespalib::Executor& sharedExecutor,
FNET_Transport & transport,
- const vespalib::Clock & clock,
vespalib::ISequencedTaskExecutor& field_writer,
vespalib::InvokeService * invokeService,
const ThreadingServiceConfig& cfg);
@@ -77,7 +74,6 @@ public:
vespalib::ISequencedTaskExecutor &field_writer() override;
FNET_Transport &transport() override { return _transport; }
- const vespalib::Clock &clock() const override { return _clock; }
ExecutorThreadingServiceStats getStats();
};
diff --git a/searchcore/src/vespa/searchcore/proton/server/matchers.cpp b/searchcore/src/vespa/searchcore/proton/server/matchers.cpp
index c2e471c088e..587fbad8d77 100644
--- a/searchcore/src/vespa/searchcore/proton/server/matchers.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/matchers.cpp
@@ -16,12 +16,12 @@ using matching::Matcher;
using matching::MatchingStats;
using namespace vespalib::make_string_short;
-Matchers::Matchers(const vespalib::Clock &clock,
+Matchers::Matchers(const std::atomic<vespalib::steady_time> & now_ref,
matching::QueryLimiter &queryLimiter,
const search::fef::RankingAssetsRepo &rankingAssetsRepo)
: _rpmap(),
_ranking_assets_repo(rankingAssetsRepo),
- _fallback(std::make_shared<Matcher>(search::index::Schema(), search::fef::Properties(), clock, queryLimiter,
+ _fallback(std::make_shared<Matcher>(search::index::Schema(), search::fef::Properties(), now_ref, queryLimiter,
_ranking_assets_repo, -1)),
_default()
{ }
diff --git a/searchcore/src/vespa/searchcore/proton/server/matchers.h b/searchcore/src/vespa/searchcore/proton/server/matchers.h
index 66d494556d9..08f3031ce7a 100644
--- a/searchcore/src/vespa/searchcore/proton/server/matchers.h
+++ b/searchcore/src/vespa/searchcore/proton/server/matchers.h
@@ -6,8 +6,6 @@
#include <vespa/searchlib/fef/ranking_assets_repo.h>
#include <vespa/vespalib/stllike/hash_map.h>
-namespace vespalib { class Clock; }
-
namespace proton {
namespace matching {
@@ -24,7 +22,7 @@ private:
std::shared_ptr<matching::Matcher> _default;
public:
using SP = std::shared_ptr<Matchers>;
- Matchers(const vespalib::Clock &clock,
+ Matchers(const std::atomic<vespalib::steady_time> & now_ref,
matching::QueryLimiter &queryLimiter,
const search::fef::RankingAssetsRepo &rankingAssetsRepo);
Matchers(const Matchers &) = delete;
diff --git a/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp b/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp
index 61f6db12a4b..0ffe69f2278 100644
--- a/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.cpp
@@ -95,7 +95,7 @@ SearchableDocSubDBConfigurer(const std::shared_ptr<ISummaryManager>& summaryMgr,
FeedViewHolder &feedView,
matching::QueryLimiter &queryLimiter,
const vespalib::eval::ConstantValueFactory& constant_value_factory,
- const vespalib::Clock &clock,
+ const std::atomic<steady_time> & now_ref,
const vespalib::string &subDbName,
uint32_t distributionKey) :
_summaryMgr(summaryMgr),
@@ -103,7 +103,7 @@ SearchableDocSubDBConfigurer(const std::shared_ptr<ISummaryManager>& summaryMgr,
_feedView(feedView),
_queryLimiter(queryLimiter),
_constant_value_factory(constant_value_factory),
- _clock(clock),
+ _now_ref(now_ref),
_subDbName(subDbName),
_distributionKey(distributionKey)
{ }
@@ -119,7 +119,7 @@ SearchableDocSubDBConfigurer::createMatchers(const DocumentDBConfig& new_config_
new_config_snapshot.getRankingConstantsSP(),
new_config_snapshot.getRankingExpressionsSP(),
new_config_snapshot.getOnnxModelsSP());
- auto newMatchers = std::make_shared<Matchers>(_clock, _queryLimiter, ranking_assets_repo_source);
+ auto newMatchers = std::make_shared<Matchers>(_now_ref, _queryLimiter, ranking_assets_repo_source);
auto& ranking_assets_repo = newMatchers->get_ranking_assets_repo();
for (const auto &profile : cfg.rankprofile) {
vespalib::string name = profile.name;
@@ -128,7 +128,7 @@ SearchableDocSubDBConfigurer::createMatchers(const DocumentDBConfig& new_config_
properties.add(property.name, property.value);
}
// schema instance only used during call.
- auto profptr = std::make_shared<Matcher>(*schema, std::move(properties), _clock, _queryLimiter,
+ auto profptr = std::make_shared<Matcher>(*schema, std::move(properties), _now_ref, _queryLimiter,
ranking_assets_repo, _distributionKey);
newMatchers->add(name, std::move(profptr));
}
diff --git a/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.h b/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.h
index 8dff36a304a..740f312bfb5 100644
--- a/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.h
+++ b/searchcore/src/vespa/searchcore/proton/server/searchable_doc_subdb_configurer.h
@@ -41,12 +41,13 @@ class SearchableDocSubDBConfigurer
private:
using SearchViewHolder = vespalib::VarHolder<std::shared_ptr<SearchView>>;
using FeedViewHolder = vespalib::VarHolder<std::shared_ptr<SearchableFeedView>>;
+ using steady_time = vespalib::steady_time;
const std::shared_ptr<ISummaryManager>& _summaryMgr;
SearchViewHolder &_searchView;
FeedViewHolder &_feedView;
matching::QueryLimiter &_queryLimiter;
const vespalib::eval::ConstantValueFactory& _constant_value_factory;
- const vespalib::Clock &_clock;
+ const std::atomic<steady_time> & _now_ref;
vespalib::string _subDbName;
uint32_t _distributionKey;
@@ -72,7 +73,7 @@ public:
FeedViewHolder &feedView,
matching::QueryLimiter &queryLimiter,
const vespalib::eval::ConstantValueFactory& constant_value_factory,
- const vespalib::Clock &clock,
+ const std::atomic<steady_time> & now_ref,
const vespalib::string &subDbName,
uint32_t distributionKey);
~SearchableDocSubDBConfigurer();
diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp
index ed9dfbfe578..5e9d9585ca9 100644
--- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.cpp
@@ -39,7 +39,7 @@ SearchableDocSubDB::SearchableDocSubDB(const Config &cfg, const Context &ctx)
_rFeedView(),
_tensorLoader(FastValueBuilderFactory::get()),
_constantValueCache(_tensorLoader),
- _configurer(_iSummaryMgr, _rSearchView, _rFeedView, ctx._queryLimiter, _constantValueCache, ctx._clock,
+ _configurer(_iSummaryMgr, _rSearchView, _rFeedView, ctx._queryLimiter, _constantValueCache, ctx._now_ref,
getSubDbName(), ctx._fastUpdCtx._storeOnlyCtx._owner.getDistributionKey()),
_warmupExecutor(ctx._warmupExecutor),
_realGidToLidChangeHandler(std::make_shared<GidToLidChangeHandler>()),
diff --git a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h
index c8dd064fcea..eb27406e228 100644
--- a/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h
+++ b/searchcore/src/vespa/searchcore/proton/server/searchabledocsubdb.h
@@ -41,18 +41,19 @@ SearchableDocSubDB : public FastAccessDocSubDB,
public:
struct Context {
+ using steady_time = vespalib::steady_time;
const FastAccessDocSubDB::Context _fastUpdCtx;
matching::QueryLimiter &_queryLimiter;
- const vespalib::Clock &_clock;
+ const std::atomic<steady_time> &_now_ref;
vespalib::Executor &_warmupExecutor;
Context(const FastAccessDocSubDB::Context &fastUpdCtx,
matching::QueryLimiter &queryLimiter,
- const vespalib::Clock &clock,
+ const std::atomic<steady_time> & now_ref,
vespalib:: Executor &warmupExecutor)
: _fastUpdCtx(fastUpdCtx),
_queryLimiter(queryLimiter),
- _clock(clock),
+ _now_ref(now_ref),
_warmupExecutor(warmupExecutor)
{ }
};
diff --git a/searchcore/src/vespa/searchcore/proton/test/threading_service_observer.h b/searchcore/src/vespa/searchcore/proton/test/threading_service_observer.h
index 8f31ea66d3a..f209b9a7709 100644
--- a/searchcore/src/vespa/searchcore/proton/test/threading_service_observer.h
+++ b/searchcore/src/vespa/searchcore/proton/test/threading_service_observer.h
@@ -48,7 +48,6 @@ public:
return _shared;
}
FNET_Transport & transport() override { return _service.transport(); }
- const vespalib::Clock & clock() const override { return _service.clock(); }
vespalib::ISequencedTaskExecutor &field_writer() override {
return _field_writer;
}
diff --git a/searchcore/src/vespa/searchcore/proton/test/transport_helper.cpp b/searchcore/src/vespa/searchcore/proton/test/transport_helper.cpp
index 3e5ce6e7a53..ffcc964bf56 100644
--- a/searchcore/src/vespa/searchcore/proton/test/transport_helper.cpp
+++ b/searchcore/src/vespa/searchcore/proton/test/transport_helper.cpp
@@ -4,15 +4,12 @@
#include <vespa/fnet/transport.h>
#include <vespa/searchcore/proton/server/executorthreadingservice.h>
#include <vespa/vespalib/util/sequencedtaskexecutor.h>
-#include <vespa/vespalib/util/size_literals.h>
-#include <vespa/vespalib/util/testclock.h>
#include <vespa/vespalib/util/threadstackexecutor.h>
namespace proton {
Transport::Transport()
- : _transport(std::make_unique<FNET_Transport>()),
- _clock(std::make_unique<vespalib::TestClock>())
+ : _transport(std::make_unique<FNET_Transport>())
{
_transport->Start();
}
@@ -21,10 +18,6 @@ Transport::~Transport() {
shutdown();
}
-const vespalib::Clock &
-Transport::clock() const {
- return _clock->clock();
-}
void
Transport::shutdown() {
_transport->ShutDown(true);
@@ -47,7 +40,7 @@ TransportAndExecutor::shutdown() {
TransportAndExecutorService::TransportAndExecutorService(size_t num_threads)
: TransportAndExecutor(num_threads),
- _writeService(std::make_unique<ExecutorThreadingService>(shared(), transport(), clock(), field_writer()))
+ _writeService(std::make_unique<ExecutorThreadingService>(shared(), transport(), field_writer()))
{}
TransportAndExecutorService::~TransportAndExecutorService() = default;
diff --git a/searchcore/src/vespa/searchcore/proton/test/transport_helper.h b/searchcore/src/vespa/searchcore/proton/test/transport_helper.h
index 66fbcdbabfb..6a5fd3aeb85 100644
--- a/searchcore/src/vespa/searchcore/proton/test/transport_helper.h
+++ b/searchcore/src/vespa/searchcore/proton/test/transport_helper.h
@@ -3,8 +3,6 @@
#include <vespa/searchcorespi/index/ithreadingservice.h>
-namespace vespalib { class TestClock; }
-
namespace proton {
class ExecutorThreadingService;
@@ -17,16 +15,14 @@ public:
Transport();
virtual ~Transport();
FNET_Transport & transport() { return *_transport; }
- const vespalib::Clock & clock() const;
virtual void shutdown();
private:
std::unique_ptr<FNET_Transport> _transport;
- std::unique_ptr<vespalib::TestClock> _clock;
};
class TransportAndExecutor : public Transport {
public:
- TransportAndExecutor(size_t num_threads);
+ explicit TransportAndExecutor(size_t num_threads);
~TransportAndExecutor() override;
vespalib::Executor & shared() { return *_sharedExecutor; }
vespalib::ISequencedTaskExecutor& field_writer() { return *_field_writer; }
@@ -39,7 +35,7 @@ private:
class TransportAndExecutorService : public TransportAndExecutor {
public:
- TransportAndExecutorService(size_t num_threads);
+ explicit TransportAndExecutorService(size_t num_threads);
~TransportAndExecutorService() override;
searchcorespi::index::IThreadingService & write();
void shutdown() override;
diff --git a/searchcore/src/vespa/searchcorespi/index/indexmaintainer.cpp b/searchcore/src/vespa/searchcorespi/index/indexmaintainer.cpp
index bbd17be9b5a..6028a543320 100644
--- a/searchcore/src/vespa/searchcorespi/index/indexmaintainer.cpp
+++ b/searchcore/src/vespa/searchcorespi/index/indexmaintainer.cpp
@@ -437,8 +437,7 @@ IndexMaintainer::swapInNewIndex(LockGuard & guard,
LOG(debug, "Warming up a disk index.");
indexes = std::make_shared<WarmupIndexCollection>
(_warmupConfig, getLeaf(guard, _source_list, true), indexes,
- static_cast<IDiskIndex &>(source), _ctx.getWarmupExecutor(),
- _ctx.getThreadingService().clock(), *this);
+ static_cast<IDiskIndex &>(source), _ctx.getWarmupExecutor(), *this);
} else {
LOG(debug, "No warmup needed as it is a memory index that is mapped in.");
}
diff --git a/searchcore/src/vespa/searchcorespi/index/ithreadingservice.h b/searchcore/src/vespa/searchcorespi/index/ithreadingservice.h
index 3f3a76b5506..52c586a6bb9 100644
--- a/searchcore/src/vespa/searchcorespi/index/ithreadingservice.h
+++ b/searchcore/src/vespa/searchcorespi/index/ithreadingservice.h
@@ -66,7 +66,6 @@ struct IThreadingService
virtual vespalib::ThreadExecutor &summary() = 0;
virtual vespalib::Executor &shared() = 0;
virtual FNET_Transport &transport() = 0;
- virtual const vespalib::Clock &clock() const = 0;
virtual vespalib::ISequencedTaskExecutor &field_writer() = 0;
};
diff --git a/searchcore/src/vespa/searchcorespi/index/warmupindexcollection.cpp b/searchcore/src/vespa/searchcorespi/index/warmupindexcollection.cpp
index 5d5348de52a..49dcb5a1f54 100644
--- a/searchcore/src/vespa/searchcorespi/index/warmupindexcollection.cpp
+++ b/searchcore/src/vespa/searchcorespi/index/warmupindexcollection.cpp
@@ -35,9 +35,9 @@ class WarmupRequestContext : public IRequestContext {
using IAttributeVector = search::attribute::IAttributeVector;
using AttributeBlueprintParams = search::attribute::AttributeBlueprintParams;
public:
- explicit WarmupRequestContext(const vespalib::Clock & clock);
+ explicit WarmupRequestContext();
~WarmupRequestContext() override;
- const vespalib::Doom & getDoom() const override { return _doom; }
+ const vespalib::Doom & getDoom() const override { return vespalib::Doom::never(); }
vespalib::ThreadBundle & thread_bundle() const override { return vespalib::ThreadBundle::trivial(); }
const IAttributeVector *getAttribute(const vespalib::string &) const override { return nullptr; }
const IAttributeVector *getAttributeStableEnum(const vespalib::string &) const override { return nullptr; }
@@ -45,7 +45,6 @@ public:
const AttributeBlueprintParams& get_attribute_blueprint_params() const override { return _params; }
const MetaStoreReadGuardSP * getMetaStoreReadGuard() const override { return nullptr; }
private:
- const vespalib::Doom _doom;
const AttributeBlueprintParams _params;
};
class WarmupTask : public vespalib::Executor::Task {
@@ -80,14 +79,12 @@ WarmupIndexCollection::WarmupIndexCollection(const WarmupConfig & warmupConfig,
ISearchableIndexCollection::SP next,
IndexSearchable & warmup,
vespalib::Executor & executor,
- const vespalib::Clock & clock,
IWarmupDone & warmupDone) :
_warmupConfig(warmupConfig),
_prev(std::move(prev)),
_next(std::move(next)),
_warmup(warmup),
_executor(executor),
- _clock(clock),
_warmupDone(warmupDone),
_warmupEndTime(vespalib::steady_clock::now() + warmupConfig.getDuration()),
_handledTerms(std::make_unique<FieldTermMap>()),
@@ -278,9 +275,7 @@ WarmupIndexCollection::drainPending() {
_pendingTasks.waitForZeroRefCount();
}
-WarmupRequestContext::WarmupRequestContext(const vespalib::Clock & clock)
- : _doom(clock, vespalib::steady_time::max(), vespalib::steady_time::max(), false)
-{}
+WarmupRequestContext::WarmupRequestContext() = default;
WarmupRequestContext::~WarmupRequestContext() = default;
const vespalib::eval::Value*
@@ -292,7 +287,7 @@ WarmupTask::WarmupTask(std::unique_ptr<MatchData> md, std::shared_ptr<WarmupInde
_retainGuard(_warmup->pendingTasks()),
_matchData(std::move(md)),
_bluePrint(),
- _requestContext(_warmup->clock())
+ _requestContext()
{
}
diff --git a/searchcore/src/vespa/searchcorespi/index/warmupindexcollection.h b/searchcore/src/vespa/searchcorespi/index/warmupindexcollection.h
index 27651b8999a..14358774347 100644
--- a/searchcore/src/vespa/searchcorespi/index/warmupindexcollection.h
+++ b/searchcore/src/vespa/searchcorespi/index/warmupindexcollection.h
@@ -17,7 +17,7 @@ class WarmupIndexCollection;
class IWarmupDone {
public:
- virtual ~IWarmupDone() { }
+ virtual ~IWarmupDone() = default;
virtual void warmupDone(std::shared_ptr<WarmupIndexCollection> current) = 0;
};
/**
@@ -35,7 +35,6 @@ public:
ISearchableIndexCollection::SP next,
IndexSearchable & warmup,
vespalib::Executor & executor,
- const vespalib::Clock & clock,
IWarmupDone & warmupDone);
~WarmupIndexCollection() override;
// Implements IIndexCollection
@@ -66,7 +65,6 @@ public:
vespalib::string toString() const override;
bool doUnpack() const { return _warmupConfig.getUnpack(); }
void drainPending();
- const vespalib::Clock & clock() const { return _clock; }
vespalib::steady_time warmupEndTime() const { return _warmupEndTime; }
vespalib::MonitoredRefCount & pendingTasks() { return _pendingTasks; }
private:
@@ -80,7 +78,6 @@ private:
ISearchableIndexCollection::SP _next;
IndexSearchable & _warmup;
vespalib::Executor & _executor;
- const vespalib::Clock & _clock;
IWarmupDone & _warmupDone;
vespalib::steady_time _warmupEndTime;
std::mutex _lock;