aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storage/storageserver/distributornode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'storage/src/vespa/storage/storageserver/distributornode.cpp')
-rw-r--r--storage/src/vespa/storage/storageserver/distributornode.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/storage/src/vespa/storage/storageserver/distributornode.cpp b/storage/src/vespa/storage/storageserver/distributornode.cpp
index 431dd89b613..10ee8023621 100644
--- a/storage/src/vespa/storage/storageserver/distributornode.cpp
+++ b/storage/src/vespa/storage/storageserver/distributornode.cpp
@@ -1,4 +1,4 @@
-// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "distributornode.h"
#include "bouncer.h"
@@ -18,12 +18,13 @@ namespace storage {
DistributorNode::DistributorNode(
const config::ConfigUri& configUri,
DistributorNodeContext& context,
+ BootstrapConfigs bootstrap_configs,
ApplicationGenerationFetcher& generationFetcher,
uint32_t num_distributor_stripes,
StorageLink::UP communicationManager,
std::unique_ptr<IStorageChainBuilder> storage_chain_builder)
- : StorageNode(configUri, context, generationFetcher,
- std::make_unique<HostInfo>(),
+ : StorageNode(configUri, context, std::move(bootstrap_configs),
+ generationFetcher, std::make_unique<HostInfo>(),
!communicationManager ? NORMAL : SINGLE_THREADED_TEST_MODE),
_threadPool(framework::TickingThreadPool::createDefault("distributor", 100ms, 1, 5s)),
_stripe_pool(std::make_unique<distributor::DistributorStripePool>()),
@@ -32,7 +33,8 @@ DistributorNode::DistributorNode(
_timestamp_second_counter(0),
_intra_second_pseudo_usec_counter(0),
_num_distributor_stripes(num_distributor_stripes),
- _retrievedCommunicationManager(std::move(communicationManager))
+ _retrievedCommunicationManager(std::move(communicationManager)), // may be nullptr
+ _bouncer(nullptr)
{
if (storage_chain_builder) {
set_storage_chain_builder(std::move(storage_chain_builder));
@@ -82,19 +84,19 @@ void
DistributorNode::createChain(IStorageChainBuilder &builder)
{
DistributorComponentRegister& dcr(_context.getComponentRegister());
- // TODO: All components in this chain should use a common thread instead of
- // each having its own configfetcher.
StorageLink::UP chain;
if (_retrievedCommunicationManager) {
builder.add(std::move(_retrievedCommunicationManager));
} else {
- auto communication_manager = std::make_unique<CommunicationManager>(dcr, _configUri);
+ auto communication_manager = std::make_unique<CommunicationManager>(dcr, _configUri, communication_manager_config());
_communicationManager = communication_manager.get();
builder.add(std::move(communication_manager));
}
std::unique_ptr<StateManager> stateManager(releaseStateManager());
- builder.add(std::make_unique<Bouncer>(dcr, _configUri));
+ auto bouncer = std::make_unique<Bouncer>(dcr, bouncer_config());
+ _bouncer = bouncer.get();
+ builder.add(std::move(bouncer));
// Distributor instance registers a host info reporter with the state
// manager, which is safe since the lifetime of said state manager
// extends to the end of the process.
@@ -140,4 +142,9 @@ DistributorNode::pause()
return {};
}
+void DistributorNode::on_bouncer_config_changed() {
+ assert(_bouncer);
+ _bouncer->on_configure(bouncer_config());
+}
+
} // storage