summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorGeir Storli <geirst@verizonmedia.com>2021-03-17 16:50:08 +0000
committerGeir Storli <geirst@verizonmedia.com>2021-03-17 16:50:08 +0000
commit06b5a80a3419c12f00500a998558f5253b08e0aa (patch)
tree4c76b01c163fc46a515005facfc1683f2d6b06e5 /storage
parentb5b2b600fa63d9b13f184261e7b5399fac2ca16a (diff)
Stop exposing DistributorComponent from BucketDBUpdater.
Diffstat (limited to 'storage')
-rw-r--r--storage/src/tests/distributor/bucketdbupdatertest.cpp4
-rw-r--r--storage/src/vespa/storage/distributor/bucketdbupdater.cpp4
-rw-r--r--storage/src/vespa/storage/distributor/bucketdbupdater.h9
3 files changed, 9 insertions, 8 deletions
diff --git a/storage/src/tests/distributor/bucketdbupdatertest.cpp b/storage/src/tests/distributor/bucketdbupdatertest.cpp
index 22d9c945262..1b93e728a04 100644
--- a/storage/src/tests/distributor/bucketdbupdatertest.cpp
+++ b/storage/src/tests/distributor/bucketdbupdatertest.cpp
@@ -72,7 +72,7 @@ public:
lib::ClusterStateBundle clusterStateBundle(baselineClusterState);
ClusterInformation::CSP clusterInfo(
new SimpleClusterInformation(
- getBucketDBUpdater().getDistributorComponent().getIndex(),
+ getBucketDBUpdater().node_context().node_index(),
clusterStateBundle,
"ui"));
for (auto* repo : {&mutable_repo(), &read_only_repo()}) {
@@ -1966,7 +1966,7 @@ TEST_F(BucketDBUpdaterTest, newer_mutations_not_overwritten_by_earlier_bucket_fe
document::BucketId bucket(16, 1);
constexpr uint64_t insertionTimestamp = 1001ULL * 1000000;
api::BucketInfo wantedInfo(5, 6, 7);
- getBucketDBUpdater().getDistributorComponent().updateBucketDatabase(
+ getBucketDBUpdater().operation_context().update_bucket_database(
makeDocumentBucket(bucket),
BucketCopy(insertionTimestamp, 0, wantedInfo),
DatabaseUpdate::CREATE_IF_NONEXISTING);
diff --git a/storage/src/vespa/storage/distributor/bucketdbupdater.cpp b/storage/src/vespa/storage/distributor/bucketdbupdater.cpp
index b214827d7fb..12fd14c260e 100644
--- a/storage/src/vespa/storage/distributor/bucketdbupdater.cpp
+++ b/storage/src/vespa/storage/distributor/bucketdbupdater.cpp
@@ -474,7 +474,7 @@ BucketDBUpdater::onActivateClusterStateVersion(const std::shared_ptr<api::Activa
BucketDBUpdater::MergeReplyGuard::~MergeReplyGuard()
{
if (_reply) {
- _updater.getDistributorComponent().getDistributor().handleCompletedMerge(_reply);
+ _distributor_interface.handleCompletedMerge(_reply);
}
}
@@ -482,7 +482,7 @@ bool
BucketDBUpdater::onMergeBucketReply(
const std::shared_ptr<api::MergeBucketReply>& reply)
{
- auto replyGuard = std::make_shared<MergeReplyGuard>(*this, reply);
+ auto replyGuard = std::make_shared<MergeReplyGuard>(_distributor_interface, reply);
// In case the merge was unsuccessful somehow, or some nodes weren't
// actually merged (source-only nodes?) we request the bucket info of the
diff --git a/storage/src/vespa/storage/distributor/bucketdbupdater.h b/storage/src/vespa/storage/distributor/bucketdbupdater.h
index d6538d9c60d..8fab76575e9 100644
--- a/storage/src/vespa/storage/distributor/bucketdbupdater.h
+++ b/storage/src/vespa/storage/distributor/bucketdbupdater.h
@@ -57,7 +57,8 @@ public:
vespalib::string getReportContentType(const framework::HttpUrlPath&) const override;
bool reportStatus(std::ostream&, const framework::HttpUrlPath&) const override;
void print(std::ostream& out, bool verbose, const std::string& indent) const;
- DistributorComponent& getDistributorComponent() { return _distributorComponent; }
+ const DistributorNodeContext& node_context() const { return _node_ctx; }
+ DistributorOperationContext& operation_context() { return _op_ctx; }
/**
* Returns whether the current PendingClusterState indicates that there has
@@ -80,8 +81,8 @@ public:
private:
class MergeReplyGuard {
public:
- MergeReplyGuard(BucketDBUpdater& updater, const std::shared_ptr<api::MergeBucketReply>& reply) noexcept
- : _updater(updater), _reply(reply) {}
+ MergeReplyGuard(DistributorInterface& distributor_interface, const std::shared_ptr<api::MergeBucketReply>& reply) noexcept
+ : _distributor_interface(distributor_interface), _reply(reply) {}
~MergeReplyGuard();
@@ -89,7 +90,7 @@ private:
// than send it down
void resetReply() { _reply.reset(); }
private:
- BucketDBUpdater& _updater;
+ DistributorInterface& _distributor_interface;
std::shared_ptr<api::MergeBucketReply> _reply;
};