qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r1075381 - in /qpid/trunk/qpid/cpp: src/qpid/broker/Queue.cpp src/qpid/broker/Queue.h src/qpid/broker/RecoveryManagerImpl.cpp src/qpid/cluster/Connection.cpp src/qpid/cluster/Connection.h xml/cluster.xml
Date Mon, 28 Feb 2011 15:36:22 GMT
Author: gsim
Date: Mon Feb 28 15:36:21 2011
New Revision: 1075381

URL: http://svn.apache.org/viewvc?rev=1075381&view=rev
Log:
NO-JIRA: remove some dead code, rename internal method for clarity

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
    qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h
    qpid/trunk/qpid/cpp/src/qpid/broker/RecoveryManagerImpl.cpp
    qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp
    qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.h
    qpid/trunk/qpid/cpp/xml/cluster.xml

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp?rev=1075381&r1=1075380&r2=1075381&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp Mon Feb 28 15:36:21 2011
@@ -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<Exchange> alternate;
-    std::pair<Queue::shared_ptr, bool> result = queues.declare(name, true, false, 0,
alternate, settings, recovering);
+    std::pair<Queue::shared_ptr, bool> 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) );
     }

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h?rev=1075381&r1=1075380&r2=1075381&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h Mon Feb 28 15:36:21 2011
@@ -321,8 +321,13 @@ class Queue : public boost::enable_share
     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);

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/RecoveryManagerImpl.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/RecoveryManagerImpl.cpp?rev=1075381&r1=1075380&r2=1075381&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/RecoveryManagerImpl.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/RecoveryManagerImpl.cpp Mon Feb 28 15:36:21 2011
@@ -113,7 +113,7 @@ RecoverableExchange::shared_ptr Recovery
 
 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) {

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp?rev=1075381&r1=1075380&r2=1075381&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.cpp Mon Feb 28 15:36:21 2011
@@ -614,12 +614,6 @@ void Connection::exchange(const std::str
     QPID_LOG(debug, cluster << " updated exchange " << ex->getName());
 }
 
-void Connection::queue(const std::string& encoded) {
-    Buffer buf(const_cast<char*>(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())

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.h?rev=1075381&r1=1075380&r2=1075381&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.h Mon Feb 28 15:36:21 2011
@@ -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);

Modified: qpid/trunk/qpid/cpp/xml/cluster.xml
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/xml/cluster.xml?rev=1075381&r1=1075380&r2=1075381&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/xml/cluster.xml (original)
+++ qpid/trunk/qpid/cpp/xml/cluster.xml Mon Feb 28 15:36:21 2011
@@ -252,7 +252,6 @@
 
     <!-- Replicate encoded exchanges/queues. -->
     <control name="exchange" code="0x31"><field name="encoded" type="str32"/></control>
-    <control name="queue" code="0x32"><field name="encoded" type="str32"/></control>
 
     <!-- Set expiry-id for subsequent messages. -->
     <control name="expiry-id" code="0x33"><field name="expiry-id" type="uint64"/></control>



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message