diff options
Diffstat (limited to 'cpp/src/qpid/cluster/Cluster.cpp')
-rw-r--r-- | cpp/src/qpid/cluster/Cluster.cpp | 28 |
1 files changed, 20 insertions, 8 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 |