diff options
| author | Alan Conway <aconway@apache.org> | 2008-09-10 18:15:25 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-09-10 18:15:25 +0000 |
| commit | 0b778c328001d25b3118450c0bfabb3e0b918971 (patch) | |
| tree | f9f385408887017cf0499a837a0a46a82b0ce965 /cpp/src/qpid/cluster/Cluster.cpp | |
| parent | 71652d22061dd8de9c504c5d670bb15e858e5297 (diff) | |
| download | qpid-python-0b778c328001d25b3118450c0bfabb3e0b918971.tar.gz | |
Cluster support for copying shared broker state to new members.
cluster/DumpClient: Copies broker shared state to a new broker via AMQP.
broker/*Registry, Queue, QueueBindings: Added iteration functions for DumpClient
broker/SemanticState.cpp: Allow DumpClient to sidestep setting of delivery-properties.exchange.
client/Connection.h: Added Connection::open(Url) overload.
client/SessionImpl: Added send(AMQBody, FrameSet) overload for forwarding broker messages.
tests/cluster_test.cpp: Added test for DumpClient copying shared state between brokers.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@693918 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/Cluster.cpp')
| -rw-r--r-- | cpp/src/qpid/cluster/Cluster.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp index 4c0a768c4f..ce156e85e4 100644 --- a/cpp/src/qpid/cluster/Cluster.cpp +++ b/cpp/src/qpid/cluster/Cluster.cpp @@ -25,7 +25,7 @@ #include "qpid/framing/AMQFrame.h" #include "qpid/framing/AMQP_AllOperations.h" #include "qpid/framing/AllInvoker.h" -#include "qpid/framing/ClusterUrlNoticeBody.h" +#include "qpid/framing/ClusterJoiningBody.h" #include "qpid/framing/ClusterConnectionDeliverCloseBody.h" #include "qpid/framing/ClusterConnectionDeliverDoOutputBody.h" #include "qpid/log/Statement.h" @@ -50,7 +50,13 @@ struct ClusterOperations : public AMQP_AllOperations::ClusterHandler { Cluster& cluster; MemberId member; ClusterOperations(Cluster& c, const MemberId& id) : cluster(c), member(id) {} - void urlNotice(const std::string& u) { cluster.urlNotice (member, u); } + void joining(const std::string& u) { cluster.joining (member, u); } + void ready() { cluster.ready(member); } + + void members(const framing::FieldTable& , const framing::FieldTable& , const framing::FieldTable& ) { + assert(0); // Not passed to cluster, used to start a brain dump over TCP. + } + bool invoke(AMQFrame& f) { return framing::invoke(*this, *f.getBody()).wasHandled(); } }; @@ -237,7 +243,7 @@ void Cluster::configChange( if (nJoined) // Notfiy new members of my URL. mcastFrame( - AMQFrame(in_place<ClusterUrlNoticeBody>(ProtocolVersion(), url.str())), + AMQFrame(in_place<ClusterJoiningBody>(ProtocolVersion(), url.str())), ConnectionId(self,0)); @@ -261,11 +267,15 @@ void Cluster::disconnect(sys::DispatchHandle& h) { broker->shutdown(); } -void Cluster::urlNotice(const MemberId& m, const string& url) { +void Cluster::joining(const MemberId& m, const string& url) { QPID_LOG(notice, "Cluster member " << m << " has URL " << url); urls.insert(UrlMap::value_type(m,Url(url))); } +void Cluster::ready(const MemberId& ) { + // FIXME aconway 2008-09-08: TODO +} + }} // namespace qpid::cluster |
