summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2021-02-19 05:11:08 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2021-02-19 07:19:55 +0000
commitd29666a12b9777829c328310ddff6af2580e59c5 (patch)
tree4c4b26c17af397fb6577cfa506c25e27bd24a41f /storage
parent0be286e9026e96f8a1b032a2f2a08e943cf771ec (diff)
- Reduce visibility of ClusterState and Distribution.
Diffstat (limited to 'storage')
-rw-r--r--storage/src/tests/bucketdb/bucketmanagertest.cpp2
-rw-r--r--storage/src/tests/common/global_bucket_space_distribution_converter_test.cpp1
-rw-r--r--storage/src/tests/common/testnodestateupdater.cpp3
-rw-r--r--storage/src/tests/common/testnodestateupdater.h6
-rw-r--r--storage/src/tests/common/teststorageapp.cpp2
-rw-r--r--storage/src/tests/common/teststorageapp.h2
-rw-r--r--storage/src/tests/distributor/distributortestutil.cpp1
-rw-r--r--storage/src/tests/distributor/distributortestutil.h2
-rw-r--r--storage/src/tests/distributor/mergeoperationtest.cpp5
-rw-r--r--storage/src/tests/distributor/operationtargetresolvertest.cpp1
-rw-r--r--storage/src/tests/distributor/removebucketoperationtest.cpp1
-rw-r--r--storage/src/tests/distributor/statecheckerstest.cpp1
-rw-r--r--storage/src/tests/persistence/bucketownershipnotifiertest.cpp6
-rw-r--r--storage/src/tests/persistence/common/filestortestfixture.cpp1
-rw-r--r--storage/src/tests/persistence/filestorage/deactivatebucketstest.cpp1
-rw-r--r--storage/src/tests/persistence/filestorage/filestormanagertest.cpp2
-rw-r--r--storage/src/tests/persistence/persistencethread_splittest.cpp1
-rw-r--r--storage/src/tests/storageserver/bouncertest.cpp1
-rw-r--r--storage/src/tests/storageserver/changedbucketownershiphandlertest.cpp9
-rw-r--r--storage/src/tests/storageserver/mergethrottlertest.cpp1
-rw-r--r--storage/src/tests/storageserver/statemanagertest.cpp1
-rw-r--r--storage/src/tests/visiting/visitormanagertest.cpp1
-rw-r--r--storage/src/vespa/storage/common/global_bucket_space_distribution_converter.cpp2
-rw-r--r--storage/src/vespa/storage/common/global_bucket_space_distribution_converter.h2
-rw-r--r--storage/src/vespa/storage/common/nodestateupdater.h3
-rw-r--r--storage/src/vespa/storage/distributor/bucket_ownership_flags.h5
-rw-r--r--storage/src/vespa/storage/distributor/bucket_space_distribution_context.cpp2
-rw-r--r--storage/src/vespa/storage/distributor/bucket_space_distribution_context.h7
-rw-r--r--storage/src/vespa/storage/distributor/bucketdbupdater.cpp2
-rw-r--r--storage/src/vespa/storage/distributor/bucketdbupdater.h1
-rw-r--r--storage/src/vespa/storage/distributor/bucketownership.h3
-rw-r--r--storage/src/vespa/storage/distributor/distributor.cpp1
-rw-r--r--storage/src/vespa/storage/distributor/distributorcomponent.cpp2
-rw-r--r--storage/src/vespa/storage/distributor/distributorcomponent.h5
-rw-r--r--storage/src/vespa/storage/distributor/externaloperationhandler.h12
-rw-r--r--storage/src/vespa/storage/distributor/idealstatemanager.h1
-rw-r--r--storage/src/vespa/storage/distributor/operationowner.h1
-rw-r--r--storage/src/vespa/storage/distributor/operations/external/putoperation.cpp2
-rw-r--r--storage/src/vespa/storage/distributor/operations/external/removelocationoperation.cpp2
-rw-r--r--storage/src/vespa/storage/distributor/operations/external/removeoperation.cpp1
-rw-r--r--storage/src/vespa/storage/distributor/operations/external/updateoperation.cpp1
-rw-r--r--storage/src/vespa/storage/distributor/operations/idealstate/mergeoperation.cpp4
-rw-r--r--storage/src/vespa/storage/distributor/pending_bucket_space_db_transition.cpp2
-rw-r--r--storage/src/vespa/storage/distributor/pendingclusterstate.cpp10
-rw-r--r--storage/src/vespa/storage/distributor/pendingclusterstate.h9
-rw-r--r--storage/src/vespa/storage/distributor/persistencemessagetracker.cpp6
-rw-r--r--storage/src/vespa/storage/distributor/simpleclusterinformation.h3
-rw-r--r--storage/src/vespa/storage/distributor/statechecker.cpp2
-rw-r--r--storage/src/vespa/storage/distributor/statechecker.h14
-rw-r--r--storage/src/vespa/storage/distributor/statecheckers.cpp2
-rw-r--r--storage/src/vespa/storage/frameworkimpl/component/distributorcomponentregisterimpl.cpp8
-rw-r--r--storage/src/vespa/storage/frameworkimpl/component/distributorcomponentregisterimpl.h10
-rw-r--r--storage/src/vespa/storage/frameworkimpl/component/servicelayercomponentregisterimpl.cpp2
-rw-r--r--storage/src/vespa/storage/frameworkimpl/component/servicelayercomponentregisterimpl.h2
-rw-r--r--storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.cpp2
-rw-r--r--storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.h8
-rw-r--r--storage/src/vespa/storage/persistence/bucketownershipnotifier.h1
-rw-r--r--storage/src/vespa/storage/persistence/filestorage/filestormanager.cpp1
-rw-r--r--storage/src/vespa/storage/storageserver/bouncer.cpp1
-rw-r--r--storage/src/vespa/storage/storageserver/bouncer.h2
-rw-r--r--storage/src/vespa/storage/storageserver/changedbucketownershiphandler.cpp1
-rw-r--r--storage/src/vespa/storage/storageserver/changedbucketownershiphandler.h6
-rw-r--r--storage/src/vespa/storage/storageserver/mergethrottler.cpp1
-rw-r--r--storage/src/vespa/storage/storageserver/rpc/cluster_controller_api_rpc_service.cpp1
-rw-r--r--storage/src/vespa/storage/storageserver/statemanager.cpp1
-rw-r--r--storage/src/vespa/storage/storageserver/storagenode.cpp5
66 files changed, 133 insertions, 77 deletions
diff --git a/storage/src/tests/bucketdb/bucketmanagertest.cpp b/storage/src/tests/bucketdb/bucketmanagertest.cpp
index f15a30d8805..e14bb8e11d1 100644
--- a/storage/src/tests/bucketdb/bucketmanagertest.cpp
+++ b/storage/src/tests/bucketdb/bucketmanagertest.cpp
@@ -19,6 +19,8 @@
#include <tests/common/dummystoragelink.h>
#include <tests/common/testhelper.h>
#include <vespa/vdslib/state/random.h>
+#include <vespa/vdslib/distribution/distribution.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/vespalib/gtest/gtest.h>
#include <future>
diff --git a/storage/src/tests/common/global_bucket_space_distribution_converter_test.cpp b/storage/src/tests/common/global_bucket_space_distribution_converter_test.cpp
index 2103970a8f0..4eb8321699a 100644
--- a/storage/src/tests/common/global_bucket_space_distribution_converter_test.cpp
+++ b/storage/src/tests/common/global_bucket_space_distribution_converter_test.cpp
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/storage/common/global_bucket_space_distribution_converter.h>
+#include <vespa/vdslib/distribution/distribution.h>
#include <vespa/config/config.h>
#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/vespalib/gtest/gtest.h>
diff --git a/storage/src/tests/common/testnodestateupdater.cpp b/storage/src/tests/common/testnodestateupdater.cpp
index 27f21a31768..ffa76af1e8a 100644
--- a/storage/src/tests/common/testnodestateupdater.cpp
+++ b/storage/src/tests/common/testnodestateupdater.cpp
@@ -2,6 +2,7 @@
#include "testnodestateupdater.h"
#include <vespa/vdslib/state/cluster_state_bundle.h>
+#include <vespa/vdslib/state/clusterstate.h>
namespace storage {
@@ -23,7 +24,7 @@ TestNodeStateUpdater::getClusterStateBundle() const
}
void
-TestNodeStateUpdater::setClusterState(lib::ClusterState::CSP c)
+TestNodeStateUpdater::setClusterState(std::shared_ptr<const lib::ClusterState> c)
{
setClusterStateBundle(std::make_shared<const lib::ClusterStateBundle>(*c));
}
diff --git a/storage/src/tests/common/testnodestateupdater.h b/storage/src/tests/common/testnodestateupdater.h
index eb15b97a37f..5bf48c46f1a 100644
--- a/storage/src/tests/common/testnodestateupdater.h
+++ b/storage/src/tests/common/testnodestateupdater.h
@@ -10,6 +10,10 @@
#include <vespa/storage/common/nodestateupdater.h>
+namespace storage::lib {
+ class ClusterState;
+ class ClusterStateBundle;
+}
namespace storage {
struct TestNodeStateUpdater : public NodeStateUpdater
@@ -46,7 +50,7 @@ public:
_current = std::make_shared<lib::NodeState>(state);
}
- void setClusterState(lib::ClusterState::CSP c);
+ void setClusterState(std::shared_ptr<const lib::ClusterState> c);
void setClusterStateBundle(std::shared_ptr<const lib::ClusterStateBundle> clusterStateBundle);
size_t explicit_node_state_reply_send_invocations() const noexcept {
diff --git a/storage/src/tests/common/teststorageapp.cpp b/storage/src/tests/common/teststorageapp.cpp
index f932786e2e2..e61050c21a3 100644
--- a/storage/src/tests/common/teststorageapp.cpp
+++ b/storage/src/tests/common/teststorageapp.cpp
@@ -7,6 +7,8 @@
#include <vespa/config-load-type.h>
#include <vespa/config-fleetcontroller.h>
#include <vespa/persistence/dummyimpl/dummypersistence.h>
+#include <vespa/vdslib/distribution/distribution.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/vespalib/util/time.h>
#include <vespa/config/config.h>
diff --git a/storage/src/tests/common/teststorageapp.h b/storage/src/tests/common/teststorageapp.h
index 3742879bd30..9e273002580 100644
--- a/storage/src/tests/common/teststorageapp.h
+++ b/storage/src/tests/common/teststorageapp.h
@@ -84,7 +84,7 @@ public:
const document::BucketIdFactory& getBucketIdFactory()
{ return _compReg.getBucketIdFactory(); }
TestNodeStateUpdater& getStateUpdater() { return _nodeStateUpdater; }
- lib::Distribution::SP getDistribution()
+ std::shared_ptr<lib::Distribution> & getDistribution()
{ return _compReg.getDistribution(); }
TestNodeStateUpdater& getNodeStateUpdater() { return _nodeStateUpdater; }
uint16_t getIndex() const { return _compReg.getIndex(); }
diff --git a/storage/src/tests/distributor/distributortestutil.cpp b/storage/src/tests/distributor/distributortestutil.cpp
index b472ac1284e..2802b976256 100644
--- a/storage/src/tests/distributor/distributortestutil.cpp
+++ b/storage/src/tests/distributor/distributortestutil.cpp
@@ -6,6 +6,7 @@
#include <vespa/storage/distributor/distributor.h>
#include <vespa/storage/distributor/distributor_bucket_space.h>
#include <vespa/storage/distributor/distributorcomponent.h>
+#include <vespa/vdslib/distribution/distribution.h>
#include <vespa/vespalib/text/stringtokenizer.h>
using document::test::makeBucketSpace;
diff --git a/storage/src/tests/distributor/distributortestutil.h b/storage/src/tests/distributor/distributortestutil.h
index ee0e1a9eb65..630d466a72e 100644
--- a/storage/src/tests/distributor/distributortestutil.h
+++ b/storage/src/tests/distributor/distributortestutil.h
@@ -141,7 +141,7 @@ public:
// "End to end" distribution change trigger, which will invoke the bucket
// DB updater as expected based on the previous and new cluster state
// and config.
- void triggerDistributionChange(lib::Distribution::SP distr);
+ void triggerDistributionChange(std::shared_ptr<lib::Distribution> distr);
framework::defaultimplementation::FakeClock& getClock() { return _node->getClock(); }
DistributorComponentRegister& getComponentRegister() { return _node->getComponentRegister(); }
diff --git a/storage/src/tests/distributor/mergeoperationtest.cpp b/storage/src/tests/distributor/mergeoperationtest.cpp
index 90fcf40b3fe..7a90299bfb3 100644
--- a/storage/src/tests/distributor/mergeoperationtest.cpp
+++ b/storage/src/tests/distributor/mergeoperationtest.cpp
@@ -1,13 +1,14 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/document/test/make_document_bucket.h>
#include <tests/common/dummystoragelink.h>
+#include <tests/distributor/distributortestutil.h>
#include <vespa/storage/distributor/idealstatemanager.h>
#include <vespa/storageapi/message/persistence.h>
#include <vespa/storage/distributor/operations/idealstate/mergeoperation.h>
#include <vespa/storage/distributor/bucketdbupdater.h>
#include <vespa/storage/distributor/distributor.h>
#include <vespa/storage/distributor/operation_sequencer.h>
-#include <tests/distributor/distributortestutil.h>
+#include <vespa/vdslib/distribution/distribution.h>
+#include <vespa/document/test/make_document_bucket.h>
#include <vespa/vespalib/text/stringtokenizer.h>
#include <vespa/vespalib/gtest/gtest.h>
diff --git a/storage/src/tests/distributor/operationtargetresolvertest.cpp b/storage/src/tests/distributor/operationtargetresolvertest.cpp
index 721809d4515..a19708d6a27 100644
--- a/storage/src/tests/distributor/operationtargetresolvertest.cpp
+++ b/storage/src/tests/distributor/operationtargetresolvertest.cpp
@@ -9,6 +9,7 @@
#include <vespa/storageapi/message/persistence.h>
#include <tests/distributor/distributortestutil.h>
#include <vespa/vdslib/distribution/idealnodecalculatorimpl.h>
+#include <vespa/vdslib/distribution/distribution.h>
#include <vespa/storage/distributor/distributor_bucket_space_repo.h>
#include <vespa/storage/distributor/distributor_bucket_space.h>
#include <vespa/storage/distributor/operationtargetresolverimpl.h>
diff --git a/storage/src/tests/distributor/removebucketoperationtest.cpp b/storage/src/tests/distributor/removebucketoperationtest.cpp
index c670e89b065..ed669865313 100644
--- a/storage/src/tests/distributor/removebucketoperationtest.cpp
+++ b/storage/src/tests/distributor/removebucketoperationtest.cpp
@@ -8,6 +8,7 @@
#include <vespa/storage/distributor/distributor.h>
#include <tests/distributor/distributortestutil.h>
#include <vespa/document/test/make_document_bucket.h>
+#include <vespa/vdslib/distribution/distribution.h>
#include <vespa/vespalib/gtest/gtest.h>
#include "dummy_cluster_context.h"
diff --git a/storage/src/tests/distributor/statecheckerstest.cpp b/storage/src/tests/distributor/statecheckerstest.cpp
index 8970ba09868..eda083dcc22 100644
--- a/storage/src/tests/distributor/statecheckerstest.cpp
+++ b/storage/src/tests/distributor/statecheckerstest.cpp
@@ -12,6 +12,7 @@
#include <vespa/storage/distributor/statecheckers.h>
#include <vespa/storageapi/message/persistence.h>
#include <vespa/storageapi/message/stat.h>
+#include <vespa/vdslib/distribution/distribution.h>
#include <vespa/vespalib/gtest/gtest.h>
#include <gmock/gmock.h>
diff --git a/storage/src/tests/persistence/bucketownershipnotifiertest.cpp b/storage/src/tests/persistence/bucketownershipnotifiertest.cpp
index 47b1c43ca63..57fc54ed299 100644
--- a/storage/src/tests/persistence/bucketownershipnotifiertest.cpp
+++ b/storage/src/tests/persistence/bucketownershipnotifiertest.cpp
@@ -1,9 +1,11 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-#include <vespa/document/test/make_document_bucket.h>
-#include <vespa/storage/persistence/bucketownershipnotifier.h>
#include <tests/common/message_sender_stub.h>
#include <tests/common/teststorageapp.h>
+#include <vespa/document/test/make_document_bucket.h>
+#include <vespa/storage/persistence/bucketownershipnotifier.h>
+#include <vespa/vdslib/distribution/distribution.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/vespalib/gtest/gtest.h>
using document::test::makeDocumentBucket;
diff --git a/storage/src/tests/persistence/common/filestortestfixture.cpp b/storage/src/tests/persistence/common/filestortestfixture.cpp
index 0ba378e2ff2..bb4237e20da 100644
--- a/storage/src/tests/persistence/common/filestortestfixture.cpp
+++ b/storage/src/tests/persistence/common/filestortestfixture.cpp
@@ -8,6 +8,7 @@
#include <vespa/document/repo/documenttyperepo.h>
#include <vespa/document/fieldset/fieldsets.h>
#include <vespa/document/test/make_document_bucket.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/persistence/spi/test.h>
#include <sstream>
diff --git a/storage/src/tests/persistence/filestorage/deactivatebucketstest.cpp b/storage/src/tests/persistence/filestorage/deactivatebucketstest.cpp
index 0fe18335c23..a48d797d626 100644
--- a/storage/src/tests/persistence/filestorage/deactivatebucketstest.cpp
+++ b/storage/src/tests/persistence/filestorage/deactivatebucketstest.cpp
@@ -6,6 +6,7 @@
#include <tests/persistence/common/persistenceproviderwrapper.h>
#include <vespa/persistence/dummyimpl/dummypersistence.h>
#include <tests/persistence/common/filestortestfixture.h>
+#include <vespa/vdslib/state/clusterstate.h>
using storage::spi::test::makeSpiBucket;
using namespace ::testing;
diff --git a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp
index 8e4671fc78b..290a3574209 100644
--- a/storage/src/tests/persistence/filestorage/filestormanagertest.cpp
+++ b/storage/src/tests/persistence/filestorage/filestormanagertest.cpp
@@ -24,6 +24,8 @@
#include <vespa/storage/storageserver/statemanager.h>
#include <vespa/storageapi/message/bucketsplitting.h>
#include <vespa/vdslib/state/random.h>
+#include <vespa/vdslib/distribution/distribution.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/vespalib/gtest/gtest.h>
#include <vespa/vespalib/util/gate.h>
#include <vespa/vespalib/util/size_literals.h>
diff --git a/storage/src/tests/persistence/persistencethread_splittest.cpp b/storage/src/tests/persistence/persistencethread_splittest.cpp
index 7d83bacd44c..9da72440274 100644
--- a/storage/src/tests/persistence/persistencethread_splittest.cpp
+++ b/storage/src/tests/persistence/persistencethread_splittest.cpp
@@ -6,6 +6,7 @@
#include <vespa/persistence/spi/persistenceprovider.h>
#include <tests/persistence/persistencetestutils.h>
#include <vespa/document/test/make_document_bucket.h>
+#include <vespa/vdslib/state/clusterstate.h>
using storage::spi::test::makeSpiBucket;
using document::test::makeDocumentBucket;
diff --git a/storage/src/tests/storageserver/bouncertest.cpp b/storage/src/tests/storageserver/bouncertest.cpp
index 097ea118f0c..03f2ace84fb 100644
--- a/storage/src/tests/storageserver/bouncertest.cpp
+++ b/storage/src/tests/storageserver/bouncertest.cpp
@@ -13,6 +13,7 @@
#include <vespa/document/fieldset/fieldsets.h>
#include <vespa/storageapi/message/persistence.h>
#include <vespa/persistence/spi/bucket_limits.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/config/common/exceptions.h>
#include <vespa/vespalib/gtest/gtest.h>
diff --git a/storage/src/tests/storageserver/changedbucketownershiphandlertest.cpp b/storage/src/tests/storageserver/changedbucketownershiphandlertest.cpp
index 22441223c5c..a1314479147 100644
--- a/storage/src/tests/storageserver/changedbucketownershiphandlertest.cpp
+++ b/storage/src/tests/storageserver/changedbucketownershiphandlertest.cpp
@@ -1,5 +1,8 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <tests/common/teststorageapp.h>
+#include <tests/common/testhelper.h>
+#include <tests/common/dummystoragelink.h>
#include <vespa/document/base/testdocman.h>
#include <vespa/storage/bucketdb/storbucketdb.h>
#include <vespa/storage/persistence/messages.h>
@@ -8,13 +11,13 @@
#include <vespa/storageapi/message/bucketsplitting.h>
#include <vespa/storageapi/message/removelocation.h>
#include <vespa/storageapi/message/persistence.h>
-#include <tests/common/teststorageapp.h>
-#include <tests/common/testhelper.h>
-#include <tests/common/dummystoragelink.h>
#include <vespa/document/repo/documenttyperepo.h>
#include <vespa/document/update/documentupdate.h>
#include <vespa/document/test/make_document_bucket.h>
#include <vespa/storage/storageserver/changedbucketownershiphandler.h>
+#include <vespa/vdslib/distribution/distribution.h>
+#include <vespa/vdslib/state/clusterstate.h>
+
#include <vespa/vespalib/gtest/gtest.h>
using document::test::makeDocumentBucket;
diff --git a/storage/src/tests/storageserver/mergethrottlertest.cpp b/storage/src/tests/storageserver/mergethrottlertest.cpp
index d8156b21333..12ed9ead1b6 100644
--- a/storage/src/tests/storageserver/mergethrottlertest.cpp
+++ b/storage/src/tests/storageserver/mergethrottlertest.cpp
@@ -7,6 +7,7 @@
#include <tests/common/dummystoragelink.h>
#include <vespa/document/test/make_document_bucket.h>
#include <vespa/storage/storageserver/mergethrottler.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/storage/persistence/messages.h>
#include <vespa/storageapi/message/bucket.h>
#include <vespa/storageapi/message/state.h>
diff --git a/storage/src/tests/storageserver/statemanagertest.cpp b/storage/src/tests/storageserver/statemanagertest.cpp
index 1a9882bd0fa..a263f971c8a 100644
--- a/storage/src/tests/storageserver/statemanagertest.cpp
+++ b/storage/src/tests/storageserver/statemanagertest.cpp
@@ -4,6 +4,7 @@
#include <vespa/storageapi/message/bucket.h>
#include <vespa/storageapi/message/state.h>
#include <vespa/vdslib/state/cluster_state_bundle.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.h>
#include <vespa/storage/storageserver/statemanager.h>
#include <tests/common/teststorageapp.h>
diff --git a/storage/src/tests/visiting/visitormanagertest.cpp b/storage/src/tests/visiting/visitormanagertest.cpp
index 98b48806b90..c29bb4a4da8 100644
--- a/storage/src/tests/visiting/visitormanagertest.cpp
+++ b/storage/src/tests/visiting/visitormanagertest.cpp
@@ -18,6 +18,7 @@
#include <vespa/documentapi/messagebus/messages/putdocumentmessage.h>
#include <vespa/documentapi/messagebus/messages/removedocumentmessage.h>
#include <vespa/documentapi/messagebus/messages/visitor.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/config/common/exceptions.h>
#include <vespa/vespalib/gtest/gtest.h>
#include <vespa/vespalib/objects/nbostream.h>
diff --git a/storage/src/vespa/storage/common/global_bucket_space_distribution_converter.cpp b/storage/src/vespa/storage/common/global_bucket_space_distribution_converter.cpp
index cbcaeef8fdf..8db96e19b82 100644
--- a/storage/src/vespa/storage/common/global_bucket_space_distribution_converter.cpp
+++ b/storage/src/vespa/storage/common/global_bucket_space_distribution_converter.cpp
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "global_bucket_space_distribution_converter.h"
+#include <vespa/vdslib/distribution/distribution.h>
#include <vespa/config/config.h>
#include <vespa/config/print/asciiconfigwriter.h>
#include <vespa/config/print/asciiconfigreader.h>
@@ -9,7 +10,6 @@
#include <vespa/vespalib/stllike/asciistream.h>
#include <cassert>
#include <map>
-#include <memory>
namespace storage {
diff --git a/storage/src/vespa/storage/common/global_bucket_space_distribution_converter.h b/storage/src/vespa/storage/common/global_bucket_space_distribution_converter.h
index b2be65dad42..2237aed406c 100644
--- a/storage/src/vespa/storage/common/global_bucket_space_distribution_converter.h
+++ b/storage/src/vespa/storage/common/global_bucket_space_distribution_converter.h
@@ -2,10 +2,10 @@
#pragma once
-#include <vespa/vdslib/distribution/distribution.h>
#include <vespa/config-stor-distribution.h>
#include <memory>
+namespace storage::lib { class Distribution; }
namespace storage {
struct GlobalBucketSpaceDistributionConverter {
diff --git a/storage/src/vespa/storage/common/nodestateupdater.h b/storage/src/vespa/storage/common/nodestateupdater.h
index da7cb72e321..17f193decb4 100644
--- a/storage/src/vespa/storage/common/nodestateupdater.h
+++ b/storage/src/vespa/storage/common/nodestateupdater.h
@@ -25,7 +25,6 @@
#include <string>
#include <vespa/vdslib/state/nodestate.h>
-#include <vespa/vdslib/state/clusterstate.h>
namespace storage {
@@ -39,7 +38,7 @@ struct StateListener {
struct NodeStateUpdater {
typedef std::unique_ptr<NodeStateUpdater> UP;
- virtual ~NodeStateUpdater() {}
+ virtual ~NodeStateUpdater() = default;
virtual lib::NodeState::CSP getReportedNodeState() const = 0;
virtual lib::NodeState::CSP getCurrentNodeState() const = 0;
diff --git a/storage/src/vespa/storage/distributor/bucket_ownership_flags.h b/storage/src/vespa/storage/distributor/bucket_ownership_flags.h
index c9003552f12..8745309595e 100644
--- a/storage/src/vespa/storage/distributor/bucket_ownership_flags.h
+++ b/storage/src/vespa/storage/distributor/bucket_ownership_flags.h
@@ -1,6 +1,8 @@
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
+#include <cstdint>
+
namespace storage::distributor {
/*
@@ -17,8 +19,7 @@ class BucketOwnershipFlags {
public:
BucketOwnershipFlags() noexcept
: _flags(0)
- {
- }
+ { }
bool owned_in_current_state() const noexcept { return ((_flags & owned_in_current_state_flag) != 0); }
bool owned_in_pending_state() const noexcept { return ((_flags & owned_in_pending_state_flag) != 0); }
diff --git a/storage/src/vespa/storage/distributor/bucket_space_distribution_context.cpp b/storage/src/vespa/storage/distributor/bucket_space_distribution_context.cpp
index c6def05ef25..3f949011eea 100644
--- a/storage/src/vespa/storage/distributor/bucket_space_distribution_context.cpp
+++ b/storage/src/vespa/storage/distributor/bucket_space_distribution_context.cpp
@@ -1,5 +1,7 @@
// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "bucket_space_distribution_context.h"
+#include <vespa/vdslib/distribution/distribution.h>
+#include <vespa/vdslib/state/clusterstate.h>
namespace storage::distributor {
diff --git a/storage/src/vespa/storage/distributor/bucket_space_distribution_context.h b/storage/src/vespa/storage/distributor/bucket_space_distribution_context.h
index 662a1b1daac..5560f6f6ad3 100644
--- a/storage/src/vespa/storage/distributor/bucket_space_distribution_context.h
+++ b/storage/src/vespa/storage/distributor/bucket_space_distribution_context.h
@@ -1,11 +1,14 @@
// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
-#include <vespa/vdslib/distribution/distribution.h>
-#include <vespa/vdslib/state/clusterstate.h>
#include <memory>
#include <cstdint>
+namespace storage::lib {
+ class Distribution;
+ class ClusterState;
+}
+namespace document { class BucketId; }
namespace storage::distributor {
/**
diff --git a/storage/src/vespa/storage/distributor/bucketdbupdater.cpp b/storage/src/vespa/storage/distributor/bucketdbupdater.cpp
index ab2731e0845..17a9b4f5127 100644
--- a/storage/src/vespa/storage/distributor/bucketdbupdater.cpp
+++ b/storage/src/vespa/storage/distributor/bucketdbupdater.cpp
@@ -10,6 +10,8 @@
#include <vespa/document/bucket/fixed_bucket_spaces.h>
#include <vespa/storageapi/message/persistence.h>
#include <vespa/storageapi/message/removelocation.h>
+#include <vespa/vdslib/distribution/distribution.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/vespalib/util/xmlstream.h>
#include <thread>
diff --git a/storage/src/vespa/storage/distributor/bucketdbupdater.h b/storage/src/vespa/storage/distributor/bucketdbupdater.h
index ccfee1e0c36..d70a4fe3409 100644
--- a/storage/src/vespa/storage/distributor/bucketdbupdater.h
+++ b/storage/src/vespa/storage/distributor/bucketdbupdater.h
@@ -33,7 +33,6 @@ class BucketDBUpdater : public framework::StatusReporter,
public api::MessageHandler
{
public:
- using OutdatedNodes = dbtransition::OutdatedNodes;
using OutdatedNodesMap = dbtransition::OutdatedNodesMap;
BucketDBUpdater(Distributor& owner,
DistributorBucketSpaceRepo& bucketSpaceRepo,
diff --git a/storage/src/vespa/storage/distributor/bucketownership.h b/storage/src/vespa/storage/distributor/bucketownership.h
index c22f690a830..4b1e7b22be1 100644
--- a/storage/src/vespa/storage/distributor/bucketownership.h
+++ b/storage/src/vespa/storage/distributor/bucketownership.h
@@ -1,9 +1,10 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
-#include <vespa/vdslib/state/clusterstate.h>
#include <cassert>
+namespace storage::lib { class ClusterState; }
+
namespace storage::distributor {
class BucketOwnership
diff --git a/storage/src/vespa/storage/distributor/distributor.cpp b/storage/src/vespa/storage/distributor/distributor.cpp
index e93bb00b564..2b24eb1195a 100644
--- a/storage/src/vespa/storage/distributor/distributor.cpp
+++ b/storage/src/vespa/storage/distributor/distributor.cpp
@@ -15,6 +15,7 @@
#include <vespa/storage/common/nodestateupdater.h>
#include <vespa/storage/distributor/maintenance/simplebucketprioritydatabase.h>
#include <vespa/storageframework/generic/status/xmlstatusreporter.h>
+#include <vespa/vdslib/distribution/distribution.h>
#include <vespa/vespalib/util/memoryusage.h>
#include <vespa/log/log.h>
diff --git a/storage/src/vespa/storage/distributor/distributorcomponent.cpp b/storage/src/vespa/storage/distributor/distributorcomponent.cpp
index fa5dfa73efc..3f6c125bbfa 100644
--- a/storage/src/vespa/storage/distributor/distributorcomponent.cpp
+++ b/storage/src/vespa/storage/distributor/distributorcomponent.cpp
@@ -5,7 +5,7 @@
#include "pendingmessagetracker.h"
#include <vespa/document/select/parser.h>
#include <vespa/vdslib/state/cluster_state_bundle.h>
-
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/log/log.h>
LOG_SETUP(".distributorstoragelink");
diff --git a/storage/src/vespa/storage/distributor/distributorcomponent.h b/storage/src/vespa/storage/distributor/distributorcomponent.h
index fc5f1663cfe..8b0dfecc125 100644
--- a/storage/src/vespa/storage/distributor/distributorcomponent.h
+++ b/storage/src/vespa/storage/distributor/distributorcomponent.h
@@ -11,8 +11,11 @@
#include <vespa/storage/storageutil/utils.h>
#include <vespa/storageapi/messageapi/storagecommand.h>
#include <vespa/storageapi/buckets/bucketinfo.h>
-#include <vespa/vdslib/state/clusterstate.h>
+namespace staorage::lib {
+ class ClusterState;
+ class ClusterStateBundle;
+}
namespace storage::distributor {
class DistributorBucketSpaceRepo;
diff --git a/storage/src/vespa/storage/distributor/externaloperationhandler.h b/storage/src/vespa/storage/distributor/externaloperationhandler.h
index 1d42f4b3ca8..3f4a6674761 100644
--- a/storage/src/vespa/storage/distributor/externaloperationhandler.h
+++ b/storage/src/vespa/storage/distributor/externaloperationhandler.h
@@ -3,7 +3,6 @@
#include <vespa/document/bucket/bucketid.h>
#include <vespa/document/bucket/bucketidfactory.h>
-#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/storage/distributor/distributorcomponent.h>
#include <vespa/storageapi/messageapi/messagehandler.h>
#include <atomic>
@@ -11,12 +10,10 @@
#include <mutex>
namespace documentapi { class TestAndSetCondition; }
+namespace storage::lib { class ClusterState; }
+namespace storage { class PersistenceOperationMetricSet; }
-namespace storage {
-
-class PersistenceOperationMetricSet;
-
-namespace distributor {
+namespace storage::distributor {
class DistributorMetricSet;
class Distributor;
@@ -139,6 +136,3 @@ private:
};
}
-
-}
-
diff --git a/storage/src/vespa/storage/distributor/idealstatemanager.h b/storage/src/vespa/storage/distributor/idealstatemanager.h
index b30d7b35a6d..7ed28d845d7 100644
--- a/storage/src/vespa/storage/distributor/idealstatemanager.h
+++ b/storage/src/vespa/storage/distributor/idealstatemanager.h
@@ -6,7 +6,6 @@
#include <vespa/storage/distributor/maintenance/maintenanceprioritygenerator.h>
#include <vespa/storage/distributor/maintenance/maintenanceoperationgenerator.h>
#include <vespa/storageframework/generic/status/htmlstatusreporter.h>
-#include <vespa/vdslib/state/clusterstate.h>
namespace storage::distributor {
diff --git a/storage/src/vespa/storage/distributor/operationowner.h b/storage/src/vespa/storage/distributor/operationowner.h
index 5cd0fcb644d..56a5f28f2b6 100644
--- a/storage/src/vespa/storage/distributor/operationowner.h
+++ b/storage/src/vespa/storage/distributor/operationowner.h
@@ -5,7 +5,6 @@
#include "distributormessagesender.h"
#include "operationstarter.h"
#include <vespa/storage/common/storagelink.h>
-#include <vespa/vdslib/state/clusterstate.h>
namespace storage::framework { struct Clock; }
diff --git a/storage/src/vespa/storage/distributor/operations/external/putoperation.cpp b/storage/src/vespa/storage/distributor/operations/external/putoperation.cpp
index 380c4fdf332..cb3c0be6cc5 100644
--- a/storage/src/vespa/storage/distributor/operations/external/putoperation.cpp
+++ b/storage/src/vespa/storage/distributor/operations/external/putoperation.cpp
@@ -8,7 +8,9 @@
#include <vespa/storage/distributor/pendingmessagetracker.h>
#include <vespa/storageapi/message/persistence.h>
#include <vespa/vdslib/distribution/idealnodecalculatorimpl.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/storage/distributor/distributor_bucket_space.h>
+#include <vespa/vdslib/distribution/distribution.h>
#include <algorithm>
#include <vespa/log/log.h>
diff --git a/storage/src/vespa/storage/distributor/operations/external/removelocationoperation.cpp b/storage/src/vespa/storage/distributor/operations/external/removelocationoperation.cpp
index c0d06171320..ad308ee0c19 100644
--- a/storage/src/vespa/storage/distributor/operations/external/removelocationoperation.cpp
+++ b/storage/src/vespa/storage/distributor/operations/external/removelocationoperation.cpp
@@ -6,6 +6,8 @@
#include <vespa/document/fieldvalue/document.h>
#include <vespa/document/select/parser.h>
#include <vespa/storage/distributor/distributor_bucket_space.h>
+#include <vespa/vdslib/state/clusterstate.h>
+
#include <vespa/log/log.h>
LOG_SETUP(".distributor.callback.doc.removelocation");
diff --git a/storage/src/vespa/storage/distributor/operations/external/removeoperation.cpp b/storage/src/vespa/storage/distributor/operations/external/removeoperation.cpp
index 6a7ea8b8f89..722bcc7d27e 100644
--- a/storage/src/vespa/storage/distributor/operations/external/removeoperation.cpp
+++ b/storage/src/vespa/storage/distributor/operations/external/removeoperation.cpp
@@ -2,6 +2,7 @@
#include "removeoperation.h"
#include <vespa/storageapi/message/persistence.h>
#include <vespa/storage/distributor/distributor_bucket_space.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/log/log.h>
LOG_SETUP(".distributor.operation.external.remove");
diff --git a/storage/src/vespa/storage/distributor/operations/external/updateoperation.cpp b/storage/src/vespa/storage/distributor/operations/external/updateoperation.cpp
index f0cd53c15f5..593814cb2f9 100644
--- a/storage/src/vespa/storage/distributor/operations/external/updateoperation.cpp
+++ b/storage/src/vespa/storage/distributor/operations/external/updateoperation.cpp
@@ -7,6 +7,7 @@
#include <vespa/storageapi/message/persistence.h>
#include <vespa/storage/distributor/distributormetricsset.h>
#include <vespa/storage/distributor/distributor_bucket_space.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/vespalib/util/stringfmt.h>
#include <vespa/log/log.h>
diff --git a/storage/src/vespa/storage/distributor/operations/idealstate/mergeoperation.cpp b/storage/src/vespa/storage/distributor/operations/idealstate/mergeoperation.cpp
index 7a1529606b0..dfbff93757a 100644
--- a/storage/src/vespa/storage/distributor/operations/idealstate/mergeoperation.cpp
+++ b/storage/src/vespa/storage/distributor/operations/idealstate/mergeoperation.cpp
@@ -3,6 +3,8 @@
#include <vespa/storage/distributor/idealstatemanager.h>
#include <vespa/storage/distributor/distributor_bucket_space.h>
#include <vespa/storage/distributor/pendingmessagetracker.h>
+#include <vespa/vdslib/distribution/distribution.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <array>
#include <vespa/log/bufferedlogger.h>
@@ -10,7 +12,7 @@ LOG_SETUP(".distributor.operation.idealstate.merge");
namespace storage::distributor {
-MergeOperation::~MergeOperation() {}
+MergeOperation::~MergeOperation() = default;
std::string
MergeOperation::getStatus() const
diff --git a/storage/src/vespa/storage/distributor/pending_bucket_space_db_transition.cpp b/storage/src/vespa/storage/distributor/pending_bucket_space_db_transition.cpp
index 7eb2e2bf236..af6223afe28 100644
--- a/storage/src/vespa/storage/distributor/pending_bucket_space_db_transition.cpp
+++ b/storage/src/vespa/storage/distributor/pending_bucket_space_db_transition.cpp
@@ -4,6 +4,8 @@
#include "clusterinformation.h"
#include "pendingclusterstate.h"
#include "distributor_bucket_space.h"
+#include <vespa/vdslib/distribution/distribution.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <algorithm>
#include <vespa/log/log.h>
diff --git a/storage/src/vespa/storage/distributor/pendingclusterstate.cpp b/storage/src/vespa/storage/distributor/pendingclusterstate.cpp
index d009375a641..c694fda2c1b 100644
--- a/storage/src/vespa/storage/distributor/pendingclusterstate.cpp
+++ b/storage/src/vespa/storage/distributor/pendingclusterstate.cpp
@@ -8,6 +8,7 @@
#include <vespa/storageframework/defaultimplementation/clock/realclock.h>
#include <vespa/storage/common/global_bucket_space_distribution_converter.h>
#include <vespa/document/bucket/fixed_bucket_spaces.h>
+#include <vespa/vdslib/distribution/distribution.h>
#include <vespa/vespalib/util/xmlstream.hpp>
#include <climits>
@@ -358,4 +359,13 @@ PendingClusterState::getPendingBucketSpaceDbTransition(document::BucketSpace buc
return *transitionIter->second;
}
+std::string
+PendingClusterState::getNewClusterStateBundleString() const {
+ return _newClusterStateBundle.getBaselineClusterState()->toString();
+}
+std::string
+PendingClusterState::getPrevClusterStateBundleString() const {
+ return _prevClusterStateBundle.getBaselineClusterState()->toString();
+}
+
}
diff --git a/storage/src/vespa/storage/distributor/pendingclusterstate.h b/storage/src/vespa/storage/distributor/pendingclusterstate.h
index c355af3e00f..6d558d05640 100644
--- a/storage/src/vespa/storage/distributor/pendingclusterstate.h
+++ b/storage/src/vespa/storage/distributor/pendingclusterstate.h
@@ -7,7 +7,6 @@
#include <vespa/storageapi/message/bucket.h>
#include <vespa/storageapi/message/state.h>
#include <vespa/storageframework/generic/clock/clock.h>
-#include <vespa/vdslib/distribution/distribution.h>
#include <vespa/vdslib/state/cluster_state_bundle.h>
#include <vespa/vespalib/util/xmlserializable.h>
#include "outdated_nodes_map.h"
@@ -209,12 +208,8 @@ private:
bool iAmDown() const;
bool storageNodeUpInNewState(document::BucketSpace bucketSpace, uint16_t node) const;
- std::string getNewClusterStateBundleString() const {
- return _newClusterStateBundle.getBaselineClusterState()->toString();
- }
- std::string getPrevClusterStateBundleString() const {
- return _prevClusterStateBundle.getBaselineClusterState()->toString();
- }
+ std::string getNewClusterStateBundleString() const;
+ std::string getPrevClusterStateBundleString() const;
void update_reply_failure_statistics(const api::ReturnCode& result, const BucketSpaceAndNode& source);
std::shared_ptr<api::SetSystemStateCommand> _cmd;
diff --git a/storage/src/vespa/storage/distributor/persistencemessagetracker.cpp b/storage/src/vespa/storage/distributor/persistencemessagetracker.cpp
index 10e69bcfd14..173e29566ac 100644
--- a/storage/src/vespa/storage/distributor/persistencemessagetracker.cpp
+++ b/storage/src/vespa/storage/distributor/persistencemessagetracker.cpp
@@ -1,13 +1,13 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "persistencemessagetracker.h"
-#include <vespa/storage/common/vectorprinter.h>
-#include <vespa/storageapi/message/persistence.h>
#include "distributor_bucket_space_repo.h"
#include "distributor_bucket_space.h"
+#include <vespa/vdslib/distribution/distribution.h>
+#include <vespa/storage/common/vectorprinter.h>
+#include <vespa/storageapi/message/persistence.h>
#include <vespa/log/log.h>
-
LOG_SETUP(".persistencemessagetracker");
namespace storage::distributor {
diff --git a/storage/src/vespa/storage/distributor/simpleclusterinformation.h b/storage/src/vespa/storage/distributor/simpleclusterinformation.h
index 1247d425e50..554ef0dbb5c 100644
--- a/storage/src/vespa/storage/distributor/simpleclusterinformation.h
+++ b/storage/src/vespa/storage/distributor/simpleclusterinformation.h
@@ -2,8 +2,7 @@
#pragma once
#include "clusterinformation.h"
-#include <vespa/vdslib/distribution/distribution.h>
-#include <vespa/vdslib/state/clusterstate.h>
+#include <vespa/vdslib/state/cluster_state_bundle.h>
namespace storage::distributor {
diff --git a/storage/src/vespa/storage/distributor/statechecker.cpp b/storage/src/vespa/storage/distributor/statechecker.cpp
index 2740d275732..22605d56a74 100644
--- a/storage/src/vespa/storage/distributor/statechecker.cpp
+++ b/storage/src/vespa/storage/distributor/statechecker.cpp
@@ -2,6 +2,8 @@
#include "statechecker.h"
#include "distributorcomponent.h"
#include "distributor_bucket_space.h"
+#include <vespa/vdslib/distribution/distribution.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/log/log.h>
LOG_SETUP(".distributor.statechecker");
diff --git a/storage/src/vespa/storage/distributor/statechecker.h b/storage/src/vespa/storage/distributor/statechecker.h
index 5b9ce065f99..734b44bd7d1 100644
--- a/storage/src/vespa/storage/distributor/statechecker.h
+++ b/storage/src/vespa/storage/distributor/statechecker.h
@@ -6,17 +6,16 @@
#include <vespa/storage/distributor/operations/idealstate/idealstateoperation.h>
#include <vespa/storage/common/storagecomponent.h>
#include <vespa/storage/bucketdb/bucketdatabase.h>
-#include <vespa/vdslib/distribution/distribution.h>
-#include <vespa/vdslib/state/clusterstate.h>
#include <unordered_set>
#include <map>
#include <set>
-namespace storage {
-
-class DistributorConfiguration;
+namespace storage::lib {
+ class ClusterState;
+}
+namespace storage { class DistributorConfiguration; }
-namespace distributor {
+namespace storage::distributor {
class DistributorComponent;
class DistributorBucketSpace;
@@ -165,6 +164,3 @@ public:
};
}
-
-}
-
diff --git a/storage/src/vespa/storage/distributor/statecheckers.cpp b/storage/src/vespa/storage/distributor/statecheckers.cpp
index bdd850e1e23..ed3e47fcafb 100644
--- a/storage/src/vespa/storage/distributor/statecheckers.cpp
+++ b/storage/src/vespa/storage/distributor/statecheckers.cpp
@@ -9,6 +9,8 @@
#include <vespa/storage/distributor/operations/idealstate/setbucketstateoperation.h>
#include <vespa/storage/distributor/operations/idealstate/mergeoperation.h>
#include <vespa/storage/distributor/operations/idealstate/garbagecollectionoperation.h>
+#include <vespa/vdslib/distribution/distribution.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/vespalib/stllike/asciistream.h>
#include <vespa/log/log.h>
diff --git a/storage/src/vespa/storage/frameworkimpl/component/distributorcomponentregisterimpl.cpp b/storage/src/vespa/storage/frameworkimpl/component/distributorcomponentregisterimpl.cpp
index efd558a0b4b..629ebb68c43 100644
--- a/storage/src/vespa/storage/frameworkimpl/component/distributorcomponentregisterimpl.cpp
+++ b/storage/src/vespa/storage/frameworkimpl/component/distributorcomponentregisterimpl.cpp
@@ -2,11 +2,13 @@
#include "distributorcomponentregisterimpl.h"
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/vdslib/state/cluster_state_bundle.h>
+#include <vespa/vdslib/state/clusterstate.h>
namespace storage {
DistributorComponentRegisterImpl::DistributorComponentRegisterImpl()
- : _timeCalculator(0)
+ : _timeCalculator(0),
+ _clusterState(std::make_shared<lib::ClusterState>())
{
}
@@ -16,7 +18,7 @@ void
DistributorComponentRegisterImpl::handleNewState()
{
auto clusterStateBundle = getNodeStateUpdater().getClusterStateBundle();
- _clusterState = *clusterStateBundle->getBaselineClusterState();
+ _clusterState = std::make_shared<lib::ClusterState>(*clusterStateBundle->getBaselineClusterState());
}
void
@@ -72,7 +74,7 @@ DistributorComponentRegisterImpl::setNodeStateUpdater(NodeStateUpdater& updater)
StorageComponentRegisterImpl::setNodeStateUpdater(updater);
auto clusterStateBundle = updater.getClusterStateBundle();
if (clusterStateBundle) {
- _clusterState = *clusterStateBundle->getBaselineClusterState();
+ _clusterState = std::make_shared<lib::ClusterState>(*clusterStateBundle->getBaselineClusterState());
}
updater.addStateListener(*this);
}
diff --git a/storage/src/vespa/storage/frameworkimpl/component/distributorcomponentregisterimpl.h b/storage/src/vespa/storage/frameworkimpl/component/distributorcomponentregisterimpl.h
index a6c678630e0..8a2e4eef491 100644
--- a/storage/src/vespa/storage/frameworkimpl/component/distributorcomponentregisterimpl.h
+++ b/storage/src/vespa/storage/frameworkimpl/component/distributorcomponentregisterimpl.h
@@ -11,11 +11,13 @@
#include <vespa/storage/common/distributorcomponent.h>
#include <vespa/storage/common/nodestateupdater.h>
-namespace storage {
-namespace lib {
+namespace storage::lib {
class IdealNodeCalculatorConfigurable;
+ class ClusterState;
}
+namespace storage {
+
class DistributorComponentRegisterImpl
: public virtual DistributorComponentRegister,
public virtual StorageComponentRegisterImpl,
@@ -27,7 +29,7 @@ class DistributorComponentRegisterImpl
UniqueTimeCalculator* _timeCalculator;
DistributorConfig _distributorConfig;
VisitorConfig _visitorConfig;
- lib::ClusterState _clusterState;
+ std::shared_ptr<lib::ClusterState> _clusterState;
public:
typedef std::unique_ptr<DistributorComponentRegisterImpl> UP;
@@ -44,4 +46,4 @@ private:
void setNodeStateUpdater(NodeStateUpdater& updater) override;
};
-} // storage
+}
diff --git a/storage/src/vespa/storage/frameworkimpl/component/servicelayercomponentregisterimpl.cpp b/storage/src/vespa/storage/frameworkimpl/component/servicelayercomponentregisterimpl.cpp
index e2a06ee640b..d2b6578c66b 100644
--- a/storage/src/vespa/storage/frameworkimpl/component/servicelayercomponentregisterimpl.cpp
+++ b/storage/src/vespa/storage/frameworkimpl/component/servicelayercomponentregisterimpl.cpp
@@ -23,7 +23,7 @@ ServiceLayerComponentRegisterImpl::registerServiceLayerComponent(ServiceLayerMan
}
void
-ServiceLayerComponentRegisterImpl::setDistribution(lib::Distribution::SP distribution)
+ServiceLayerComponentRegisterImpl::setDistribution(std::shared_ptr<lib::Distribution> distribution)
{
_bucketSpaceRepo.get(document::FixedBucketSpaces::default_space()).setDistribution(distribution);
auto global_distr = GlobalBucketSpaceDistributionConverter::convert_to_global(*distribution);
diff --git a/storage/src/vespa/storage/frameworkimpl/component/servicelayercomponentregisterimpl.h b/storage/src/vespa/storage/frameworkimpl/component/servicelayercomponentregisterimpl.h
index a77b8061842..6bed5e82fd3 100644
--- a/storage/src/vespa/storage/frameworkimpl/component/servicelayercomponentregisterimpl.h
+++ b/storage/src/vespa/storage/frameworkimpl/component/servicelayercomponentregisterimpl.h
@@ -34,7 +34,7 @@ public:
}
void registerServiceLayerComponent(ServiceLayerManagedComponent&) override;
- void setDistribution(lib::Distribution::SP distribution) override;
+ void setDistribution(std::shared_ptr<lib::Distribution> distribution) override;
};
} // storage
diff --git a/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.cpp b/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.cpp
index 3ce02a73324..72dfd30fee3 100644
--- a/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.cpp
+++ b/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.cpp
@@ -91,7 +91,7 @@ StorageComponentRegisterImpl::setBucketIdFactory(const document::BucketIdFactory
}
void
-StorageComponentRegisterImpl::setDistribution(lib::Distribution::SP distribution)
+StorageComponentRegisterImpl::setDistribution(std::shared_ptr<lib::Distribution> distribution)
{
std::lock_guard lock(_componentLock);
_distribution = distribution;
diff --git a/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.h b/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.h
index 85edfe78c28..70ee110ed87 100644
--- a/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.h
+++ b/storage/src/vespa/storage/frameworkimpl/component/storagecomponentregisterimpl.h
@@ -11,8 +11,8 @@
#include <vespa/storage/common/storagecomponent.h>
#include <vespa/config-bucketspaces.h>
#include <vespa/storageframework/defaultimplementation/component/componentregisterimpl.h>
-#include <vespa/vdslib/distribution/distribution.h>
+namespace storage::lib { class Distribution; }
namespace storage {
class StorageComponentRegisterImpl
@@ -28,7 +28,7 @@ class StorageComponentRegisterImpl
uint16_t _index;
std::shared_ptr<const document::DocumentTypeRepo> _docTypeRepo;
document::BucketIdFactory _bucketIdFactory;
- lib::Distribution::SP _distribution;
+ std::shared_ptr<lib::Distribution> _distribution;
NodeStateUpdater* _nodeStateUpdater;
BucketspacesConfig _bucketSpacesConfig;
@@ -42,7 +42,7 @@ public:
uint16_t getIndex() const { return _index; }
std::shared_ptr<const document::DocumentTypeRepo> getTypeRepo() { return _docTypeRepo; }
const document::BucketIdFactory& getBucketIdFactory() { return _bucketIdFactory; }
- lib::Distribution::SP getDistribution() { return _distribution; }
+ std::shared_ptr<lib::Distribution> & getDistribution() { return _distribution; }
NodeStateUpdater& getNodeStateUpdater() { return *_nodeStateUpdater; }
void registerStorageComponent(StorageComponent&) override;
@@ -51,7 +51,7 @@ public:
virtual void setNodeStateUpdater(NodeStateUpdater& updater);
virtual void setDocumentTypeRepo(std::shared_ptr<const document::DocumentTypeRepo>);
virtual void setBucketIdFactory(const document::BucketIdFactory&);
- virtual void setDistribution(lib::Distribution::SP);
+ virtual void setDistribution(std::shared_ptr<lib::Distribution>);
virtual void setBucketSpacesConfig(const BucketspacesConfig&);
};
diff --git a/storage/src/vespa/storage/persistence/bucketownershipnotifier.h b/storage/src/vespa/storage/persistence/bucketownershipnotifier.h
index 948fc54726f..f3e3f60b633 100644
--- a/storage/src/vespa/storage/persistence/bucketownershipnotifier.h
+++ b/storage/src/vespa/storage/persistence/bucketownershipnotifier.h
@@ -3,7 +3,6 @@
#include <vector>
#include <vespa/document/bucket/bucket.h>
-#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/storageapi/buckets/bucketinfo.h>
#include <vespa/storage/common/messagesender.h>
#include <vespa/storage/common/servicelayercomponent.h>
diff --git a/storage/src/vespa/storage/persistence/filestorage/filestormanager.cpp b/storage/src/vespa/storage/persistence/filestorage/filestormanager.cpp
index eee509e79f8..f4a94af0d35 100644
--- a/storage/src/vespa/storage/persistence/filestorage/filestormanager.cpp
+++ b/storage/src/vespa/storage/persistence/filestorage/filestormanager.cpp
@@ -7,6 +7,7 @@
#include <vespa/storage/common/content_bucket_space_repo.h>
#include <vespa/storage/common/doneinitializehandler.h>
#include <vespa/vdslib/state/cluster_state_bundle.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/storage/common/hostreporter/hostinfo.h>
#include <vespa/storage/common/messagebucket.h>
#include <vespa/storage/config/config-stor-server.h>
diff --git a/storage/src/vespa/storage/storageserver/bouncer.cpp b/storage/src/vespa/storage/storageserver/bouncer.cpp
index 9ef8a02b74e..de9033b8d0e 100644
--- a/storage/src/vespa/storage/storageserver/bouncer.cpp
+++ b/storage/src/vespa/storage/storageserver/bouncer.cpp
@@ -4,6 +4,7 @@
#include "bouncer_metrics.h"
#include "config_logging.h"
#include <vespa/vdslib/state/cluster_state_bundle.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/persistence/spi/bucket_limits.h>
#include <vespa/storageapi/message/state.h>
#include <vespa/storageapi/message/persistence.h>
diff --git a/storage/src/vespa/storage/storageserver/bouncer.h b/storage/src/vespa/storage/storageserver/bouncer.h
index 7e1d6eaa4ba..9f9d82217df 100644
--- a/storage/src/vespa/storage/storageserver/bouncer.h
+++ b/storage/src/vespa/storage/storageserver/bouncer.h
@@ -12,7 +12,7 @@
#pragma once
#include <vespa/config/helper/configfetcher.h>
-#include <vespa/vdslib/state/clusterstate.h>
+#include <vespa/vdslib/state/nodestate.h>
#include <vespa/storage/common/nodestateupdater.h>
#include <vespa/storage/common/storagecomponent.h>
#include <vespa/storage/common/storagelink.h>
diff --git a/storage/src/vespa/storage/storageserver/changedbucketownershiphandler.cpp b/storage/src/vespa/storage/storageserver/changedbucketownershiphandler.cpp
index a736ea58406..6b121dd9a9e 100644
--- a/storage/src/vespa/storage/storageserver/changedbucketownershiphandler.cpp
+++ b/storage/src/vespa/storage/storageserver/changedbucketownershiphandler.cpp
@@ -5,6 +5,7 @@
#include <vespa/storage/bucketdb/storbucketdb.h>
#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/vdslib/state/cluster_state_bundle.h>
+#include <vespa/vdslib/distribution/distribution.h>
#include <vespa/storage/common/messagebucket.h>
#include <vespa/storage/common/nodestateupdater.h>
#include <vespa/storage/common/content_bucket_space_repo.h>
diff --git a/storage/src/vespa/storage/storageserver/changedbucketownershiphandler.h b/storage/src/vespa/storage/storageserver/changedbucketownershiphandler.h
index b2661ce0d8d..3455108119e 100644
--- a/storage/src/vespa/storage/storageserver/changedbucketownershiphandler.h
+++ b/storage/src/vespa/storage/storageserver/changedbucketownershiphandler.h
@@ -3,7 +3,6 @@
#include <vespa/document/bucket/bucketid.h>
#include <vespa/storage/common/storagelink.h>
-#include <vespa/vdslib/distribution/distribution.h>
#include <vespa/config/config.h>
#include <vespa/config-persistence.h>
#include <vespa/storage/common/servicelayercomponent.h>
@@ -18,8 +17,9 @@
namespace storage {
namespace lib {
-class ClusterState;
-class ClusterStateBundle;
+ class ClusterState;
+ class ClusterStateBundle;
+ class Distribution;
}
/**
diff --git a/storage/src/vespa/storage/storageserver/mergethrottler.cpp b/storage/src/vespa/storage/storageserver/mergethrottler.cpp
index 2984ba27344..dc8457769a2 100644
--- a/storage/src/vespa/storage/storageserver/mergethrottler.cpp
+++ b/storage/src/vespa/storage/storageserver/mergethrottler.cpp
@@ -3,6 +3,7 @@
#include "mergethrottler.h"
#include <vespa/storage/common/nodestateupdater.h>
#include <vespa/storage/persistence/messages.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/messagebus/message.h>
#include <vespa/messagebus/error.h>
#include <vespa/config/common/exceptions.h>
diff --git a/storage/src/vespa/storage/storageserver/rpc/cluster_controller_api_rpc_service.cpp b/storage/src/vespa/storage/storageserver/rpc/cluster_controller_api_rpc_service.cpp
index 4c7cf05241a..60a0fdac341 100644
--- a/storage/src/vespa/storage/storageserver/rpc/cluster_controller_api_rpc_service.cpp
+++ b/storage/src/vespa/storage/storageserver/rpc/cluster_controller_api_rpc_service.cpp
@@ -5,6 +5,7 @@
#include <vespa/storage/storageserver/communicationmanager.h>
#include <vespa/storage/storageserver/message_dispatcher.h>
#include <vespa/storage/storageserver/rpcrequestwrapper.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/fnet/frt/supervisor.h>
#include <vespa/fnet/frt/rpcrequest.h>
#include <vespa/storageapi/message/state.h>
diff --git a/storage/src/vespa/storage/storageserver/statemanager.cpp b/storage/src/vespa/storage/storageserver/statemanager.cpp
index f2b23724c98..68ba9199f7b 100644
--- a/storage/src/vespa/storage/storageserver/statemanager.cpp
+++ b/storage/src/vespa/storage/storageserver/statemanager.cpp
@@ -8,6 +8,7 @@
#include <vespa/metrics/metricmanager.h>
#include <vespa/storageapi/messageapi/storagemessage.h>
#include <vespa/vdslib/state/cluster_state_bundle.h>
+#include <vespa/vdslib/state/clusterstate.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/vespalib/stllike/asciistream.h>
#include <vespa/vespalib/util/exceptions.h>
diff --git a/storage/src/vespa/storage/storageserver/storagenode.cpp b/storage/src/vespa/storage/storageserver/storagenode.cpp
index 79205b8b513..bf517bd6869 100644
--- a/storage/src/vespa/storage/storageserver/storagenode.cpp
+++ b/storage/src/vespa/storage/storageserver/storagenode.cpp
@@ -14,6 +14,7 @@
#include <vespa/storage/common/storage_chain_builder.h>
#include <vespa/storage/frameworkimpl/status/statuswebserver.h>
#include <vespa/storage/frameworkimpl/thread/deadlockdetector.h>
+#include <vespa/vdslib/distribution/distribution.h>
#include <vespa/vespalib/io/fileutil.h>
#include <vespa/vespalib/util/exceptions.h>
#include <vespa/vespalib/util/time.h>
@@ -107,7 +108,7 @@ StorageNode::StorageNode(
void
StorageNode::subscribeToConfigs()
{
- _configFetcher.reset(new config::ConfigFetcher(_configUri.getContext()));
+ _configFetcher = std::make_unique<config::ConfigFetcher>(_configUri.getContext());
_configFetcher->subscribe<StorDistributionConfig>(_configUri.getConfigId(), this);
_configFetcher->subscribe<UpgradingConfig>(_configUri.getConfigId(), this);
_configFetcher->subscribe<StorServerConfig>(_configUri.getConfigId(), this);
@@ -181,7 +182,7 @@ StorageNode::initialize()
_generationFetcher);
// Start deadlock detector
- _deadLockDetector.reset(new DeadLockDetector(_context.getComponentRegister()));
+ _deadLockDetector = std::make_unique<DeadLockDetector>(_context.getComponentRegister());
_deadLockDetector->enableWarning(_serverConfig->enableDeadLockDetectorWarnings);
_deadLockDetector->enableShutdown(_serverConfig->enableDeadLockDetector);
_deadLockDetector->setProcessSlack(vespalib::from_s(_serverConfig->deadLockDetectorTimeoutSlack));