diff options
Diffstat (limited to 'slobrok')
3 files changed, 26 insertions, 22 deletions
diff --git a/slobrok/src/vespa/slobrok/server/local_rpc_monitor_map.cpp b/slobrok/src/vespa/slobrok/server/local_rpc_monitor_map.cpp index 025103e4e3d..d481d7d2ce9 100644 --- a/slobrok/src/vespa/slobrok/server/local_rpc_monitor_map.cpp +++ b/slobrok/src/vespa/slobrok/server/local_rpc_monitor_map.cpp @@ -8,8 +8,6 @@ LOG_SETUP(".slobrok.server.local_rpc_monitor_map"); namespace slobrok { -#pragma GCC diagnostic ignored "-Winline" - namespace { struct ChainedCompletionHandler : CompletionHandler { @@ -25,9 +23,11 @@ struct ChainedCompletionHandler : CompletionHandler { first->doneHandler(result); second->doneHandler(result); } - ~ChainedCompletionHandler() override {} + ~ChainedCompletionHandler() override; }; +ChainedCompletionHandler::~ChainedCompletionHandler() = default; + } void LocalRpcMonitorMap::DelayedTasks::PerformTask() { @@ -45,6 +45,12 @@ void LocalRpcMonitorMap::DelayedTasks::PerformTask() { } } +LocalRpcMonitorMap::PerService::~PerService() = default; +LocalRpcMonitorMap::PerService::PerService(PerService &&) noexcept = default; +LocalRpcMonitorMap::PerService & LocalRpcMonitorMap::PerService::operator =(PerService &&) noexcept = default; + +LocalRpcMonitorMap::RemovedData::~RemovedData() = default; + LocalRpcMonitorMap::LocalRpcMonitorMap(FNET_Scheduler *scheduler, MappingMonitorFactory mappingMonitorFactory) : _delayedTasks(scheduler, *this), @@ -178,7 +184,6 @@ void LocalRpcMonitorMap::removeLocal(const ServiceMapping &mapping) { _dispatcher.remove(mapping); } _mappingMonitor->start(mapping, false); - return; } void LocalRpcMonitorMap::add(const ServiceMapping &mapping) { diff --git a/slobrok/src/vespa/slobrok/server/local_rpc_monitor_map.h b/slobrok/src/vespa/slobrok/server/local_rpc_monitor_map.h index c57dec240b8..7469f14063c 100644 --- a/slobrok/src/vespa/slobrok/server/local_rpc_monitor_map.h +++ b/slobrok/src/vespa/slobrok/server/local_rpc_monitor_map.h @@ -59,7 +59,7 @@ private: _target(target) {} - ~DelayedTasks() { Kill(); } + ~DelayedTasks() override { Kill(); } }; DelayedTasks _delayedTasks; @@ -69,26 +69,24 @@ private: bool localOnly; std::unique_ptr<CompletionHandler> inflight; vespalib::string spec; + PerService(bool up_in, bool local_only, std::unique_ptr<CompletionHandler> inflight_in, vespalib::stringref spec_in) + : up(up_in), localOnly(local_only), inflight(std::move(inflight_in)), spec(spec_in) + {} + PerService(const PerService &) = delete; + PerService & operator=(const PerService &) = delete; + PerService(PerService &&) noexcept; + PerService & operator =(PerService &&) noexcept; + ~PerService(); }; - PerService localService(const ServiceMapping &mapping, + static PerService localService(const ServiceMapping &mapping, std::unique_ptr<CompletionHandler> inflight) { - return PerService{ - .up = false, - .localOnly = true, - .inflight = std::move(inflight), - .spec = mapping.spec - }; + return {false, true, std::move(inflight), mapping.spec}; } - PerService globalService(const ServiceMapping &mapping) { - return PerService{ - .up = false, - .localOnly = false, - .inflight = {}, - .spec = mapping.spec - }; + static PerService globalService(const ServiceMapping &mapping) { + return {false, false, {}, mapping.spec}; } using Map = std::map<vespalib::string, PerService>; @@ -111,6 +109,7 @@ private: bool up; bool localOnly; std::unique_ptr<CompletionHandler> inflight; + ~RemovedData(); }; RemovedData removeFromMap(Map::iterator iter); @@ -118,12 +117,12 @@ private: public: LocalRpcMonitorMap(FNET_Scheduler *scheduler, MappingMonitorFactory mappingMonitorFactory); - ~LocalRpcMonitorMap(); + ~LocalRpcMonitorMap() override; MapSource &dispatcher() { return _dispatcher; } ServiceMapHistory & history(); - bool wouldConflict(const ServiceMapping &mapping) const; + [[nodiscard]] bool wouldConflict(const ServiceMapping &mapping) const; /** for use by register API, will call doneHandler() on inflight script */ void addLocal(const ServiceMapping &mapping, diff --git a/slobrok/src/vespa/slobrok/server/service_mapping.h b/slobrok/src/vespa/slobrok/server/service_mapping.h index bd92a075303..61729a37d8f 100644 --- a/slobrok/src/vespa/slobrok/server/service_mapping.h +++ b/slobrok/src/vespa/slobrok/server/service_mapping.h @@ -15,7 +15,7 @@ struct ServiceMapping { ~ServiceMapping(); ServiceMapping& operator=(const ServiceMapping& rhs); - bool operator== (const ServiceMapping &other) const { + bool operator== (const ServiceMapping &other) const noexcept { return name == other.name && spec == other.spec; } |