diff options
| author | Alan Conway <aconway@apache.org> | 2009-11-26 15:56:46 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2009-11-26 15:56:46 +0000 |
| commit | c96cb4fa4232b035309ebfc4586a54c0be8fe762 (patch) | |
| tree | c846e6d28bd61dba335df166be9a914c4037112d /cpp/src/qpid/cluster/StoreStatus.cpp | |
| parent | c61e76daedbf2d0dc709d5e49003a930d161a500 (diff) | |
| download | qpid-python-c96cb4fa4232b035309ebfc4586a54c0be8fe762.tar.gz | |
Cluster consistency: check for no clean store condition.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@884612 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/StoreStatus.cpp')
| -rw-r--r-- | cpp/src/qpid/cluster/StoreStatus.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/cpp/src/qpid/cluster/StoreStatus.cpp b/cpp/src/qpid/cluster/StoreStatus.cpp index a7da3baa50..72e4891566 100644 --- a/cpp/src/qpid/cluster/StoreStatus.cpp +++ b/cpp/src/qpid/cluster/StoreStatus.cpp @@ -31,6 +31,7 @@ namespace cluster { using framing::Uuid; using namespace framing::cluster; using namespace boost::filesystem; +using std::ostream; StoreStatus::StoreStatus(const std::string& d) : state(STORE_STATE_NO_STORE), dataDir(d) @@ -90,5 +91,20 @@ void StoreStatus::clean(const Uuid& shutdownId_) { save(); } +ostream& operator<<(ostream& o, const StoreStatus& s) { + switch (s.getState()) { + case STORE_STATE_NO_STORE: o << "no store"; break; + case STORE_STATE_EMPTY_STORE: o << "empty store"; break; + case STORE_STATE_DIRTY_STORE: + o << "dirty store, cluster-id=" << s.getClusterId(); + break; + case STORE_STATE_CLEAN_STORE: + o << "clean store, cluster-id=" << s.getClusterId() + << " shutdown-id=" << s.getShutdownId(); + break; + } + return o; +} + }} // namespace qpid::cluster |
