// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include #include #include namespace storage { namespace lib { class ClusterState; class Distribution; } /** * Class representing a bucket space (with associated bucket database) on a content node. */ class ContentBucketSpace { private: document::BucketSpace _bucketSpace; StorBucketDatabase _bucketDatabase; mutable std::mutex _lock; std::shared_ptr _clusterState; std::shared_ptr _distribution; bool _nodeUpInLastNodeStateSeenByProvider; bool _nodeMaintenanceInLastNodeStateSeenByProvider; public: using UP = std::unique_ptr; explicit ContentBucketSpace(document::BucketSpace bucketSpace, const ContentBucketDbOptions& db_opts); document::BucketSpace bucketSpace() const noexcept { return _bucketSpace; } StorBucketDatabase &bucketDatabase() { return _bucketDatabase; } void setClusterState(std::shared_ptr clusterState); std::shared_ptr getClusterState() const; void setDistribution(std::shared_ptr distribution); std::shared_ptr getDistribution() const; bool getNodeUpInLastNodeStateSeenByProvider() const; void setNodeUpInLastNodeStateSeenByProvider(bool nodeUpInLastNodeStateSeenByProvider); bool getNodeMaintenanceInLastNodeStateSeenByProvider() const; void setNodeMaintenanceInLastNodeStateSeenByProvider(bool nodeMaintenanceInLastNodeStateSeenByProvider); }; }