qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cctriel...@apache.org
Subject svn commit: r727517 - in /qpid/trunk/qpid/cpp/src: qpid/broker/Queue.cpp qpid/broker/Queue.h qpid/client/QueueOptions.cpp qpid/client/QueueOptions.h tests/QueueTest.cpp
Date Wed, 17 Dec 2008 21:26:55 GMT
Author: cctrieloff
Date: Wed Dec 17 13:26:55 2008
New Revision: 727517

URL: http://svn.apache.org/viewvc?rev=727517&view=rev
Log:
options name re-name to be more explicit & better test

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/client/QueueOptions.cpp
    qpid/trunk/qpid/cpp/src/qpid/client/QueueOptions.h
    qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp

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=727517&r1=727516&r2=727517&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp Wed Dec 17 13:26:55 2008
@@ -61,7 +61,7 @@
 const std::string qpidTraceIdentity("qpid.trace.id");
 const std::string qpidTraceExclude("qpid.trace.exclude");
 const std::string qpidLastValueQueue("qpid.last_value_queue");
-const std::string qpidLastValueQueueNoAcquire("qpid.last_value_queue_no_acquire");
+const std::string qpidLastValueQueueNoBrowse("qpid.last_value_queue_no_browse");
 const std::string qpidPersistLastNode("qpid.persist_last_node");
 const std::string qpidVQMatchProperty("qpid.LVQ_key");
 }
@@ -80,7 +80,7 @@
     exclusive(0),
     noLocal(false),
     lastValueQueue(false),
-    lastValueQueueNoAcquire(false),
+    lastValueQueueNoBrowse(false),
     persistLastNode(false),
     inLastNodeFailure(false),
     persistenceId(0),
