summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorCarl C. Trieloff <cctrieloff@apache.org>2008-09-17 18:19:59 +0000
committerCarl C. Trieloff <cctrieloff@apache.org>2008-09-17 18:19:59 +0000
commitfcc3335293a77c8e9130ea1836ee55872d6b28f5 (patch)
tree1dc861c72e6fc2d8e161b2f30954adc53cfb7c10 /cpp/src
parent2cddbb21d27d0e46f92fb1007fde08a19ed13deb (diff)
downloadqpid-python-fcc3335293a77c8e9130ea1836ee55872d6b28f5.tar.gz
- added member stats
- some celan up. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@696388 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/qpid/cluster/Cluster.cpp28
-rw-r--r--cpp/src/qpid/cluster/Cluster.h1
-rw-r--r--cpp/src/qpid/cluster/management-schema.xml3
3 files changed, 23 insertions, 9 deletions
diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp
index e47a649822..e64d80e214 100644
--- a/cpp/src/qpid/cluster/Cluster.cpp
+++ b/cpp/src/qpid/cluster/Cluster.cpp
@@ -87,7 +87,6 @@ Cluster::Cluster(const std::string& name_, const Url& url_, broker::Broker& b) :
mgmtObject = new _qmf::Cluster (agent, this, &broker,name.str(),url.str());
agent->addObject (mgmtObject);
mgmtObject->set_status("JOINING");
- mgmtObject->set_clusterSize(1);
// if first cluster up set new UUID to set_clusterID() else set UUID of cluster being joined.
}
@@ -275,6 +274,7 @@ void Cluster::configChange(
map.add(self, url);
ready();
}
+ updateMemberStats();
return;
}
@@ -285,13 +285,7 @@ void Cluster::configChange(
mcastControl(map.toControl(), 0);
//update mgnt stats
- if (mgmtObject!=0){
- mgmtObject->set_clusterSize(size()+1); // cluster size is other nodes +me
- // copy urls to fieldtable ? how is the ftable packed?
- //::qpid::framing::FieldTable val;
- //std::vector<Url> vectUrl = getUrls();
- //mgmtObject->set_members(val);
- }
+ updateMemberStats();
}
void Cluster::update(const FieldTable& members, uint64_t dumper) {
@@ -406,4 +400,22 @@ void Cluster::stopFullCluster(void)
{
}
+void Cluster::updateMemberStats(void)
+{
+ //update mgnt stats
+ if (mgmtObject!=0){
+ mgmtObject->set_clusterSize(size());
+ std::vector<Url> vectUrl = getUrls();
+ string urlstr;
+ for(std::vector<Url>::iterator iter = vectUrl.begin(); iter != vectUrl.end(); iter++ ) {
+ if (iter != vectUrl.begin()) urlstr += ";";
+ urlstr += iter->str();
+ }
+ mgmtObject->set_members(urlstr);
+ }
+
+}
+
+
+
}} // namespace qpid::cluster
diff --git a/cpp/src/qpid/cluster/Cluster.h b/cpp/src/qpid/cluster/Cluster.h
index 982a9da2ca..847f179cc0 100644
--- a/cpp/src/qpid/cluster/Cluster.h
+++ b/cpp/src/qpid/cluster/Cluster.h
@@ -135,6 +135,7 @@ class Cluster : private Cpg::Handler, public management::Manageable
virtual management::Manageable::status_t ManagementMethod (uint32_t methodId, management::Args& args, std::string& text);
void stopClusterNode(void);
void stopFullCluster(void);
+ void updateMemberStats(void);
mutable sys::Monitor lock; // Protect access to members.
broker::Broker& broker;
diff --git a/cpp/src/qpid/cluster/management-schema.xml b/cpp/src/qpid/cluster/management-schema.xml
index f19aabb49b..0f30814367 100644
--- a/cpp/src/qpid/cluster/management-schema.xml
+++ b/cpp/src/qpid/cluster/management-schema.xml
@@ -44,7 +44,7 @@
<property name="publishedURL" type="sstr" access="RC" desc="URL this node advertizes itself as"/>
<property name="clusterSize" type="uint16" access="RO" desc="Number of brokers currently in the cluster"/>
<property name="status" type="sstr" access="RO" desc="Cluster node status (STALLED,ACTIVE,JOINING)"/>
- <property name="members" type="map" access="RO" desc="List of 'host:port' of member nodes in the cluster"/>
+ <property name="members" type="lstr" access="RO" desc="List of 'host:port' of member nodes in the cluster delimited by ';'"/>
<method name="stopClusterNode"/>
@@ -53,5 +53,6 @@
</class>
+
</schema>