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 02:48:07 UTC
svn commit: r696115 - in /incubator/qpid/trunk/qpid/cpp/src/qpid/cluster:
Cluster.cpp management-schema.xml
Author: cctrieloff
Date: Tue Sep 16 17:48:07 2008
New Revision: 696115
URL: http://svn.apache.org/viewvc?rev=696115&view=rev
Log:
- wire in more cluster stats
Modified:
incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp
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=696115&r1=696114&r2=696115&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/cluster/Cluster.cpp Tue Sep 16 17:48:07 2008
@@ -84,9 +84,10 @@
ManagementAgent* agent = ManagementAgent::Singleton::getInstance();
if (agent != 0){
_qmf::Package packageInit(agent);
- mgmtObject = new _qmf::Cluster (agent, this, &broker,name.str());
+ 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.
}
@@ -282,6 +283,15 @@
if (nJoined && map.sendUpdate(self)) // New members need update
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);
+ }
}
void Cluster::update(const FieldTable& members, uint64_t dumper) {
@@ -337,6 +347,8 @@
// FIXME aconway 2008-09-11: Flow control, we should slow down or
// stop reading from local connections while stalled to avoid an
// unbounded queue.
+ if (mgmtObject!=0)
+ mgmtObject->set_status("STALLED");
}
void Cluster::ready() {
@@ -345,6 +357,8 @@
state = READY;
connectionEventQueue.start(poller);
// FIXME aconway 2008-09-15: stall/unstall map?
+ if (mgmtObject!=0)
+ mgmtObject->set_status("ACTIVE");
}
// Called from Broker::~Broker when broker is shut down. At this
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=696115&r1=696114&r2=696115&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 Tue Sep 16 17:48:07 2008
@@ -41,7 +41,7 @@
<property name="brokerRef" type="objId" references="Broker" access="RC" index="y" parentRef="y"/>
<property name="clusterName" type="sstr" access="RC" desc="Name of cluster this server is a member of"/>
<property name="clusterID" type="sstr" access="RO" desc="Globally uniquie ID (UUID) for this cluster instance"/>
- <property name="publishedURL" type="sstr" access="RO" desc="URL this node advertizes itself as"/>
+ <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"/>