aboutsummaryrefslogtreecommitdiffstats
path: root/storageserver
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@broadpark.no>2020-09-29 15:18:38 +0200
committerTor Egge <Tor.Egge@broadpark.no>2020-09-29 15:20:13 +0200
commit9c21ba2339433de72b58a99c856a68dd4de71d4e (patch)
tree1dac26b95d974dec21de2eaa2e95c92ce3c5035c /storageserver
parentcae8ba3bfc5573828a6e4a28d2616694b09cb616 (diff)
Add support for setting storage chain builder for distributor node.
Diffstat (limited to 'storageserver')
-rw-r--r--storageserver/src/vespa/storageserver/app/distributorprocess.cpp12
-rw-r--r--storageserver/src/vespa/storageserver/app/distributorprocess.h4
2 files changed, 14 insertions, 2 deletions
diff --git a/storageserver/src/vespa/storageserver/app/distributorprocess.cpp b/storageserver/src/vespa/storageserver/app/distributorprocess.cpp
index d9972116559..e448c7c68bc 100644
--- a/storageserver/src/vespa/storageserver/app/distributorprocess.cpp
+++ b/storageserver/src/vespa/storageserver/app/distributorprocess.cpp
@@ -2,6 +2,7 @@
#include "distributorprocess.h"
#include <vespa/storage/common/storagelink.h>
+#include <vespa/storage/common/i_storage_chain_builder.h>
#include <vespa/config/helper/configgetter.hpp>
#include <vespa/log/log.h>
@@ -11,7 +12,8 @@ namespace storage {
DistributorProcess::DistributorProcess(const config::ConfigUri & configUri)
: Process(configUri),
- _activeFlag(DistributorNode::NO_NEED_FOR_ACTIVE_STATES)
+ _activeFlag(DistributorNode::NO_NEED_FOR_ACTIVE_STATES),
+ _storage_chain_builder()
{
}
@@ -73,9 +75,15 @@ DistributorProcess::configUpdated()
void
DistributorProcess::createNode()
{
- _node.reset(new DistributorNode(_configUri, _context, *this, _activeFlag, StorageLink::UP()));
+ _node = std::make_unique<DistributorNode>(_configUri, _context, *this, _activeFlag, StorageLink::UP(), std::move(_storage_chain_builder));
_node->handleConfigChange(*_distributorConfigHandler->getConfig());
_node->handleConfigChange(*_visitDispatcherConfigHandler->getConfig());
}
+void
+DistributorProcess::set_storage_chain_builder(std::unique_ptr<IStorageChainBuilder> builder)
+{
+ _storage_chain_builder = std::move(builder);
+}
+
} // storage
diff --git a/storageserver/src/vespa/storageserver/app/distributorprocess.h b/storageserver/src/vespa/storageserver/app/distributorprocess.h
index 4a2289e6151..21e7e9b534a 100644
--- a/storageserver/src/vespa/storageserver/app/distributorprocess.h
+++ b/storageserver/src/vespa/storageserver/app/distributorprocess.h
@@ -12,6 +12,8 @@
namespace storage {
+class IStorageChainBuilder;
+
class DistributorProcess final : public Process {
DistributorNodeContext _context;
DistributorNode::NeedActiveState _activeFlag;
@@ -20,6 +22,7 @@ class DistributorProcess final : public Process {
_distributorConfigHandler;
config::ConfigHandle<vespa::config::content::core::StorVisitordispatcherConfig>::UP
_visitDispatcherConfigHandler;
+ std::unique_ptr<IStorageChainBuilder> _storage_chain_builder;
public:
explicit DistributorProcess(const config::ConfigUri & configUri);
@@ -35,6 +38,7 @@ public:
std::string getComponentName() const override { return "distributor"; }
virtual DistributorNodeContext& getDistributorContext() { return _context; }
+ void set_storage_chain_builder(std::unique_ptr<IStorageChainBuilder> builder);
};
} // storage