diff options
author | Gordon Sim <gsim@apache.org> | 2009-01-22 22:53:50 +0000 |
---|---|---|
committer | Gordon Sim <gsim@apache.org> | 2009-01-22 22:53:50 +0000 |
commit | d7ce27f7cc96894f149e5c20c03b306b80636727 (patch) | |
tree | 22caa566993da19f9e211f69fdca64c13f1f04e6 /cpp/src/qpid/cluster/ClusterMap.cpp | |
parent | 74481dd2b6b97374bd4f260ca89d9103ce6383ed (diff) | |
download | qpid-python-d7ce27f7cc96894f149e5c20c03b306b80636727.tar.gz |
QPID-1567: More changes to make clustering and federation work together
* replicate outgoing link traffic to all nodes
* coordinate amongst nodes so that only one node actually maintains active links
with the others able to take over if that node fails
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@736841 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/ClusterMap.cpp')
-rw-r--r-- | cpp/src/qpid/cluster/ClusterMap.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cpp/src/qpid/cluster/ClusterMap.cpp b/cpp/src/qpid/cluster/ClusterMap.cpp index 873f0be928..cc9ea29093 100644 --- a/cpp/src/qpid/cluster/ClusterMap.cpp +++ b/cpp/src/qpid/cluster/ClusterMap.cpp @@ -114,6 +114,10 @@ std::vector<Url> ClusterMap::memberUrls() const { return urls; } +ClusterMap::Set ClusterMap::getAlive() const { + return alive; +} + std::ostream& operator<<(std::ostream& o, const ClusterMap::Map& m) { std::ostream_iterator<MemberId> oi(o); std::transform(m.begin(), m.end(), oi, boost::bind(&ClusterMap::Map::value_type::first, _1)); @@ -170,4 +174,13 @@ boost::optional<Url> ClusterMap::dumpOffer(const MemberId& from, const MemberId& return boost::optional<Url>(); } +ClusterMap::Set ClusterMap::intersection(const ClusterMap::Set& a, const ClusterMap::Set& b) +{ + Set intersection; + std::set_intersection(a.begin(), a.end(), + b.begin(), b.end(), + std::inserter(intersection, intersection.begin())); + return intersection; + +} }} // namespace qpid::cluster |