summaryrefslogtreecommitdiffstats
path: root/storageserver
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-02-20 23:26:55 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-02-20 23:34:51 +0000
commitacbdc8385fef981a9bc5cbfb46483c54c953dc04 (patch)
tree1d9c02e4e9476510dd32131cad01940969493806 /storageserver
parent1cfea65b9bc71b472e9dc3370b120cf428b6ece0 (diff)
Make ConfigUri constructors explicit and use same context where possible in proton.
Diffstat (limited to 'storageserver')
-rw-r--r--storageserver/src/apps/storaged/storage.cpp4
-rw-r--r--storageserver/src/tests/storageservertest.cpp4
-rw-r--r--storageserver/src/vespa/storageserver/app/distributorprocess.cpp2
-rw-r--r--storageserver/src/vespa/storageserver/app/distributorprocess.h2
-rw-r--r--storageserver/src/vespa/storageserver/app/process.cpp2
-rw-r--r--storageserver/src/vespa/storageserver/app/process.h3
6 files changed, 8 insertions, 9 deletions
diff --git a/storageserver/src/apps/storaged/storage.cpp b/storageserver/src/apps/storaged/storage.cpp
index 2c79ebf700b..aaa85f7f476 100644
--- a/storageserver/src/apps/storaged/storage.cpp
+++ b/storageserver/src/apps/storaged/storage.cpp
@@ -37,11 +37,11 @@ Process::UP createProcess(vespalib::stringref configId) {
config::ConfigUri uri(configId);
std::unique_ptr<vespa::config::content::core::StorServerConfig> serverConfig = config::ConfigGetter<vespa::config::content::core::StorServerConfig>::getConfig(uri.getConfigId(), uri.getContext());
if (serverConfig->isDistributor) {
- return std::make_unique<DistributorProcess>(configId);
+ return std::make_unique<DistributorProcess>(uri);
} else switch (serverConfig->persistenceProvider.type) {
case vespa::config::content::core::StorServerConfig::PersistenceProvider::Type::STORAGE:
case vespa::config::content::core::StorServerConfig::PersistenceProvider::Type::DUMMY:
- return std::make_unique<DummyServiceLayerProcess>(configId);
+ return std::make_unique<DummyServiceLayerProcess>(uri);
default:
throw vespalib::IllegalStateException("Unknown persistence provider.", VESPA_STRLOC);
}
diff --git a/storageserver/src/tests/storageservertest.cpp b/storageserver/src/tests/storageservertest.cpp
index a7fa0b03799..d2cfaac03c2 100644
--- a/storageserver/src/tests/storageservertest.cpp
+++ b/storageserver/src/tests/storageservertest.cpp
@@ -62,7 +62,7 @@ struct Storage : public Node {
};
Distributor::Distributor(vdstestlib::DirConfig& config)
- : _process(config.getConfigId())
+ : _process(config::ConfigUri(config.getConfigId()))
{
_process.setupConfig(60000ms);
_process.createNode();
@@ -71,7 +71,7 @@ Distributor::Distributor(vdstestlib::DirConfig& config)
Distributor::~Distributor() = default;
Storage::Storage(vdstestlib::DirConfig& config)
- : _process(config.getConfigId())
+ : _process(config::ConfigUri(config.getConfigId()))
{
_process.setupConfig(60000ms);
_process.createNode();
diff --git a/storageserver/src/vespa/storageserver/app/distributorprocess.cpp b/storageserver/src/vespa/storageserver/app/distributorprocess.cpp
index ba13f2aeb91..7e65ff68601 100644
--- a/storageserver/src/vespa/storageserver/app/distributorprocess.cpp
+++ b/storageserver/src/vespa/storageserver/app/distributorprocess.cpp
@@ -55,7 +55,7 @@ adjusted_num_distributor_stripes(int32_t cfg_n_stripes)
}
void
-DistributorProcess::setupConfig(milliseconds subscribeTimeout)
+DistributorProcess::setupConfig(vespalib::duration subscribeTimeout)
{
using vespa::config::content::core::StorDistributormanagerConfig;
using vespa::config::content::core::StorVisitordispatcherConfig;
diff --git a/storageserver/src/vespa/storageserver/app/distributorprocess.h b/storageserver/src/vespa/storageserver/app/distributorprocess.h
index 678f131d275..f9d6cc41f4d 100644
--- a/storageserver/src/vespa/storageserver/app/distributorprocess.h
+++ b/storageserver/src/vespa/storageserver/app/distributorprocess.h
@@ -29,7 +29,7 @@ public:
~DistributorProcess() override;
void shutdown() override;
- void setupConfig(milliseconds subscribeTimeout) override;
+ void setupConfig(vespalib::duration subscribeTimeout) override;
void createNode() override;
bool configUpdated() override;
void updateConfig() override;
diff --git a/storageserver/src/vespa/storageserver/app/process.cpp b/storageserver/src/vespa/storageserver/app/process.cpp
index 93d19c8e6fc..ad4d9ffa7f6 100644
--- a/storageserver/src/vespa/storageserver/app/process.cpp
+++ b/storageserver/src/vespa/storageserver/app/process.cpp
@@ -22,7 +22,7 @@ Process::Process(const config::ConfigUri & configUri)
Process::~Process() = default;
void
-Process::setupConfig(milliseconds subscribeTimeout)
+Process::setupConfig(vespalib::duration subscribeTimeout)
{
_documentHandler = _configSubscriber.subscribe<document::config::DocumenttypesConfig>(_configUri.getConfigId(), subscribeTimeout);
if (!_configSubscriber.nextConfig()) {
diff --git a/storageserver/src/vespa/storageserver/app/process.h b/storageserver/src/vespa/storageserver/app/process.h
index fcda67fb201..7050dca6b92 100644
--- a/storageserver/src/vespa/storageserver/app/process.h
+++ b/storageserver/src/vespa/storageserver/app/process.h
@@ -39,12 +39,11 @@ private:
public:
using UP = std::unique_ptr<Process>;
- using milliseconds = std::chrono::milliseconds;
Process(const config::ConfigUri & configUri);
~Process() override;
- virtual void setupConfig(milliseconds subscribeTimeout);
+ virtual void setupConfig(vespalib::duration subscribeTimeout);
virtual void createNode() = 0;
virtual bool configUpdated();
virtual void updateConfig();