diff options
author | Alan Conway <aconway@apache.org> | 2008-09-26 21:49:52 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-09-26 21:49:52 +0000 |
commit | 47b7d230566810cd84446859b63885329186e943 (patch) | |
tree | 121e22b2c8c84f27dee0c2b5aff6542075ea99a8 /cpp/src/qpid/cluster/DumpClient.cpp | |
parent | 41b2637e20345f264cff40be2885729c315e5828 (diff) | |
download | qpid-python-47b7d230566810cd84446859b63885329186e943.tar.gz |
Clean up end-of-dump protocol for new cluster members.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@699513 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/DumpClient.cpp')
-rw-r--r-- | cpp/src/qpid/cluster/DumpClient.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/cpp/src/qpid/cluster/DumpClient.cpp b/cpp/src/qpid/cluster/DumpClient.cpp index d2d3c9bb15..59542a2e95 100644 --- a/cpp/src/qpid/cluster/DumpClient.cpp +++ b/cpp/src/qpid/cluster/DumpClient.cpp @@ -59,6 +59,12 @@ using namespace framing; namespace arg=client::arg; using client::SessionBase_0_10Access; +struct ClusterConnectionProxy : public AMQP_AllProxy::ClusterConnection { + ClusterConnectionProxy(client::Connection& c) : + AMQP_AllProxy::ClusterConnection(*client::ConnectionAccess::getImpl(c)) {} +}; + + // Create a connection with special version that marks it as a catch-up connection. client::Connection catchUpConnection() { client::Connection c; @@ -101,7 +107,7 @@ void DumpClient::dump() { session.sync(); session.close(); donor.eachConnection(boost::bind(&DumpClient::dumpConnection, this, _1)); - // FIXME aconway 2008-09-18: inidicate successful end-of-dump. + ClusterConnectionProxy(connection).dumpComplete(); connection.close(); QPID_LOG(debug, donor.getSelf() << " dumped all state to " << receiver); } @@ -160,10 +166,9 @@ void DumpClient::dumpConnection(const boost::intrusive_ptr<Connection>& dumpConn // authentication etc. See ConnectionSettings. shadowConnection.open(receiver, bc.getUserId()); dumpConnection->getBrokerConnection().eachSessionHandler(boost::bind(&DumpClient::dumpSession, this, _1)); - boost::shared_ptr<client::ConnectionImpl> impl = client::ConnectionAccess::getImpl(shadowConnection); - AMQP_AllProxy::ClusterConnection proxy(*impl); - proxy.shadowReady(dumpConnection->getId().getMember(), - reinterpret_cast<uint64_t>(dumpConnection->getId().getConnectionPtr())); + ClusterConnectionProxy(shadowConnection).shadowReady( + dumpConnection->getId().getMember(), + reinterpret_cast<uint64_t>(dumpConnection->getId().getConnectionPtr())); shadowConnection.close(); QPID_LOG(debug, donor.getId() << " dumped connection " << *dumpConnection); } |