aboutsummaryrefslogtreecommitdiffstats
path: root/storage/src/vespa/storage/distributor/bucket_space_state_map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'storage/src/vespa/storage/distributor/bucket_space_state_map.cpp')
-rw-r--r--storage/src/vespa/storage/distributor/bucket_space_state_map.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/storage/src/vespa/storage/distributor/bucket_space_state_map.cpp b/storage/src/vespa/storage/distributor/bucket_space_state_map.cpp
index 63c408f7e1e..54c6f887a8b 100644
--- a/storage/src/vespa/storage/distributor/bucket_space_state_map.cpp
+++ b/storage/src/vespa/storage/distributor/bucket_space_state_map.cpp
@@ -32,6 +32,22 @@ BucketSpaceStateMap::BucketSpaceStateMap()
_map.emplace(document::FixedBucketSpaces::global_space(), std::make_unique<BucketSpaceState>());
}
+const BucketSpaceState&
+BucketSpaceStateMap::get(document::BucketSpace space) const
+{
+ auto itr = _map.find(space);
+ assert(itr != _map.end());
+ return *itr->second;
+}
+
+BucketSpaceState&
+BucketSpaceStateMap::get(document::BucketSpace space)
+{
+ auto itr = _map.find(space);
+ assert(itr != _map.end());
+ return *itr->second;
+}
+
void
BucketSpaceStateMap::set_cluster_state(std::shared_ptr<const lib::ClusterState> cluster_state)
{