summaryrefslogtreecommitdiffstats
path: root/persistence/src/vespa/persistence/spi/clusterstate.h
diff options
context:
space:
mode:
Diffstat (limited to 'persistence/src/vespa/persistence/spi/clusterstate.h')
-rw-r--r--persistence/src/vespa/persistence/spi/clusterstate.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/persistence/src/vespa/persistence/spi/clusterstate.h b/persistence/src/vespa/persistence/spi/clusterstate.h
index df556d09cb7..bde7e5bdbf4 100644
--- a/persistence/src/vespa/persistence/spi/clusterstate.h
+++ b/persistence/src/vespa/persistence/spi/clusterstate.h
@@ -23,9 +23,9 @@ public:
ClusterState(const lib::ClusterState& state,
uint16_t nodeIndex,
- const lib::Distribution& distribution);
+ const lib::Distribution& distribution,
+ bool maintenanceInAllSpaces = false);
- ClusterState(vespalib::nbostream& i);
ClusterState(const ClusterState& other);
ClusterState& operator=(const ClusterState& other) = delete;
~ClusterState();
@@ -45,28 +45,32 @@ public:
* compared to the complete list of nodes, and deigns the system to be
* unusable.
*/
- bool clusterUp() const noexcept;
+ [[nodiscard]] bool clusterUp() const noexcept;
/**
* Returns false if this node has been set in a state where it should not
* receive external load.
+ *
+ * TODO rename to indicate bucket space affinity.
*/
- bool nodeUp() const noexcept;
+ [[nodiscard]] bool nodeUp() const noexcept;
/**
* Returns true iff this node is marked as Initializing in the cluster state.
+ *
+ * TODO remove, init no longer used internally.
*/
- bool nodeInitializing() const noexcept;
+ [[nodiscard]] bool nodeInitializing() const noexcept;
/**
* Returns true iff this node is marked as Retired in the cluster state.
*/
- bool nodeRetired() const noexcept;
+ [[nodiscard]] bool nodeRetired() const noexcept;
/**
- * Returns true iff this node is marked as Maintenance in the cluster state.
+ * Returns true iff this node is marked as Maintenance in all bucket space cluster states.
*/
- bool nodeMaintenance() const noexcept;
+ [[nodiscard]] bool nodeMaintenance() const noexcept;
/**
* Returns a serialized form of this object.
@@ -77,6 +81,7 @@ private:
std::unique_ptr<lib::ClusterState> _state;
std::unique_ptr<lib::Distribution> _distribution;
uint16_t _nodeIndex;
+ bool _maintenanceInAllSpaces;
void deserialize(vespalib::nbostream&);
bool nodeHasStateOneOf(const char* states) const noexcept;