summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-05-10 17:59:26 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-05-10 17:59:26 +0000
commita9833b736d9c76732be933274e212290be840281 (patch)
tree621c9d4c129210d70868171839b6b3cebd12937c /config
parentd61f0623f6ad1b79b626342c2df3403fe7a9b5eb (diff)
Simplify by not caching a member
Diffstat (limited to 'config')
-rw-r--r--config/src/apps/vespa-get-config/getconfig.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/config/src/apps/vespa-get-config/getconfig.cpp b/config/src/apps/vespa-get-config/getconfig.cpp
index f23f28b2734..dc12d2bbf0e 100644
--- a/config/src/apps/vespa-get-config/getconfig.cpp
+++ b/config/src/apps/vespa-get-config/getconfig.cpp
@@ -21,14 +21,13 @@ class GetConfig : public FastOS_Application
{
private:
std::unique_ptr<fnet::frt::StandaloneFRT> _server;
- FRT_Supervisor *_supervisor;
FRT_Target *_target;
GetConfig(const GetConfig &);
GetConfig &operator=(const GetConfig &);
public:
- GetConfig() : _server(), _supervisor(nullptr), _target(nullptr) {}
+ GetConfig() : _server(), _target(nullptr) {}
virtual ~GetConfig();
int usage();
void initRPC(const char *spec);
@@ -39,7 +38,7 @@ public:
GetConfig::~GetConfig()
{
- LOG_ASSERT(_supervisor == nullptr);
+ LOG_ASSERT( ! _server);
LOG_ASSERT(_target == nullptr);
}
@@ -73,8 +72,7 @@ void
GetConfig::initRPC(const char *spec)
{
_server = std::make_unique<fnet::frt::StandaloneFRT>();
- _supervisor = &_server->supervisor();
- _target = _supervisor->GetTarget(spec);
+ _target = _server->supervisor().GetTarget(spec);
}
@@ -85,10 +83,7 @@ GetConfig::finiRPC()
_target->SubRef();
_target = nullptr;
}
- if (_server) {
- _server.reset();
- _supervisor = nullptr;
- }
+ _server.reset();
}
@@ -223,7 +218,7 @@ GetConfig::Main()
int protocolVersion = config::protocol::readProtocolVersion();
FRTConfigRequestFactory requestFactory(protocolVersion, traceLevel, vespaVersion, config::protocol::readProtocolCompressionType());
- FRTConnection connection(spec, *_supervisor, TimingValues());
+ FRTConnection connection(spec, _server->supervisor(), TimingValues());
ConfigKey key(configId, defName, defNamespace, defMD5, defSchema);
ConfigState state(configMD5, generation, false);
FRTConfigRequest::UP request = requestFactory.createConfigRequest(key, &connection, state, serverTimeout * 1000);