summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/Cluster.cpp
diff options
context:
space:
mode:
authorCarl C. Trieloff <cctrieloff@apache.org>2008-09-30 14:57:32 +0000
committerCarl C. Trieloff <cctrieloff@apache.org>2008-09-30 14:57:32 +0000
commitee83554e46565e532595b72ffcec70a257576d0c (patch)
tree0fc133a8e3377049c52f163650c476659de2b44f /cpp/src/qpid/cluster/Cluster.cpp
parent94cbf28380264c1da0b24fee44dd51e1acbf9058 (diff)
downloadqpid-python-ee83554e46565e532595b72ffcec70a257576d0c.tar.gz
QPID-1306
This patch includes: - Optimistic Consume - Support for forcing Queue durable on cluster failure - Some cleanup on mgnt functions in Queue to inlines - Tests Still coming - header for client queue options - LVQ support bits. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@700489 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/Cluster.cpp')
-rw-r--r--cpp/src/qpid/cluster/Cluster.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp
index 7feee4ce14..b48443526c 100644
--- a/cpp/src/qpid/cluster/Cluster.cpp
+++ b/cpp/src/qpid/cluster/Cluster.cpp
@@ -22,6 +22,7 @@
#include "qpid/broker/Broker.h"
#include "qpid/broker/SessionState.h"
#include "qpid/broker/Connection.h"
+#include "qpid/broker/QueueRegistry.h"
#include "qpid/framing/AMQFrame.h"
#include "qpid/framing/ClusterDumpRequestBody.h"
#include "qpid/framing/ClusterUpdateBody.h"
@@ -71,7 +72,8 @@ Cluster::Cluster(const std::string& name_, const Url& url_, broker::Broker& b) :
handler(&joiningHandler),
joiningHandler(*this),
memberHandler(*this),
- mcastId()
+ mcastId(),
+ lastSize(1)
{
ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
if (agent != 0){
@@ -332,7 +334,17 @@ void Cluster::stopFullCluster(void) {
void Cluster::updateMemberStats() {
if (mgmtObject) {
- mgmtObject->set_clusterSize(size());
+ if (lastSize != size() && size() ==1){
+ QPID_LOG(info, "Last node standing, updating queue policies, size:" <<size());
+ broker.getQueues().updateQueueClusterState(true);
+ lastSize = size();
+ }else if (lastSize != size() && size() > 1) {
+ QPID_LOG(info, "Recover back from last node standing, updating queue policies, size:" <<size());
+ broker.getQueues().updateQueueClusterState(false);
+ lastSize = size();
+ }
+
+ mgmtObject->set_clusterSize(size());
std::vector<Url> vectUrl = getUrls();
string urlstr;
for(std::vector<Url>::iterator iter = vectUrl.begin(); iter != vectUrl.end(); iter++ ) {