You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2010/01/14 19:55:47 UTC

svn commit: r899356 - in /qpid/trunk/qpid/cpp/src/qpid: broker/ cluster/ sys/

Author: aconway
Date: Thu Jan 14 18:55:46 2010
New Revision: 899356

URL: http://svn.apache.org/viewvc?rev=899356&view=rev
Log:
Removed dead code: OutputTask::hasOutput and Queue::checkForMessages.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp
    qpid/trunk/qpid/cpp/src/qpid/broker/Connection.h
    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/SemanticState.cpp
    qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.h
    qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.h
    qpid/trunk/qpid/cpp/src/qpid/cluster/ProxyInputHandler.h
    qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.cpp
    qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.h
    qpid/trunk/qpid/cpp/src/qpid/sys/OutputTask.h

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp?rev=899356&r1=899355&r2=899356&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Connection.cpp Thu Jan 14 18:55:46 2010
@@ -260,8 +260,6 @@
     }
 }
 
-bool Connection::hasOutput() { return outputTasks.hasOutput(); }
-
 bool Connection::doOutput() {
     try {
         {

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/Connection.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/Connection.h?rev=899356&r1=899355&r2=899356&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Connection.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Connection.h Thu Jan 14 18:55:46 2010
@@ -92,7 +92,6 @@
     void received(framing::AMQFrame& frame);
     void idleOut();
     void idleIn();
-    bool hasOutput();
     bool doOutput();
     void closed();
 

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=899356&r1=899355&r2=899356&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp Thu Jan 14 18:55:46 2010
@@ -309,32 +309,6 @@
     }
 }
 
-bool Queue::checkForMessages(Consumer::shared_ptr c)
-{
-    Mutex::ScopedLock locker(messageLock);
-    if (messages.empty()) {
-        //no message available, register consumer for notification
-        //when this changes
-        listeners.addListener(c);
-        return false;
-    } else {
-        QueuedMessage msg = getFront();
-        if (store && !msg.payload->isEnqueueComplete()) {
-            //though a message is on the queue, it has not yet been
-            //enqueued and so is not available for consumption yet,
-            //register consumer for notification when this changes
-            listeners.addListener(c);
-            return false;            
-        } else {
-            //check that consumer has sufficient credit for the
-            //message (if it does not, no need to register it for
-            //notification as the consumer itself will handle the
-            //credit allocation required to change this condition).
-            return c->accept(msg.payload);
-        }
-    }
-}
-
 Queue::ConsumeCode Queue::consumeNextMessage(QueuedMessage& m, Consumer::shared_ptr c)
 {
     while (true) {

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=899356&r1=899355&r2=899356&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/Queue.h Thu Jan 14 18:55:46 2010
@@ -167,13 +167,6 @@
             QPID_BROKER_EXTERN ~Queue();
 
             QPID_BROKER_EXTERN bool dispatch(Consumer::shared_ptr);
-            /**
-             * Check whether there would be a message available for
-             * dispatch to this consumer. If not, the consumer will be
-             * notified of events that may have changed this
-             * situation.
-             */
-            bool checkForMessages(Consumer::shared_ptr);
 
             void create(const qpid::framing::FieldTable& settings);
 

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp?rev=899356&r1=899355&r2=899356&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.cpp Thu Jan 14 18:55:46 2010
@@ -659,10 +659,6 @@
     unacked.erase(range.start, range.end);
 }
 
-bool SemanticState::ConsumerImpl::hasOutput() {
-    return queue->checkForMessages(shared_from_this());
-}
-
 bool SemanticState::ConsumerImpl::doOutput()
 {
     return haveCredit() && queue->dispatch(shared_from_this());

Modified: qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.h?rev=899356&r1=899355&r2=899356&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/broker/SemanticState.h Thu Jan 14 18:55:46 2010
@@ -116,7 +116,6 @@
         bool isBlocked() const { return blocked; }
         bool setBlocked(bool set) { std::swap(set, blocked); return set; }
 
-        bool hasOutput();
         bool doOutput();
 
         std::string getName() const { return name; }

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=899356&r1=899355&r2=899356&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/Connection.h Thu Jan 14 18:55:46 2010
@@ -95,7 +95,6 @@
     void received(framing::AMQFrame&);
     void closed();
     bool doOutput();
-    bool hasOutput() { return connection.hasOutput(); }
     void idleOut() { connection.idleOut(); }
     void idleIn() { connection.idleIn(); }
 

Modified: qpid/trunk/qpid/cpp/src/qpid/cluster/ProxyInputHandler.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/cluster/ProxyInputHandler.h?rev=899356&r1=899355&r2=899356&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/cluster/ProxyInputHandler.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/cluster/ProxyInputHandler.h Thu Jan 14 18:55:46 2010
@@ -46,7 +46,6 @@
     void idleOut() { target->idleOut(); }
     void idleIn() { target->idleIn(); }
     bool doOutput() { return target->doOutput(); }
-    bool hasOutput() { return target->hasOutput(); }
     
   private:
     boost::intrusive_ptr<cluster::Connection> target;

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.cpp?rev=899356&r1=899355&r2=899356&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.cpp Thu Jan 14 18:55:46 2010
@@ -34,11 +34,6 @@
 
 void AggregateOutput::giveReadCredit(int32_t credit) { control.giveReadCredit(credit); }
 
-bool AggregateOutput::hasOutput() {
-    Mutex::ScopedLock l(lock);
-    return !tasks.empty();
-}
-
 // Clear the busy flag and notify waiting threads in destructor.
 struct ScopedBusy {
     bool& flag;

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.h?rev=899356&r1=899355&r2=899356&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/AggregateOutput.h Thu Jan 14 18:55:46 2010
@@ -61,7 +61,6 @@
 
     // These functions must not be called concurrently with each other.
     QPID_COMMON_EXTERN bool doOutput();
-    QPID_COMMON_EXTERN bool hasOutput();
     QPID_COMMON_EXTERN void removeOutputTask(OutputTask* t);
     QPID_COMMON_EXTERN void removeAll();
 

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/OutputTask.h
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/OutputTask.h?rev=899356&r1=899355&r2=899356&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/OutputTask.h (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/OutputTask.h Thu Jan 14 18:55:46 2010
@@ -32,13 +32,6 @@
          *@return true if output was generated, false if there is no work to do.
          */
         virtual bool doOutput() = 0;
-
-        /** Check if there may be work to do, but don't do it.
-         * @return True if there may be work to do, false if there is none.
-         * Can to return a false positive, to allow implementations to do a
-         * faster check than doOutput(). Must never return a false negative.
-         */
-        virtual bool hasOutput() = 0;
     };
 
 }



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