diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-04-04 16:35:02 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-04-04 16:36:18 +0200 |
commit | 9204052b04f33c47f62acb8d01161726268990d5 (patch) | |
tree | 49e0e9819bd9a73c316694d791b93700a694db92 /messagebus | |
parent | 31fa22ae90c6481c6e70eb2381d63ecc9b6c6d42 (diff) |
Use override
Diffstat (limited to 'messagebus')
18 files changed, 69 insertions, 100 deletions
diff --git a/messagebus/src/vespa/messagebus/network/oosclient.cpp b/messagebus/src/vespa/messagebus/network/oosclient.cpp index 28e46483c50..d0039d3d800 100644 --- a/messagebus/src/vespa/messagebus/network/oosclient.cpp +++ b/messagebus/src/vespa/messagebus/network/oosclient.cpp @@ -1,6 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "oosclient.h" +#include <vespa/fnet/frt/supervisor.h> namespace mbus { diff --git a/messagebus/src/vespa/messagebus/network/oosclient.h b/messagebus/src/vespa/messagebus/network/oosclient.h index 62f799740ec..7fc76930519 100644 --- a/messagebus/src/vespa/messagebus/network/oosclient.h +++ b/messagebus/src/vespa/messagebus/network/oosclient.h @@ -2,7 +2,8 @@ #pragma once -#include <vespa/fnet/frt/frt.h> +#include <vespa/fnet/frt/invoker.h> +#include <vespa/fnet/frt/target.h> #include <vespa/messagebus/common.h> #include <vector> #include <set> @@ -53,14 +54,14 @@ private: /** * From FNET_Task, performs overall server poll logic. **/ - void PerformTask(); + void PerformTask() override; /** * From FRT_IRequestWait, picks up server replies. * * @param req the request that has completed **/ - void RequestDone(FRT_RPCRequest *req); + void RequestDone(FRT_RPCRequest *req) override; public: /** diff --git a/messagebus/src/vespa/messagebus/network/oosmanager.h b/messagebus/src/vespa/messagebus/network/oosmanager.h index e2606a25caa..836b8bf7393 100644 --- a/messagebus/src/vespa/messagebus/network/oosmanager.h +++ b/messagebus/src/vespa/messagebus/network/oosmanager.h @@ -1,12 +1,11 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once +#include "oosclient.h" #include <vespa/fnet/task.h> -#include <set> #include <vespa/slobrok/imirrorapi.h> -#include <string> #include <vespa/vespalib/util/sync.h> -#include "oosclient.h" +#include <set> class FRT_Supervisor; @@ -54,7 +53,7 @@ private: * Method invoked when this object is run as a task. This method will update the oos information held by * this object. */ - void PerformTask(); + void PerformTask() override; public: /** diff --git a/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp b/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp index 21a63cc9060..4919e057df1 100644 --- a/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp +++ b/messagebus/src/vespa/messagebus/network/rpcnetwork.cpp @@ -1,10 +1,10 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "inetworkowner.h" #include "rpcnetwork.h" -#include <vespa/messagebus/emptyreply.h> #include <vespa/messagebus/errorcode.h> #include <vespa/messagebus/iprotocol.h> #include <vespa/messagebus/tracelevel.h> +#include <vespa/messagebus/emptyreply.h> #include <vespa/messagebus/routing/routingnode.h> #include <vespa/slobrok/sbregister.h> #include <vespa/slobrok/sbmirror.h> @@ -12,7 +12,6 @@ LOG_SETUP(".rpcnetwork"); - namespace { /** @@ -37,7 +36,7 @@ public: _gate.await(); } - void PerformTask() { + void PerformTask() override { _gate.countDown(); } }; diff --git a/messagebus/src/vespa/messagebus/network/rpcnetwork.h b/messagebus/src/vespa/messagebus/network/rpcnetwork.h index 674fb579b61..5edd660893f 100644 --- a/messagebus/src/vespa/messagebus/network/rpcnetwork.h +++ b/messagebus/src/vespa/messagebus/network/rpcnetwork.h @@ -1,18 +1,20 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/messagebus/blob.h> -#include <vespa/messagebus/blobref.h> -#include <vespa/messagebus/message.h> -#include <vespa/messagebus/reply.h> -#include <vespa/slobrok/imirrorapi.h> -#include <vespa/vespalib/component/versionspecification.h> #include "inetwork.h" #include "oosmanager.h" #include "rpcnetworkparams.h" #include "rpcsendv1.h" #include "rpcservicepool.h" #include "rpctargetpool.h" +#include <vespa/messagebus/blob.h> +#include <vespa/messagebus/blobref.h> +#include <vespa/messagebus/message.h> +#include <vespa/messagebus/reply.h> +#include <vespa/slobrok/imirrorapi.h> +#include <vespa/vespalib/component/versionspecification.h> +#include <vespa/fnet/transport.h> +#include <vespa/fnet/frt/supervisor.h> namespace slobrok { namespace api { @@ -39,14 +41,14 @@ private: vespalib::Version _version; SendContext(RPCNetwork &net, const Message &msg, const std::vector<RoutingNode*> &recipients); - void handleVersion(const vespalib::Version *version); + void handleVersion(const vespalib::Version *version) override; }; struct TargetPoolTask : public FNET_Task { RPCTargetPool &_pool; TargetPoolTask(FNET_Scheduler &scheduler, RPCTargetPool &pool); - void PerformTask(); + void PerformTask() override; }; typedef std::map<vespalib::VersionSpecification, RPCSendAdapter*> SendAdapterMap; @@ -210,46 +212,20 @@ public: void replyError(const SendContext &ctx, uint32_t errCode, const string &errMsg); - // Implements INetwork. - void attach(INetworkOwner &owner); - - // Implements INetwork. - const string getConnectionSpec() const; - - // Implements INetwork. - bool start(); - - // Implements INetwork. - bool waitUntilReady(double seconds) const; - - // Implements INetwork. - void registerSession(const string &session); - - // Implements INetwork. - void unregisterSession(const string &session); - - // Implements INetwork. - bool allocServiceAddress(RoutingNode &recipient); - - // Implements INetwork. - void freeServiceAddress(RoutingNode &recipient); - - // Implements INetwork. - void send(const Message &msg, const std::vector<RoutingNode*> &recipients); - - // Implements INetwork. - void sync(); - - // Implements INetwork. - void shutdown(); - - // Implements INetwork. - void postShutdownHook(); - - // Implements INetwork. - const slobrok::api::IMirrorAPI &getMirror() const; + void attach(INetworkOwner &owner) override; + const string getConnectionSpec() const override; + bool start() override; + bool waitUntilReady(double seconds) const override; + void registerSession(const string &session) override; + void unregisterSession(const string &session) override; + bool allocServiceAddress(RoutingNode &recipient) override; + void freeServiceAddress(RoutingNode &recipient) override; + void send(const Message &msg, const std::vector<RoutingNode*> &recipients) override; + void sync() override; + void shutdown() override; + void postShutdownHook() override; + const slobrok::api::IMirrorAPI &getMirror() const override; - // Implements FRT_Invokable. void invoke(FRT_RPCRequest *req); }; diff --git a/messagebus/src/vespa/messagebus/network/rpcsendadapter.h b/messagebus/src/vespa/messagebus/network/rpcsendadapter.h index 136f2a0f23c..2a00b9193fe 100644 --- a/messagebus/src/vespa/messagebus/network/rpcsendadapter.h +++ b/messagebus/src/vespa/messagebus/network/rpcsendadapter.h @@ -1,8 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <memory> -#include <vespa/vespalib/util/referencecounter.h> +#include <vespa/messagebus/blobref.h> +#include <vespa/vespalib/component/version.h> namespace mbus { diff --git a/messagebus/src/vespa/messagebus/network/rpcsendv1.cpp b/messagebus/src/vespa/messagebus/network/rpcsendv1.cpp index c62b1c3f0b8..795141f42d6 100644 --- a/messagebus/src/vespa/messagebus/network/rpcsendv1.cpp +++ b/messagebus/src/vespa/messagebus/network/rpcsendv1.cpp @@ -1,13 +1,12 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. + +#include "rpcnetwork.h" #include <vespa/messagebus/routing/routingnode.h> #include <vespa/messagebus/emptyreply.h> -#include <vespa/messagebus/error.h> #include <vespa/messagebus/errorcode.h> #include <vespa/messagebus/tracelevel.h> #include <vespa/vespalib/util/stringfmt.h> -#include "rpcnetwork.h" -#include "rpcsendv1.h" -#include "rpctarget.h" +#include <vespa/fnet/channel.h> namespace { diff --git a/messagebus/src/vespa/messagebus/network/rpcsendv1.h b/messagebus/src/vespa/messagebus/network/rpcsendv1.h index 8ea63f39403..4d85dd6aca9 100644 --- a/messagebus/src/vespa/messagebus/network/rpcsendv1.h +++ b/messagebus/src/vespa/messagebus/network/rpcsendv1.h @@ -1,10 +1,11 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/fnet/frt/frt.h> +#include "rpcsendadapter.h" #include <vespa/messagebus/idiscardhandler.h> #include <vespa/messagebus/ireplyhandler.h> -#include "rpcsendadapter.h" +#include <vespa/fnet/frt/invokable.h> + namespace mbus { diff --git a/messagebus/src/vespa/messagebus/network/rpctarget.cpp b/messagebus/src/vespa/messagebus/network/rpctarget.cpp index b50212cd1b4..c9caa9ebe4b 100644 --- a/messagebus/src/vespa/messagebus/network/rpctarget.cpp +++ b/messagebus/src/vespa/messagebus/network/rpctarget.cpp @@ -1,6 +1,7 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "rpctarget.h" #include <vespa/vespalib/util/exceptions.h> +#include <vespa/fnet/frt/supervisor.h> namespace mbus { diff --git a/messagebus/src/vespa/messagebus/network/rpctarget.h b/messagebus/src/vespa/messagebus/network/rpctarget.h index 89212c783b0..c7108f40a05 100644 --- a/messagebus/src/vespa/messagebus/network/rpctarget.h +++ b/messagebus/src/vespa/messagebus/network/rpctarget.h @@ -1,11 +1,11 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <vespa/fnet/frt/frt.h> -#include <vector> +#include <vespa/messagebus/common.h> +#include <vespa/fnet/frt/invoker.h> +#include <vespa/fnet/frt/target.h> #include <vespa/vespalib/component/version.h> #include <vespa/vespalib/util/sync.h> -#include <vespa/messagebus/common.h> namespace mbus { @@ -113,7 +113,7 @@ public: const vespalib::Version &getVersion() const { return *_version; } // Implements FRT_IRequestWait. - void RequestDone(FRT_RPCRequest *req); + void RequestDone(FRT_RPCRequest *req) override; }; } // namespace mbus diff --git a/messagebus/src/vespa/messagebus/routing/errordirective.h b/messagebus/src/vespa/messagebus/routing/errordirective.h index d55596e2871..5c125c65820 100644 --- a/messagebus/src/vespa/messagebus/routing/errordirective.h +++ b/messagebus/src/vespa/messagebus/routing/errordirective.h @@ -31,10 +31,10 @@ public: */ const string &getMessage() const { return _msg; } - virtual Type getType() const { return TYPE_ERROR; } - virtual bool matches(const IHopDirective &) const { return false; } - virtual string toString() const; - virtual string toDebugString() const; + Type getType() const override { return TYPE_ERROR; } + bool matches(const IHopDirective &) const override { return false; } + string toString() const override; + string toDebugString() const override; }; } // mbus diff --git a/messagebus/src/vespa/messagebus/routing/policydirective.h b/messagebus/src/vespa/messagebus/routing/policydirective.h index 3b25bd76197..30102ff276b 100644 --- a/messagebus/src/vespa/messagebus/routing/policydirective.h +++ b/messagebus/src/vespa/messagebus/routing/policydirective.h @@ -41,10 +41,10 @@ public: */ const string &getParam() const { return _param; } - virtual Type getType() const { return TYPE_POLICY; } - virtual bool matches(const IHopDirective &) const { return true; } - virtual string toString() const; - virtual string toDebugString() const; + Type getType() const override { return TYPE_POLICY; } + bool matches(const IHopDirective &) const override { return true; } + string toString() const override; + string toDebugString() const override; }; } // mbus diff --git a/messagebus/src/vespa/messagebus/routing/retrytransienterrorspolicy.h b/messagebus/src/vespa/messagebus/routing/retrytransienterrorspolicy.h index 98efe3de08c..b56844789ef 100644 --- a/messagebus/src/vespa/messagebus/routing/retrytransienterrorspolicy.h +++ b/messagebus/src/vespa/messagebus/routing/retrytransienterrorspolicy.h @@ -42,11 +42,8 @@ public: */ RetryTransientErrorsPolicy &setBaseDelay(double baseDelay); - // Implements IRetryPolicy. - bool canRetry(uint32_t errorCode) const; - - // Implements IRetryPolicy. - double getRetryDelay(uint32_t retry) const; + bool canRetry(uint32_t errorCode) const override; + double getRetryDelay(uint32_t retry) const override; }; } // namespace mbus diff --git a/messagebus/src/vespa/messagebus/routing/routedirective.h b/messagebus/src/vespa/messagebus/routing/routedirective.h index 3fe50e2efd9..d95c3d37aaf 100644 --- a/messagebus/src/vespa/messagebus/routing/routedirective.h +++ b/messagebus/src/vespa/messagebus/routing/routedirective.h @@ -32,10 +32,10 @@ public: */ const string &getName() const { return _name; } - virtual Type getType() const { return TYPE_ROUTE; } - virtual bool matches(const IHopDirective &dir) const; - virtual string toString() const; - virtual string toDebugString() const; + Type getType() const override { return TYPE_ROUTE; } + bool matches(const IHopDirective &dir) const override; + string toString() const override; + string toDebugString() const override; }; } // mbus diff --git a/messagebus/src/vespa/messagebus/routing/routeparser.cpp b/messagebus/src/vespa/messagebus/routing/routeparser.cpp index 86f5e3433f1..0329f7fd9d9 100644 --- a/messagebus/src/vespa/messagebus/routing/routeparser.cpp +++ b/messagebus/src/vespa/messagebus/routing/routeparser.cpp @@ -5,10 +5,7 @@ #include "routeparser.h" #include "tcpdirective.h" #include "verbatimdirective.h" -#include <vespa/messagebus/common.h> -#include <stdio.h> #include <vespa/vespalib/util/stringfmt.h> -#include <vespa/vespalib/util/vstringfmt.h> using vespalib::stringref; diff --git a/messagebus/src/vespa/messagebus/routing/routingnode.h b/messagebus/src/vespa/messagebus/routing/routingnode.h index aa854dce5ef..21a70270c9e 100644 --- a/messagebus/src/vespa/messagebus/routing/routingnode.h +++ b/messagebus/src/vespa/messagebus/routing/routingnode.h @@ -440,8 +440,7 @@ public: */ void setServiceAddress(IServiceAddress::UP serviceAddress) { _serviceAddress = std::move(serviceAddress); } - // Inherit doc from IReplyHandler. - virtual void handleReply(Reply::UP reply); + void handleReply(Reply::UP reply) override; }; } // namespace mbus diff --git a/messagebus/src/vespa/messagebus/routing/tcpdirective.h b/messagebus/src/vespa/messagebus/routing/tcpdirective.h index ab8c422c387..12cb90e07f8 100644 --- a/messagebus/src/vespa/messagebus/routing/tcpdirective.h +++ b/messagebus/src/vespa/messagebus/routing/tcpdirective.h @@ -1,7 +1,6 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once -#include <stdint.h> #include "ihopdirective.h" namespace mbus { @@ -50,10 +49,10 @@ public: */ const string &getSession() const { return _session; } - virtual Type getType() const { return TYPE_TCP; } - virtual bool matches(const IHopDirective &dir) const; - virtual string toString() const; - virtual string toDebugString() const; + Type getType() const override { return TYPE_TCP; } + bool matches(const IHopDirective &dir) const override; + string toString() const override; + string toDebugString() const override; }; } // mbus diff --git a/messagebus/src/vespa/messagebus/routing/verbatimdirective.h b/messagebus/src/vespa/messagebus/routing/verbatimdirective.h index 41ebae497f9..df7e7fff6c0 100644 --- a/messagebus/src/vespa/messagebus/routing/verbatimdirective.h +++ b/messagebus/src/vespa/messagebus/routing/verbatimdirective.h @@ -31,10 +31,10 @@ public: */ const string &getImage() const { return _image; } - virtual Type getType() const { return TYPE_VERBATIM; } - virtual bool matches(const IHopDirective &dir) const; - virtual string toString() const; - virtual string toDebugString() const; + Type getType() const override { return TYPE_VERBATIM; } + bool matches(const IHopDirective &dir) const override; + string toString() const override; + string toDebugString() const override; }; } // mbus |