You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by cc...@apache.org on 2008/09/17 20:19:59 UTC

svn commit: r696388 - in /incubator/qpid/trunk/qpid/cpp/src/qpid/cluster: Cluster.cpp Cluster.h management-schema.xml

Author: cctrieloff
Date: Wed Sep 17 11:19:59 2008
New Revision: 696388

URL: http://svn.apache.org/viewvc?rev=696388&view=rev
Log:
- added member stats
- some celan up.


Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.h
    incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/management-schema.xml

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp?rev=696388&r1=696387&r2=696388&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp Wed Sep 17 11:19:59 2008
@@ -87,7 +87,6 @@
         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 @@
             map.add(self, url);
             ready();
         }
+	    updateMemberStats();
         return;                 
     }
 
@@ -285,13 +285,7 @@
         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::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

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.h?rev=696388&r1=696387&r2=696388&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.h Wed Sep 17 11:19:59 2008
@@ -135,6 +135,7 @@
     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;

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/management-schema.xml
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/management-schema.xml?rev=696388&r1=696387&r2=696388&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/management-schema.xml (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/management-schema.xml Wed Sep 17 11:19:59 2008
@@ -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>