@@ -215,7 +215,7 @@
             || (lastValueQueue && (i->position == msg.position) && 
                 msg.payload.get() == checkLvqReplace(*i).payload.get()) )  {
 
-            if (!lastValueQueueNoAcquire) clearLVQIndex(msg);
+            clearLVQIndex(msg);
             messages.erase(i);
             QPID_LOG(debug, "Match found, acquire succeeded: " << i->position <<
" == " << msg.position);
             return true;
@@ -307,7 +307,7 @@
                 //consumer wants the message
                 c->position = msg.position;
                 m = msg;
-                if (!lastValueQueueNoAcquire) clearLVQIndex(msg);
+                if (!lastValueQueueNoBrowse) clearLVQIndex(msg);
                 return true;
             } else {
                 //browser hasn't got enough credit for the message
@@ -675,10 +675,10 @@
     lastValueQueue= _settings.get(qpidLastValueQueue);
     if (lastValueQueue) QPID_LOG(debug, "Configured queue as Last Value Queue");
 
-    lastValueQueueNoAcquire = _settings.get(qpidLastValueQueueNoAcquire);
-    if (lastValueQueueNoAcquire){
-        QPID_LOG(debug, "Configured queue as Last Value Queue No Acquire");
-        lastValueQueue = lastValueQueueNoAcquire;
+    lastValueQueueNoBrowse = _settings.get(qpidLastValueQueueNoBrowse);
+    if (lastValueQueueNoBrowse){
+        QPID_LOG(debug, "Configured queue as Last Value Queue No Browse");
+        lastValueQueue = lastValueQueueNoBrowse;
     }
     
     persistLastNode= _settings.get(qpidPersistLastNode);

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=727517&r1=727516&r2=727517&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h Wed Dec 17 13:26:55 2008
@@ -76,7 +76,7 @@
             OwnershipToken* exclusive;
             bool noLocal;
             bool lastValueQueue;
-            bool lastValueQueueNoAcquire;
+            bool lastValueQueueNoBrowse;
             bool persistLastNode;
             bool inLastNodeFailure;
             std::string traceId;

Modified: qpid/trunk/qpid/cpp/src/qpid/client/QueueOptions.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/QueueOptions.cpp?rev=727517&r1=727516&r2=727517&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/QueueOptions.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/QueueOptions.cpp Wed Dec 17 13:26:55 2008
@@ -38,7 +38,7 @@
 const std::string QueueOptions::strLastValueQueue("qpid.last_value_queue");
 const std::string QueueOptions::strPersistLastNode("qpid.persist_last_node");
 const std::string QueueOptions::strLVQMatchProperty("qpid.LVQ_key");
-const std::string QueueOptions::strLastValueQueueNoAcquire("qpid.last_value_queue_no_acquire");
+const std::string QueueOptions::strLastValueQueueNoBrowse("qpid.last_value_queue_no_browse");
 
 
 QueueOptions::~QueueOptions()
@@ -80,8 +80,8 @@
 {
     if (op == LVQ){
         setInt(strLastValueQueue, 1); 
-    }else if (op == LVQ_NO_ACQUIRE){
-        setInt(strLastValueQueueNoAcquire, 1); 
+    }else if (op == LVQ_NO_BROWSE){
+        setInt(strLastValueQueueNoBrowse, 1); 
     }else {
         clearOrdering();
     }

Modified: qpid/trunk/qpid/cpp/src/qpid/client/QueueOptions.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/client/QueueOptions.h?rev=727517&r1=727516&r2=727517&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/client/QueueOptions.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/client/QueueOptions.h Wed Dec 17 13:26:55 2008
@@ -27,7 +27,7 @@
 namespace client {
 
 enum QueueSizePolicy {NONE, REJECT, FLOW_TO_DISK, RING, RING_STRICT};
-enum QueueOrderingPolicy {FIFO, LVQ, LVQ_NO_ACQUIRE};	
+enum QueueOrderingPolicy {FIFO, LVQ, LVQ_NO_BROWSE};	
 
 /**
  * A help class to set options on the Queue. Create a configured args while
@@ -94,7 +94,7 @@
     static const std::string strLastValueQueue;
     static const std::string strPersistLastNode;
     static const std::string strLVQMatchProperty;
-    static const std::string strLastValueQueueNoAcquire;
+    static const std::string strLastValueQueueNoBrowse;
 };
 
 }

Modified: qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp?rev=727517&r1=727516&r2=727517&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/QueueTest.cpp Wed Dec 17 13:26:55 2008
@@ -43,7 +43,7 @@
 
     intrusive_ptr<Message> last;
     bool received;
-    TestConsumer(): received(false) {};
+    TestConsumer(bool acquire = true):Consumer(acquire), received(false) {};
 
     virtual bool deliver(QueuedMessage& msg){
         last = msg.payload;
@@ -384,7 +384,7 @@
     msg3->getProperties<MessageProperties>()->getApplicationHeaders().setString(key,"c");
     msg4->getProperties<MessageProperties>()->getApplicationHeaders().setString(key,"a");
     msg5->getProperties<MessageProperties>()->getApplicationHeaders().setString(key,"b");
-    msg6->getProperties<MessageProperties>()->getApplicationHeaders().setString(key,"a");
+    msg6->getProperties<MessageProperties>()->getApplicationHeaders().setString(key,"c");
 	
     //enqueue 4 message
     queue->deliver(msg1);
@@ -406,12 +406,17 @@
     queue->deliver(msg5);
     BOOST_CHECK_EQUAL(queue->getMessageCount(), 3u);
 
-    // set mode to no acquire and check
-    args.setOrdering(client::LVQ_NO_ACQUIRE);
+    // set mode to no browse and check
+    args.setOrdering(client::LVQ_NO_BROWSE);
     queue->configure(args);
+    TestConsumer::shared_ptr c1(new TestConsumer(false));
+    
+    queue->dispatch(c1);
+    queue->dispatch(c1);
+    queue->dispatch(c1);
+    
     queue->deliver(msg6);
     BOOST_CHECK_EQUAL(queue->getMessageCount(), 3u);
- 
 }
 
 QPID_AUTO_TEST_CASE(testLVQMultiQueue){



Mime
View raw message