diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-06-01 15:32:15 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-06-01 18:03:25 +0200 |
commit | 61a4ea34c2ddd3b618249b6f6eb402069e40bccb (patch) | |
tree | 6d6e8d55bfd574a0d2d039a07099774d2545f32e /storage | |
parent | 54581b5ecd98230dc90fe787f1f02a33ebffbff6 (diff) |
Removed frt.h from header files to reduce include volume.
Diffstat (limited to 'storage')
4 files changed, 22 insertions, 20 deletions
diff --git a/storage/src/vespa/storage/storageserver/fnetlistener.cpp b/storage/src/vespa/storage/storageserver/fnetlistener.cpp index 2c557ba8614..5bbeba4aa16 100644 --- a/storage/src/vespa/storage/storageserver/fnetlistener.cpp +++ b/storage/src/vespa/storage/storageserver/fnetlistener.cpp @@ -14,17 +14,17 @@ namespace storage { FNetListener::FNetListener(CommunicationManager& comManager, const config::ConfigUri & configUri, uint32_t port) : _comManager(comManager), - _orb(), + _orb(std::make_unique<FRT_Supervisor>()), _closed(false), - _slobrokRegister(_orb, configUri) + _slobrokRegister(*_orb, configUri) { initRPC(); - if (!_orb.Listen(port)) { + if (!_orb->Listen(port)) { std::ostringstream ost; ost << "Failed to listen to RPC port " << port << "."; throw vespalib::IllegalStateException(ost.str(), VESPA_STRLOC); } - _orb.Start(); + _orb->Start(); } FNetListener::~FNetListener() @@ -49,13 +49,13 @@ FNetListener::close() { _closed = true; _slobrokRegister.unregisterName(_handle); - _orb.ShutDown(true); + _orb->ShutDown(true); } void FNetListener::initRPC() { - FRT_ReflectionBuilder rb(&_orb); + FRT_ReflectionBuilder rb(_orb.get()); rb.DefineMethod( "getnodestate3", "sii", "ss", true, diff --git a/storage/src/vespa/storage/storageserver/fnetlistener.h b/storage/src/vespa/storage/storageserver/fnetlistener.h index 40cd53eaa63..781f818b673 100644 --- a/storage/src/vespa/storage/storageserver/fnetlistener.h +++ b/storage/src/vespa/storage/storageserver/fnetlistener.h @@ -1,11 +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 <vespa/fnet/frt/frt.h> -#include <vespa/slobrok/sbmirror.h> #include <vespa/slobrok/sbregister.h> - namespace storage { class CommunicationManager; @@ -26,17 +23,15 @@ public: void registerHandle(const vespalib::stringref & handle); void close(); - // Used by unit tests. bool serviceExists(const vespalib::stringref & connectionSpec); private: - CommunicationManager& _comManager; - FRT_Supervisor _orb; - bool _closed; + CommunicationManager& _comManager; + std::unique_ptr<FRT_Supervisor> _orb; + bool _closed; slobrok::api::RegisterAPI _slobrokRegister; - vespalib::string _handle; + vespalib::string _handle; }; } - diff --git a/storage/src/vespa/storage/storageserver/rpcrequestwrapper.cpp b/storage/src/vespa/storage/storageserver/rpcrequestwrapper.cpp index 797ff9260a3..cd60b2739bf 100644 --- a/storage/src/vespa/storage/storageserver/rpcrequestwrapper.cpp +++ b/storage/src/vespa/storage/storageserver/rpcrequestwrapper.cpp @@ -1,6 +1,8 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "rpcrequestwrapper.h" +#include <vespa/fnet/frt/rpcrequest.h> +#include <cassert> namespace storage { @@ -12,8 +14,7 @@ RPCRequestWrapper::RPCRequestWrapper(FRT_RPCRequest *req) RPCRequestWrapper::~RPCRequestWrapper() { if (_req != 0) { - _req->SetError(ERR_REQUEST_DELETED, - "Request deleted without having been replied to"); + _req->SetError(ERR_REQUEST_DELETED, "Request deleted without having been replied to"); _req->Return(); } } @@ -80,6 +81,11 @@ RPCRequestWrapper::returnRequest() } +const char * +RPCRequestWrapper::getMethodName() const { + return _req->GetMethodName(); +} + void RPCRequestWrapper::discardBlobs() { diff --git a/storage/src/vespa/storage/storageserver/rpcrequestwrapper.h b/storage/src/vespa/storage/storageserver/rpcrequestwrapper.h index a1e067ca974..fdb685cab27 100644 --- a/storage/src/vespa/storage/storageserver/rpcrequestwrapper.h +++ b/storage/src/vespa/storage/storageserver/rpcrequestwrapper.h @@ -1,7 +1,9 @@ // 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 <cstdint> + +class FRT_RPCRequest; namespace storage { @@ -47,7 +49,7 @@ public: **/ void returnError(uint32_t errorCode, const char *errorMessage); - const char *getMethodName() { return _req->GetMethodName(); } + const char *getMethodName() const; void addReturnString(const char *str, uint32_t len=0); void addReturnInt(uint32_t value); void returnRequest(); @@ -67,4 +69,3 @@ private: }; } // namespace storage - |