From 778c3d4060448014eccb72169c0b281c13f276d2 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Mon, 28 Feb 2011 15:36:21 +0000 Subject: NO-JIRA: remove some dead code, rename internal method for clarity git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1075381 13f79535-47bb-0310-9956-ffa450edef68 --- qpid/cpp/src/qpid/broker/Queue.cpp | 4 ++-- qpid/cpp/src/qpid/broker/Queue.h | 9 +++++++-- qpid/cpp/src/qpid/broker/RecoveryManagerImpl.cpp | 2 +- qpid/cpp/src/qpid/cluster/Connection.cpp | 6 ------ qpid/cpp/src/qpid/cluster/Connection.h | 3 +-- qpid/cpp/xml/cluster.xml | 1 - 6 files changed, 11 insertions(+), 14 deletions(-) diff --git a/qpid/cpp/src/qpid/broker/Queue.cpp b/qpid/cpp/src/qpid/broker/Queue.cpp index 09b8256b54..edae8dc24f 100644 --- a/qpid/cpp/src/qpid/broker/Queue.cpp +++ b/qpid/cpp/src/qpid/broker/Queue.cpp @@ -917,14 +917,14 @@ uint32_t Queue::encodedSize() const + (policy.get() ? (*policy).encodedSize() : 0); } -Queue::shared_ptr Queue::decode ( QueueRegistry& queues, Buffer& buffer, bool recovering ) +Queue::shared_ptr Queue::restore( QueueRegistry& queues, Buffer& buffer ) { string name; buffer.getShortString(name); FieldTable settings; buffer.get(settings); boost::shared_ptr alternate; - std::pair result = queues.declare(name, true, false, 0, alternate, settings, recovering); + std::pair result = queues.declare(name, true, false, 0, alternate, settings, true); if (result.first->policy.get() && buffer.available() >= result.first->policy->encodedSize()) { buffer.get ( *(result.first->policy) ); } diff --git a/qpid/cpp/src/qpid/broker/Queue.h b/qpid/cpp/src/qpid/broker/Queue.h index 7597ec74ce..e58789e44b 100644 --- a/qpid/cpp/src/qpid/broker/Queue.h +++ b/qpid/cpp/src/qpid/broker/Queue.h @@ -321,8 +321,13 @@ class Queue : public boost::enable_shared_from_this, void encode(framing::Buffer& buffer) const; uint32_t encodedSize() const; - // "recovering" means we are doing a MessageStore recovery. - static Queue::shared_ptr decode(QueueRegistry& queues, framing::Buffer& buffer, bool recovering = false ); + /** + * Restores a queue from encoded data (used in recovery) + * + * Note: restored queue will be neither auto-deleted or have an + * exclusive owner + */ + static Queue::shared_ptr restore(QueueRegistry& queues, framing::Buffer& buffer); static void tryAutoDelete(Broker& broker, Queue::shared_ptr); virtual void setExternalQueueStore(ExternalQueueStore* inst); diff --git a/qpid/cpp/src/qpid/broker/RecoveryManagerImpl.cpp b/qpid/cpp/src/qpid/broker/RecoveryManagerImpl.cpp index 2f04943581..6f8b125b8b 100644 --- a/qpid/cpp/src/qpid/broker/RecoveryManagerImpl.cpp +++ b/qpid/cpp/src/qpid/broker/RecoveryManagerImpl.cpp @@ -113,7 +113,7 @@ RecoverableExchange::shared_ptr RecoveryManagerImpl::recoverExchange(framing::Bu RecoverableQueue::shared_ptr RecoveryManagerImpl::recoverQueue(framing::Buffer& buffer) { - Queue::shared_ptr queue = Queue::decode(queues, buffer, true); + Queue::shared_ptr queue = Queue::restore(queues, buffer); try { Exchange::shared_ptr exchange = exchanges.getDefault(); if (exchange) { diff --git a/qpid/cpp/src/qpid/cluster/Connection.cpp b/qpid/cpp/src/qpid/cluster/Connection.cpp index 2532adab84..c1304c2b75 100644 --- a/qpid/cpp/src/qpid/cluster/Connection.cpp +++ b/qpid/cpp/src/qpid/cluster/Connection.cpp @@ -614,12 +614,6 @@ void Connection::exchange(const std::string& encoded) { QPID_LOG(debug, cluster << " updated exchange " << ex->getName()); } -void Connection::queue(const std::string& encoded) { - Buffer buf(const_cast(encoded.data()), encoded.size()); - broker::Queue::shared_ptr q = broker::Queue::decode(cluster.getBroker().getQueues(), buf); - QPID_LOG(debug, cluster << " updated queue " << q->getName()); -} - void Connection::sessionError(uint16_t , const std::string& msg) { // Ignore errors before isOpen(), we're not multicasting yet. if (connection->isOpen()) diff --git a/qpid/cpp/src/qpid/cluster/Connection.h b/qpid/cpp/src/qpid/cluster/Connection.h index b96fa73072..8a9891deb6 100644 --- a/qpid/cpp/src/qpid/cluster/Connection.h +++ b/qpid/cpp/src/qpid/cluster/Connection.h @@ -163,8 +163,7 @@ class Connection : void txEnd(); void accumulatedAck(const framing::SequenceSet&); - // Encoded queue/exchange replication. - void queue(const std::string& encoded); + // Encoded exchange replication. void exchange(const std::string& encoded); void giveReadCredit(int credit); diff --git a/qpid/cpp/xml/cluster.xml b/qpid/cpp/xml/cluster.xml index be1c1f868c..24883c5e9a 100644 --- a/qpid/cpp/xml/cluster.xml +++ b/qpid/cpp/xml/cluster.xml @@ -252,7 +252,6 @@ - -- cgit v1.2.1