Author: aconway
Date: Mon Sep 22 07:03:07 2008
New Revision: 697834

URL: http://svn.apache.org/viewvc?rev=697834&view=rev
Log:
Removed redundant code.

Removed:
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Prefetch.h
Modified:
    incubator/qpid/trunk/qpid/cpp/src/Makefile.am
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DeliveryRecord.h
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.h

Modified: incubator/qpid/trunk/qpid/cpp/src/Makefile.am
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/Makefile.am?rev=697834&r1=697833&r2=697834&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/Makefile.am (original)
+++ incubator/qpid/trunk/qpid/cpp/src/Makefile.am Mon Sep 22 07:03:07 2008
@@ -462,7 +462,6 @@
   qpid/broker/PersistableExchange.h \
   qpid/broker/PersistableMessage.h \
   qpid/broker/PersistableQueue.h \
-  qpid/broker/Prefetch.h \
   qpid/broker/QueueBindings.h \
   qpid/broker/QueuedMessage.h \
   qpid/broker/QueuePolicy.h \

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp?rev=697834&r1=697833&r2=697834&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DeliveryRecord.cpp Mon Sep 22 
07:03:07 2008
@@ -161,25 +161,6 @@
     return credit;
 }
 
-
-void DeliveryRecord::addTo(Prefetch& prefetch) const{
-    if(!pull){
-        //ignore 'pulled' messages (i.e. those that were sent in
-        //response to get) when calculating prefetch
-        prefetch.size += size;
-        prefetch.count++;
-    }    
-}
-
-void DeliveryRecord::subtractFrom(Prefetch& prefetch) const{
-    if(!pull){
-        //ignore 'pulled' messages (i.e. those that were sent in
-        //response to get) when calculating prefetch
-        prefetch.size -= size;
-        prefetch.count--;
-    }
-}
-
 void DeliveryRecord::acquire(DeliveryIds& results) {
     if (queue->acquire(msg)) {
         acquired = true;

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DeliveryRecord.h
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DeliveryRecord.h?rev=697834&r1=697833&r2=697834&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DeliveryRecord.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/DeliveryRecord.h Mon Sep 22 
07:03:07 2008
@@ -31,7 +31,6 @@
 #include "DeliveryId.h"
 #include "DeliveryToken.h"
 #include "Message.h"
-#include "Prefetch.h"
 
 namespace qpid {
 namespace broker {
@@ -81,8 +80,6 @@
     bool isRedundant() const { return ended && completed; }
 
     uint32_t getCredit() const;
-    void addTo(Prefetch&) const;
-    void subtractFrom(Prefetch&) const;
     const std::string& getTag() const { return tag; } 
     bool isPull() const { return pull; }
     friend bool operator<(const DeliveryRecord&, const DeliveryRecord&);       
  

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp?rev=697834&r1=697833&r2=697834&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp Mon Sep 22 
07:03:07 2008
@@ -59,13 +59,10 @@
 SemanticState::SemanticState(DeliveryAdapter& da, SessionContext& ss)
     : session(ss),
       deliveryAdapter(da),
-      prefetchSize(0),
-      prefetchCount(0),
       tagGenerator("sgen"),
       dtxSelected(false),
       outputTasks(ss)
 {
-    outstanding.reset();
     acl = getSession().getBroker().getAcl();
 }
 
@@ -231,14 +228,6 @@
 void SemanticState::record(const DeliveryRecord& delivery)
 {
     unacked.push_back(delivery);
-    delivery.addTo(outstanding);
-}
-
-bool SemanticState::checkPrefetch(intrusive_ptr<Message>& msg)
-{
-    bool countOk = !prefetchCount || prefetchCount > unacked.size();
-    bool sizeOk = !prefetchSize || prefetchSize > msg->contentSize() + 
outstanding.size || unacked.empty();
-    return countOk && sizeOk;
 }
 
 SemanticState::ConsumerImpl::ConsumerImpl(SemanticState* _parent, 
@@ -290,7 +279,7 @@
 
 bool SemanticState::ConsumerImpl::accept(intrusive_ptr<Message> msg)
 {
-    blocked = !(filter(msg) && checkCredit(msg) && (!ackExpected || 
parent->checkPrefetch(msg)));
+    blocked = !(filter(msg) && checkCredit(msg));
     return !blocked;
 }
 
@@ -402,7 +391,6 @@
 
 void SemanticState::complete(DeliveryRecord& delivery)
 {    
-    delivery.subtractFrom(outstanding);
     ConsumerImplMap::iterator i = consumers.find(delivery.getTag());
     if (i != consumers.end()) {
         i->second->complete(delivery);
@@ -423,7 +411,6 @@
 void SemanticState::recover(bool requeue)
 {
     if(requeue){
-        outstanding.reset();
         //take copy and clear unacked as requeue may result in redelivery to 
this session
         //which will in turn result in additions to unacked
         std::list<DeliveryRecord> copy = unacked;

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.h
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.h?rev=697834&r1=697833&r2=697834&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.h Mon Sep 22 
07:03:07 2008
@@ -30,7 +30,6 @@
 #include "DtxBuffer.h"
 #include "DtxManager.h"
 #include "NameGenerator.h"
-#include "Prefetch.h"
 #include "TxBuffer.h"
 
 #include "qpid/framing/FrameHandler.h"
@@ -115,9 +114,6 @@
     SessionContext& session;
     DeliveryAdapter& deliveryAdapter;
     ConsumerImplMap consumers;
-    uint32_t prefetchSize;    
-    uint16_t prefetchCount;    
-    Prefetch outstanding;
     NameGenerator tagGenerator;
     std::list<DeliveryRecord> unacked;
     TxBuffer::shared_ptr txBuffer;
@@ -131,7 +127,6 @@
        
     void route(boost::intrusive_ptr<Message> msg, Deliverable& strategy);
     void record(const DeliveryRecord& delivery);
-    bool checkPrefetch(boost::intrusive_ptr<Message>& msg);
     void checkDtxTimeout();
     ConsumerImpl& find(const std::string& destination);
     void complete(DeliveryRecord&);
@@ -154,9 +149,6 @@
      */
     Queue::shared_ptr getQueue(const std::string& name) const;
     
-    uint32_t setPrefetchSize(uint32_t size){ return prefetchSize = size; }
-    uint16_t setPrefetchCount(uint16_t n){ return prefetchCount = n; }
-
     bool exists(const string& consumerTag);
 
     /**


Reply via email to