diff options
Diffstat (limited to 'searchcore')
11 files changed, 16 insertions, 19 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_thread.h b/searchcore/src/vespa/searchcore/proton/matching/match_thread.h index 7467e6c50a6..c6b233f2fcd 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_thread.h +++ b/searchcore/src/vespa/searchcore/proton/matching/match_thread.h @@ -88,7 +88,7 @@ private: LazyValue _score_feature; double _rankDropLimit; HitCollector &_hits; - const Doom &_doom; + const Doom _doom; public: std::vector<uint32_t> dropped; }; diff --git a/searchcore/src/vespa/searchcore/proton/matching/match_tools.h b/searchcore/src/vespa/searchcore/proton/matching/match_tools.h index 5dcd874f82b..759fe68eea2 100644 --- a/searchcore/src/vespa/searchcore/proton/matching/match_tools.h +++ b/searchcore/src/vespa/searchcore/proton/matching/match_tools.h @@ -41,7 +41,7 @@ private: using RankSetup = search::fef::RankSetup; using ExecutionProfiler = vespalib::ExecutionProfiler; QueryLimiter &_queryLimiter; - const vespalib::Doom &_doom; + const vespalib::Doom _doom; const Query &_query; MaybeMatchPhaseLimiter &_match_limiter; const QueryEnvironment &_queryEnv; diff --git a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp index 6682214927b..d47bed8936f 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/documentdb.cpp @@ -37,7 +37,6 @@ #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> @@ -219,7 +218,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().nowRef(), + metricsWireService, getMetrics(), queryLimiter, shared_service.nowRef(), _configMutex, _baseDir, hwInfo), _maintenanceController(shared_service.transport(), _writeService.master(), _refCount, _docTypeName), _jobTrackers(), diff --git a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h index 60a99a7d98a..5f32b9184a7 100644 --- a/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h +++ b/searchcore/src/vespa/searchcore/proton/server/documentsubdbcollection.h @@ -12,7 +12,6 @@ #include <optional> namespace vespalib { - class Clock; class Executor; class HwInfo; class ThreadStackExecutorBase; diff --git a/searchcore/src/vespa/searchcore/proton/server/i_shared_threading_service.h b/searchcore/src/vespa/searchcore/proton/server/i_shared_threading_service.h index c09e7d51afc..d2d557878d6 100644 --- a/searchcore/src/vespa/searchcore/proton/server/i_shared_threading_service.h +++ b/searchcore/src/vespa/searchcore/proton/server/i_shared_threading_service.h @@ -1,6 +1,9 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once +#include <atomic> +#include <vespa/vespalib/util/time.h> + class FNET_Transport; namespace storage::spi { struct BucketExecutor; } @@ -9,7 +12,6 @@ namespace vespalib { class ISequencedTaskExecutor; class ThreadExecutor; class InvokeService; -class Clock; } namespace proton { @@ -56,7 +58,7 @@ public: /** * Return a very cheap clock. */ - virtual const vespalib::Clock & clock() const = 0; + virtual const std::atomic<vespalib::steady_time> & nowRef() const = 0; }; } 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 740f312bfb5..b5c87b8dc9b 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 @@ -17,7 +17,6 @@ namespace searchcorespi { class IndexSearchable; } namespace proton::matching { class QueryLimiter; } namespace vespalib::eval { struct ConstantValueFactory; } -namespace vespalib { class Clock; } namespace proton { diff --git a/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.cpp b/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.cpp index 45b5ec2ef48..de55213f7ea 100644 --- a/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.cpp @@ -26,8 +26,7 @@ SharedThreadingService::SharedThreadingService(const SharedThreadingServiceConfi _invokeService(std::make_unique<vespalib::InvokeServiceImpl>(std::max(vespalib::adjustTimeoutByDetectedHz(1ms), cfg.field_writer_config().reactionTime()))), _invokeRegistrations(), - _bucket_executor(bucket_executor), - _clock(dynamic_cast<const vespalib::InvokeServiceImpl &>(*_invokeService).nowRef()) + _bucket_executor(bucket_executor) { const auto& fw_cfg = cfg.field_writer_config(); _field_writer = vespalib::SequencedTaskExecutor::create(vespalib::be_nice(CpuUsage::wrap(proton_field_writer_executor, CpuUsage::Category::WRITE), cfg.feeding_niceness()), @@ -53,4 +52,9 @@ SharedThreadingService::sync_all_executors() { } } +const std::atomic<vespalib::steady_time> & +SharedThreadingService::nowRef() const { + return dynamic_cast<const vespalib::InvokeServiceImpl &>(*_invokeService).nowRef(); +} + } diff --git a/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.h b/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.h index c2fffcc4a6c..a436c3a8006 100644 --- a/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.h +++ b/searchcore/src/vespa/searchcore/proton/server/shared_threading_service.h @@ -5,7 +5,6 @@ #include "shared_threading_service_config.h" #include <vespa/vespalib/util/threadexecutor.h> #include <vespa/vespalib/util/syncable.h> -#include <vespa/vespalib/util/clock.h> #include <memory> namespace vespalib { @@ -25,7 +24,6 @@ private: std::unique_ptr<vespalib::InvokeService> _invokeService; std::vector<Registration> _invokeRegistrations; storage::spi::BucketExecutor& _bucket_executor; - vespalib::Clock _clock; public: SharedThreadingService(const SharedThreadingServiceConfig& cfg, FNET_Transport& transport, @@ -40,7 +38,7 @@ public: vespalib::InvokeService & invokeService() override { return *_invokeService; } FNET_Transport & transport() override { return _transport; } storage::spi::BucketExecutor& bucket_executor() override { return _bucket_executor; } - const vespalib::Clock & clock() const override { return _clock; } + const std::atomic<vespalib::steady_time> & nowRef() const override; }; } diff --git a/searchcore/src/vespa/searchcore/proton/test/mock_shared_threading_service.cpp b/searchcore/src/vespa/searchcore/proton/test/mock_shared_threading_service.cpp index 95e87247366..f635a406d6c 100644 --- a/searchcore/src/vespa/searchcore/proton/test/mock_shared_threading_service.cpp +++ b/searchcore/src/vespa/searchcore/proton/test/mock_shared_threading_service.cpp @@ -12,8 +12,7 @@ MockSharedThreadingService::MockSharedThreadingService(ThreadExecutor& shared_in _field_writer(vespalib::SequencedTaskExecutor::create(mock_field_writer_executor, 1)), _invokeService(10ms), _transport(), - _bucket_executor(num_bucket_executors), - _clock(_invokeService.nowRef()) + _bucket_executor(num_bucket_executors) { } diff --git a/searchcore/src/vespa/searchcore/proton/test/mock_shared_threading_service.h b/searchcore/src/vespa/searchcore/proton/test/mock_shared_threading_service.h index b48d2e0df79..622b2b5fed3 100644 --- a/searchcore/src/vespa/searchcore/proton/test/mock_shared_threading_service.h +++ b/searchcore/src/vespa/searchcore/proton/test/mock_shared_threading_service.h @@ -4,7 +4,6 @@ #include "transport_helper.h" #include <vespa/persistence/dummyimpl/dummy_bucket_executor.h> #include <vespa/searchcore/proton/server/i_shared_threading_service.h> -#include <vespa/vespalib/util/clock.h> #include <vespa/vespalib/util/invokeserviceimpl.h> namespace proton { @@ -17,7 +16,6 @@ private: vespalib::InvokeServiceImpl _invokeService; Transport _transport; storage::spi::dummy::DummyBucketExecutor _bucket_executor; - vespalib::Clock _clock; public: MockSharedThreadingService(ThreadExecutor& shared_in, size_t num_bucket_executors = 2); ~MockSharedThreadingService() override; @@ -26,7 +24,7 @@ public: vespalib::InvokeService & invokeService() override { return _invokeService; } FNET_Transport & transport() override { return _transport.transport(); } storage::spi::BucketExecutor& bucket_executor() override { return _bucket_executor; } - const vespalib::Clock & clock() const override { return _clock; } + const std::atomic<vespalib::steady_time> & nowRef() const override { return _invokeService.nowRef(); } }; } diff --git a/searchcore/src/vespa/searchcorespi/index/ithreadingservice.h b/searchcore/src/vespa/searchcorespi/index/ithreadingservice.h index 52c586a6bb9..444a5cde1a0 100644 --- a/searchcore/src/vespa/searchcorespi/index/ithreadingservice.h +++ b/searchcore/src/vespa/searchcorespi/index/ithreadingservice.h @@ -7,7 +7,6 @@ class FNET_Transport; namespace vespalib { class ISequencedTaskExecutor; - class Clock; } namespace searchcorespi::index { |