diff options
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"/> |