You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kg...@apache.org on 2011/10/04 20:58:07 UTC

svn commit: r1178904 - in /qpid/branches/qpid-3346/qpid/cpp/src: ./ qpid/broker/

Author: kgiusti
Date: Tue Oct  4 18:58:06 2011
New Revision: 1178904

URL: http://svn.apache.org/viewvc?rev=1178904&view=rev
Log:
QPID-3346: rename MessageAllocator to MessageDistributor

Added:
    qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/FifoDistributor.cpp
      - copied, changed from r1178419, qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/FifoAllocator.cpp
    qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/FifoDistributor.h
      - copied, changed from r1178419, qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/FifoAllocator.h
    qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/MessageDistributor.h
      - copied, changed from r1178419, qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/MessageAllocator.h
Removed:
    qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/FifoAllocator.cpp
    qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/FifoAllocator.h
    qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/MessageAllocator.h
Modified:
    qpid/branches/qpid-3346/qpid/cpp/src/CMakeLists.txt
    qpid/branches/qpid-3346/qpid/cpp/src/Makefile.am
    qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/MessageGroupManager.h
    qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/Queue.cpp
    qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/Queue.h

Modified: qpid/branches/qpid-3346/qpid/cpp/src/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/CMakeLists.txt?rev=1178904&r1=1178903&r2=1178904&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/CMakeLists.txt (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/CMakeLists.txt Tue Oct  4 18:58:06 2011
@@ -975,7 +975,7 @@ set (qpidbroker_SOURCES
      qpid/broker/Queue.cpp
      qpid/broker/QueueCleaner.cpp
      qpid/broker/QueueListeners.cpp
-     qpid/broker/FifoAllocator.cpp
+     qpid/broker/FifoDistributor.cpp
      qpid/broker/MessageGroupManager.cpp
      qpid/broker/PersistableMessage.cpp
      qpid/broker/Bridge.cpp

Modified: qpid/branches/qpid-3346/qpid/cpp/src/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/Makefile.am?rev=1178904&r1=1178903&r2=1178904&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/Makefile.am (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/Makefile.am Tue Oct  4 18:58:06 2011
@@ -671,9 +671,9 @@ libqpidbroker_la_SOURCES = \
   qpid/broker/TxPublish.h \
   qpid/broker/Vhost.cpp \
   qpid/broker/Vhost.h \
-  qpid/broker/MessageAllocator.h \
-  qpid/broker/FifoAllocator.h \
-  qpid/broker/FifoAllocator.cpp \
+  qpid/broker/MessageDistributor.h \
+  qpid/broker/FifoDistributor.h \
+  qpid/broker/FifoDistributor.cpp \
   qpid/broker/MessageGroupManager.cpp \
   qpid/broker/MessageGroupManager.h \
   qpid/management/ManagementAgent.cpp \

Copied: qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/FifoDistributor.cpp (from r1178419, qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/FifoAllocator.cpp)
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/FifoDistributor.cpp?p2=qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/FifoDistributor.cpp&p1=qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/FifoAllocator.cpp&r1=1178419&r2=1178904&rev=1178904&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/FifoAllocator.cpp (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/FifoDistributor.cpp Tue Oct  4 18:58:06 2011
@@ -21,14 +21,14 @@
 
 
 #include "qpid/broker/Queue.h"
-#include "qpid/broker/FifoAllocator.h"
+#include "qpid/broker/FifoDistributor.h"
 
 using namespace qpid::broker;
 
-FifoAllocator::FifoAllocator(Messages& container)
+FifoDistributor::FifoDistributor(Messages& container)
     : messages(container) {}
 
-bool FifoAllocator::nextConsumableMessage( Consumer::shared_ptr&, QueuedMessage& next )
+bool FifoDistributor::nextConsumableMessage( Consumer::shared_ptr&, QueuedMessage& next )
 {
     if (!messages.empty()) {
         next = messages.front();    // by default, consume oldest msg
@@ -37,21 +37,21 @@ bool FifoAllocator::nextConsumableMessag
     return false;
 }
 
-bool FifoAllocator::allocate(const std::string&, const QueuedMessage& )
+bool FifoDistributor::allocate(const std::string&, const QueuedMessage& )
 {
     // by default, all messages present on the queue may be allocated as they have yet to
     // be acquired.
     return true;
 }
 
-bool FifoAllocator::nextBrowsableMessage( Consumer::shared_ptr& c, QueuedMessage& next )
+bool FifoDistributor::nextBrowsableMessage( Consumer::shared_ptr& c, QueuedMessage& next )
 {
     if (!messages.empty() && messages.next(c->position, next))
         return true;
     return false;
 }
 
-void FifoAllocator::query(qpid::types::Variant::Map&) const
+void FifoDistributor::query(qpid::types::Variant::Map&) const
 {
     // nothing to see here....
 }

Copied: qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/FifoDistributor.h (from r1178419, qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/FifoAllocator.h)
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/FifoDistributor.h?p2=qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/FifoDistributor.h&p1=qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/FifoAllocator.h&r1=1178419&r2=1178904&rev=1178904&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/FifoAllocator.h (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/FifoDistributor.h Tue Oct  4 18:58:06 2011
@@ -1,5 +1,5 @@
-#ifndef _broker_FifoAllocator_h
-#define _broker_FifoAllocator_h
+#ifndef _broker_FifoDistributor_h
+#define _broker_FifoDistributor_h
 
 /*
  *
@@ -22,27 +22,27 @@
  *
  */
 
-/** Simple MessageAllocator for FIFO Queues - the HEAD message is always the next
+/** Simple MessageDistributor for FIFO Queues - the HEAD message is always the next
  * available message for consumption.
  */
 
-#include "qpid/broker/MessageAllocator.h"
+#include "qpid/broker/MessageDistributor.h"
 
 namespace qpid {
 namespace broker {
 
 class Messages;
 
-class FifoAllocator : public MessageAllocator
+class FifoDistributor : public MessageDistributor
 {
  public:
-    FifoAllocator(Messages& container);
+    FifoDistributor(Messages& container);
 
     /** Locking Note: all methods assume the caller is holding the Queue::messageLock
      * during the method call.
      */
 
-    /** MessageAllocator interface */
+    /** MessageDistributor interface */
 
     bool nextConsumableMessage( Consumer::shared_ptr& consumer, QueuedMessage& next );
     bool allocate(const std::string& consumer, const QueuedMessage& target);

Copied: qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/MessageDistributor.h (from r1178419, qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/MessageAllocator.h)
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/MessageDistributor.h?p2=qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/MessageDistributor.h&p1=qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/MessageAllocator.h&r1=1178419&r2=1178904&rev=1178904&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/MessageAllocator.h (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/MessageDistributor.h Tue Oct  4 18:58:06 2011
@@ -1,5 +1,5 @@
-#ifndef _broker_MessageAllocator_h
-#define _broker_MessageAllocator_h
+#ifndef _broker_MessageDistributor_h
+#define _broker_MessageDistributor_h
 
 /*
  *
@@ -34,10 +34,10 @@ namespace broker {
 
 struct QueuedMessage;
 
-class MessageAllocator
+class MessageDistributor
 {
  public:
-    virtual ~MessageAllocator() {};
+    virtual ~MessageDistributor() {};
 
     /** Locking Note: all methods assume the caller is holding the Queue::messageLock
      * during the method call.

Modified: qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/MessageGroupManager.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/MessageGroupManager.h?rev=1178904&r1=1178903&r2=1178904&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/MessageGroupManager.h (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/MessageGroupManager.h Tue Oct  4 18:58:06 2011
@@ -25,16 +25,16 @@
 /* for managing message grouping on Queues */
 
 #include "qpid/broker/StatefulQueueObserver.h"
-#include "qpid/broker/MessageAllocator.h"
+#include "qpid/broker/MessageDistributor.h"
 
 
 namespace qpid {
 namespace broker {
 
 class QueueObserver;
-class MessageAllocator;
+class MessageDistributor;
 
-class MessageGroupManager : public StatefulQueueObserver, public MessageAllocator
+class MessageGroupManager : public StatefulQueueObserver, public MessageDistributor
 {
     const std::string groupIdHeader;    // msg header holding group identifier
     const unsigned int timestamp;       // mark messages with timestamp if set
@@ -108,7 +108,7 @@ class MessageGroupManager : public State
     void getState(qpid::framing::FieldTable& state ) const;
     void setState(const qpid::framing::FieldTable&);
 
-    // MessageAllocator iface
+    // MessageDistributor iface
     bool nextConsumableMessage(Consumer::shared_ptr& c, QueuedMessage& next);
     bool allocate(const std::string& c, const QueuedMessage& qm);
     bool nextBrowsableMessage(Consumer::shared_ptr& c, QueuedMessage& next);

Modified: qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/Queue.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/Queue.cpp?rev=1178904&r1=1178903&r2=1178904&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/Queue.cpp (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/Queue.cpp Tue Oct  4 18:58:06 2011
@@ -33,7 +33,7 @@
 #include "qpid/broker/QueueRegistry.h"
 #include "qpid/broker/QueueFlowLimit.h"
 #include "qpid/broker/ThresholdAlerts.h"
-#include "qpid/broker/FifoAllocator.h"
+#include "qpid/broker/FifoDistributor.h"
 #include "qpid/broker/MessageGroupManager.h"
 
 #include "qpid/StringUtils.h"
@@ -115,7 +115,7 @@ Queue::Queue(const string& _name, bool _
     deleted(false),
     barrier(*this),
     autoDeleteTimeout(0),
-    allocator(new FifoAllocator( *messages ))
+    allocator(new FifoDistributor( *messages ))
 {
     if (parent != 0 && broker != 0) {
         ManagementAgent* agent = broker->getManagementAgent();
@@ -617,7 +617,7 @@ namespace {
  * even if the queue is ordered by priority.
  *
  * An optional filter can be supplied that will be applied against each message.  The
- * message is purged only if the filter matches.  See MessageAllocator for more detail.
+ * message is purged only if the filter matches.  See MessageDistributor for more detail.
  */
 uint32_t Queue::purge(const uint32_t purge_request, boost::shared_ptr<Exchange> dest,
                       const qpid::types::Variant::Map *filter)
@@ -990,20 +990,20 @@ void Queue::configureImpl(const FieldTab
     if (lvqKey.size()) {
         QPID_LOG(debug, "Configured queue " <<  getName() << " as Last Value Queue with key " << lvqKey);
         messages = std::auto_ptr<Messages>(new MessageMap(lvqKey));
-        allocator = boost::shared_ptr<MessageAllocator>(new FifoAllocator( *messages ));
+        allocator = boost::shared_ptr<MessageDistributor>(new FifoDistributor( *messages ));
     } else if (_settings.get(qpidLastValueQueueNoBrowse)) {
         QPID_LOG(debug, "Configured queue " <<  getName() << " as Legacy Last Value Queue with 'no-browse' on");
         messages = LegacyLVQ::updateOrReplace(messages, qpidVQMatchProperty, true, broker);
-        allocator = boost::shared_ptr<MessageAllocator>(new FifoAllocator( *messages ));
+        allocator = boost::shared_ptr<MessageDistributor>(new FifoDistributor( *messages ));
     } else if (_settings.get(qpidLastValueQueue)) {
         QPID_LOG(debug, "Configured queue " <<  getName() << " as Legacy Last Value Queue");
         messages = LegacyLVQ::updateOrReplace(messages, qpidVQMatchProperty, false, broker);
-        allocator = boost::shared_ptr<MessageAllocator>(new FifoAllocator( *messages ));
+        allocator = boost::shared_ptr<MessageDistributor>(new FifoDistributor( *messages ));
     } else {
         std::auto_ptr<Messages> m = Fairshare::create(_settings);
         if (m.get()) {
             messages = m;
-            allocator = boost::shared_ptr<MessageAllocator>(new FifoAllocator( *messages ));
+            allocator = boost::shared_ptr<MessageDistributor>(new FifoDistributor( *messages ));
             QPID_LOG(debug, "Configured queue " <<  getName() << " as priority queue.");
         } else { // default (FIFO) queue type
             // override default message allocator if message groups configured.

Modified: qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/Queue.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/Queue.h?rev=1178904&r1=1178903&r2=1178904&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/Queue.h (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/qpid/broker/Queue.h Tue Oct  4 18:58:06 2011
@@ -59,7 +59,7 @@ class MessageStore;
 class QueueEvents;
 class QueueRegistry;
 class TransactionContext;
-class MessageAllocator;
+class MessageDistributor;
 
 /**
  * The brokers representation of an amqp queue. Messages are
@@ -129,7 +129,7 @@ class Queue : public boost::enable_share
     UsageBarrier barrier;
     int autoDeleteTimeout;
     boost::intrusive_ptr<qpid::sys::TimerTask> autoDeleteTask;
-    boost::shared_ptr<MessageAllocator> allocator;
+    boost::shared_ptr<MessageDistributor> allocator;
 
     void push(boost::intrusive_ptr<Message>& msg, bool isRecovery=false);
     void setPolicy(std::auto_ptr<QueuePolicy> policy);



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