diff options
author | Carl C. Trieloff <cctrieloff@apache.org> | 2008-09-17 00:48:07 +0000 |
---|---|---|
committer | Carl C. Trieloff <cctrieloff@apache.org> | 2008-09-17 00:48:07 +0000 |
commit | 33c0cf0aa2e43f11b23ff722c079e2a704750dc5 (patch) | |
tree | c00ffeac77c78acc0513fd9cdf878ca811e71506 /cpp/src | |
parent | f32d1e57c32da1d6a166ec15b7d48222d2942e72 (diff) | |
download | qpid-python-33c0cf0aa2e43f11b23ff722c079e2a704750dc5.tar.gz |
- wire in more cluster stats
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@696115 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/cluster/Cluster.cpp | 16 | ||||
-rw-r--r-- | cpp/src/qpid/cluster/management-schema.xml | 2 |
2 files changed, 16 insertions, 2 deletions
diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp index 73b11cf124..e47a649822 100644 --- a/cpp/src/qpid/cluster/Cluster.cpp +++ b/cpp/src/qpid/cluster/Cluster.cpp @@ -84,9 +84,10 @@ Cluster::Cluster(const std::string& name_, const Url& url_, broker::Broker& b) : 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 @@ void Cluster::configChange( 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 @@ void Cluster::stall() { // 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 @@ void Cluster::ready() { 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 diff --git a/cpp/src/qpid/cluster/management-schema.xml b/cpp/src/qpid/cluster/management-schema.xml index 1919bb7976..f19aabb49b 100644 --- a/cpp/src/qpid/cluster/management-schema.xml +++ b/cpp/src/qpid/cluster/management-schema.xml @@ -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"/> |