diff options
author | Alan Conway <aconway@apache.org> | 2008-11-06 16:13:06 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-11-06 16:13:06 +0000 |
commit | 357557ff3f16b3dc0e6dacfab00e2d0a84f5c8fb (patch) | |
tree | bae54e900ddd6c15fb9a4d69beefab3b728d9e23 /cpp | |
parent | e210a6d2d45f260fe9a711fc5266b749e6d045a5 (diff) | |
download | qpid-python-357557ff3f16b3dc0e6dacfab00e2d0a84f5c8fb.tar.gz |
Remove unused class broker::IncomingExecutionContext.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@711890 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/Makefile.am | 2 | ||||
-rw-r--r-- | cpp/src/qpid/broker/IncomingExecutionContext.cpp | 143 | ||||
-rw-r--r-- | cpp/src/qpid/broker/IncomingExecutionContext.h | 61 |
3 files changed, 0 insertions, 206 deletions
diff --git a/cpp/src/Makefile.am b/cpp/src/Makefile.am index 8f77d4c3c6..774fad3120 100644 --- a/cpp/src/Makefile.am +++ b/cpp/src/Makefile.am @@ -327,7 +327,6 @@ libqpidbroker_la_SOURCES = \ qpid/broker/ExchangeRegistry.cpp \ qpid/broker/FanOutExchange.cpp \ qpid/broker/HeadersExchange.cpp \ - qpid/broker/IncomingExecutionContext.cpp \ qpid/broker/IncompleteMessageList.cpp \ qpid/broker/Link.cpp \ qpid/broker/LinkRegistry.cpp \ @@ -466,7 +465,6 @@ nobase_include_HEADERS = \ qpid/broker/FanOutExchange.h \ qpid/broker/HandlerImpl.h \ qpid/broker/HeadersExchange.h \ - qpid/broker/IncomingExecutionContext.h \ qpid/broker/IncompleteMessageList.h \ qpid/broker/Link.h \ qpid/broker/LinkRegistry.h \ diff --git a/cpp/src/qpid/broker/IncomingExecutionContext.cpp b/cpp/src/qpid/broker/IncomingExecutionContext.cpp deleted file mode 100644 index 6c6cae6740..0000000000 --- a/cpp/src/qpid/broker/IncomingExecutionContext.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -#include "IncomingExecutionContext.h" -#include "qpid/Exception.h" - -namespace qpid { -namespace broker { - -using boost::intrusive_ptr; -using qpid::framing::AccumulatedAck; -using qpid::framing::SequenceNumber; -using qpid::framing::SequenceNumberSet; - -void IncomingExecutionContext::noop() -{ - complete(next()); -} - -void IncomingExecutionContext::flush() -{ - for (Messages::iterator i = incomplete.begin(); i != incomplete.end(); ) { - if ((*i)->isEnqueueComplete()) { - complete((*i)->getCommandId()); - i = incomplete.erase(i); - } else { - i++; - } - } - window.lwm = completed.mark; -} - -void IncomingExecutionContext::sync() -{ - while (completed.mark < window.hwm) { - wait(); - } -} - -void IncomingExecutionContext::sync(const SequenceNumber& point) -{ - while (!isComplete(point)) { - wait(); - } -} - -/** - * Every call to next() should be followed be either a call to - * complete() - in the case of commands, which are always synchronous - * - or track() - in the case of messages which may be asynchronously - * stored. - */ -SequenceNumber IncomingExecutionContext::next() -{ - return ++window.hwm; -} - -void IncomingExecutionContext::complete(const SequenceNumber& command) -{ - completed.update(command, command); -} - -void IncomingExecutionContext::track(intrusive_ptr<Message> msg) -{ - if (msg->isEnqueueComplete()) { - complete(msg->getCommandId()); - } else { - incomplete.push_back(msg); - } -} - -bool IncomingExecutionContext::isComplete(const SequenceNumber& command) -{ - if (command > window.hwm) { - throw Exception(QPID_MSG("Bad sync request: point exceeds last command received [" - << command.getValue() << " > " << window.hwm.getValue() << "]")); - } - - return completed.covers(command); -} - - -const SequenceNumber& IncomingExecutionContext::getMark() -{ - return completed.mark; -} - -SequenceNumberSet IncomingExecutionContext::getRange() -{ - SequenceNumberSet range; - completed.collectRanges(range); - return range; -} - -void IncomingExecutionContext::wait() -{ - check(); - // for IO flush on the store - for (Messages::iterator i = incomplete.begin(); i != incomplete.end(); i++) { - (*i)->flush(); - } - incomplete.front()->waitForEnqueueComplete(); - flush(); -} - -/** - * This is a check of internal state consistency. - */ -void IncomingExecutionContext::check() -{ - if (incomplete.empty()) { - if (window.hwm != completed.mark) { - //can only happen if there is a call to next() without a - //corresponding call to completed() or track() - or if - //there is a logical error in flush() or - //AccumulatedAck::update() - throw Exception(QPID_MSG("Completion tracking error: window.hwm=" - << window.hwm.getValue() << ", completed.mark=" - << completed.mark.getValue())); - } - } -} - -}} - diff --git a/cpp/src/qpid/broker/IncomingExecutionContext.h b/cpp/src/qpid/broker/IncomingExecutionContext.h deleted file mode 100644 index 7380e9ae64..0000000000 --- a/cpp/src/qpid/broker/IncomingExecutionContext.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ -#ifndef _IncomingExecutionContext_ -#define _IncomingExecutionContext_ - -#include "Message.h" - -#include "qpid/framing/AccumulatedAck.h" -#include "qpid/framing/SequenceNumber.h" - -#include <boost/intrusive_ptr.hpp> - -namespace qpid { -namespace broker { - -class IncomingExecutionContext -{ - typedef std::list<boost::intrusive_ptr<Message> > Messages; - framing::Window window; - framing::AccumulatedAck completed; - Messages incomplete; - - bool isComplete(const framing::SequenceNumber& command); - void check(); - void wait(); -public: - void noop(); - void flush(); - void sync(); - void sync(const framing::SequenceNumber& point); - framing::SequenceNumber next(); - void complete(const framing::SequenceNumber& command); - void track(boost::intrusive_ptr<Message>); - - const framing::SequenceNumber& getMark(); - framing::SequenceNumberSet getRange(); - -}; - - -}} - -#endif |