summaryrefslogtreecommitdiffstats
path: root/storage/src
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahoo-inc.com>2017-11-21 13:27:46 +0000
committerTor Brede Vekterli <vekterli@yahoo-inc.com>2017-11-21 13:28:21 +0000
commitcee949480547795743c4b2324fafd53963b6f416 (patch)
tree5d828824763fda07d12cab5511ffd13febc6d5ff /storage/src
parent0402f631056ac1ea1449b91b6e7eff08152d4bc1 (diff)
Add document::BucketSpace accessor to ContentBucketSpace
Diffstat (limited to 'storage/src')
-rw-r--r--storage/src/vespa/storage/bucketmover/run.cpp2
-rw-r--r--storage/src/vespa/storage/common/content_bucket_space.cpp5
-rw-r--r--storage/src/vespa/storage/common/content_bucket_space.h6
-rw-r--r--storage/src/vespa/storage/common/content_bucket_space_repo.cpp2
4 files changed, 10 insertions, 5 deletions
diff --git a/storage/src/vespa/storage/bucketmover/run.cpp b/storage/src/vespa/storage/bucketmover/run.cpp
index 2a5bd72bdba..22bcfa55f15 100644
--- a/storage/src/vespa/storage/bucketmover/run.cpp
+++ b/storage/src/vespa/storage/bucketmover/run.cpp
@@ -114,7 +114,7 @@ Run::getNextMove()
}
// Cache more entries
- BucketIterator it(document::BucketSpace::placeHolder(), *_distribution,
+ BucketIterator it(_bucketSpace.bucketSpace(), *_distribution,
_nodeState, _nodeIndex, _statistics, _entries);
_bucketSpace.bucketDatabase().all(it, "bucketmover::Run", _statistics._lastBucketVisited.toKey());
if (it._bucketsVisited == 0) {
diff --git a/storage/src/vespa/storage/common/content_bucket_space.cpp b/storage/src/vespa/storage/common/content_bucket_space.cpp
index 0f84a2d0e38..4344bccc785 100644
--- a/storage/src/vespa/storage/common/content_bucket_space.cpp
+++ b/storage/src/vespa/storage/common/content_bucket_space.cpp
@@ -4,8 +4,9 @@
namespace storage {
-ContentBucketSpace::ContentBucketSpace()
- : _bucketDatabase(),
+ContentBucketSpace::ContentBucketSpace(document::BucketSpace bucketSpace)
+ : _bucketSpace(bucketSpace),
+ _bucketDatabase(),
_lock(),
_distribution()
{
diff --git a/storage/src/vespa/storage/common/content_bucket_space.h b/storage/src/vespa/storage/common/content_bucket_space.h
index 65524121ca6..3b3dddade4f 100644
--- a/storage/src/vespa/storage/common/content_bucket_space.h
+++ b/storage/src/vespa/storage/common/content_bucket_space.h
@@ -1,6 +1,7 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
+#include <vespa/document/bucket/bucketspace.h>
#include <vespa/storage/bucketdb/storbucketdb.h>
#include <mutex>
@@ -13,13 +14,16 @@ namespace lib { class Distribution; }
*/
class ContentBucketSpace {
private:
+ document::BucketSpace _bucketSpace;
StorBucketDatabase _bucketDatabase;
mutable std::mutex _lock;
std::shared_ptr<const lib::Distribution> _distribution;
public:
using UP = std::unique_ptr<ContentBucketSpace>;
- ContentBucketSpace();
+ ContentBucketSpace(document::BucketSpace bucketSpace);
+
+ document::BucketSpace bucketSpace() const noexcept { return _bucketSpace; }
StorBucketDatabase &bucketDatabase() { return _bucketDatabase; }
void setDistribution(std::shared_ptr<const lib::Distribution> distribution);
std::shared_ptr<const lib::Distribution> getDistribution() const;
diff --git a/storage/src/vespa/storage/common/content_bucket_space_repo.cpp b/storage/src/vespa/storage/common/content_bucket_space_repo.cpp
index 3761b6fc20d..1846c132c0a 100644
--- a/storage/src/vespa/storage/common/content_bucket_space_repo.cpp
+++ b/storage/src/vespa/storage/common/content_bucket_space_repo.cpp
@@ -9,7 +9,7 @@ namespace storage {
ContentBucketSpaceRepo::ContentBucketSpaceRepo()
: _map()
{
- _map.emplace(BucketSpace::placeHolder(), std::make_unique<ContentBucketSpace>());
+ _map.emplace(BucketSpace::placeHolder(), std::make_unique<ContentBucketSpace>(BucketSpace::placeHolder()));
}
ContentBucketSpace &