diff options
Diffstat (limited to 'vdslib')
-rw-r--r-- | vdslib/src/vespa/vdslib/state/cluster_state_bundle.cpp | 9 | ||||
-rw-r--r-- | vdslib/src/vespa/vdslib/state/cluster_state_bundle.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/vdslib/src/vespa/vdslib/state/cluster_state_bundle.cpp b/vdslib/src/vespa/vdslib/state/cluster_state_bundle.cpp index 68a279f04f8..ff633c02fad 100644 --- a/vdslib/src/vespa/vdslib/state/cluster_state_bundle.cpp +++ b/vdslib/src/vespa/vdslib/state/cluster_state_bundle.cpp @@ -4,6 +4,7 @@ #include "cluster_state_bundle.h" #include "clusterstate.h" #include <iostream> +#include <sstream> namespace storage::lib { @@ -78,6 +79,14 @@ ClusterStateBundle::operator==(const ClusterStateBundle &rhs) const return true; } +std::string +ClusterStateBundle::toString() const +{ + std::ostringstream os; + os << *this; + return os.str(); +} + std::ostream& operator<<(std::ostream& os, const ClusterStateBundle& bundle) { os << "ClusterStateBundle('" << *bundle.getBaselineClusterState(); if (!bundle.getDerivedClusterStates().empty()) { diff --git a/vdslib/src/vespa/vdslib/state/cluster_state_bundle.h b/vdslib/src/vespa/vdslib/state/cluster_state_bundle.h index a9e84225c1f..d0b052766ff 100644 --- a/vdslib/src/vespa/vdslib/state/cluster_state_bundle.h +++ b/vdslib/src/vespa/vdslib/state/cluster_state_bundle.h @@ -5,6 +5,7 @@ #include <vespa/document/bucket/bucketspace.h> #include <unordered_map> #include <iosfwd> +#include <string> namespace storage::lib { @@ -40,6 +41,7 @@ public: } uint32_t getVersion() const; bool deferredActivation() const noexcept { return _deferredActivation; } + std::string toString() const; bool operator==(const ClusterStateBundle &rhs) const; bool operator!=(const ClusterStateBundle &rhs) const { return !operator==(rhs); } }; |