diff options
author | Kim van der Riet <kpvdr@apache.org> | 2012-07-16 17:30:00 +0000 |
---|---|---|
committer | Kim van der Riet <kpvdr@apache.org> | 2012-07-16 17:30:00 +0000 |
commit | c94c9b5333c06c03deb6a6dcb1a91ecdf111b481 (patch) | |
tree | fd78b0ae0cb8edb6efa3759f60a93c639eff72a0 | |
parent | a804510d81ade0594a75b5c9b8765cafcc233245 (diff) | |
download | qpid-python-c94c9b5333c06c03deb6a6dcb1a91ecdf111b481.tar.gz |
QPID-3858: WIP - More tidy-up
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1362153 13f79535-47bb-0310-9956-ffa450edef68
16 files changed, 15 insertions, 36 deletions
diff --git a/cpp/src/tests/storePerftools/asyncPerf/DeliveryRecord.cpp b/cpp/src/tests/storePerftools/asyncPerf/DeliveryRecord.cpp index 1728a2dc1e..e1c67a9547 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/DeliveryRecord.cpp +++ b/cpp/src/tests/storePerftools/asyncPerf/DeliveryRecord.cpp @@ -24,6 +24,7 @@ #include "DeliveryRecord.h" #include "MessageConsumer.h" +#include "QueuedMessage.h" #include "SimpleMessage.h" #include "SimpleQueue.h" diff --git a/cpp/src/tests/storePerftools/asyncPerf/DeliveryRecord.h b/cpp/src/tests/storePerftools/asyncPerf/DeliveryRecord.h index bb89787737..d4529941e7 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/DeliveryRecord.h +++ b/cpp/src/tests/storePerftools/asyncPerf/DeliveryRecord.h @@ -24,7 +24,7 @@ #ifndef tests_storePerftools_asyncPerf_DeliveryRecord_h_ #define tests_storePerftools_asyncPerf_DeliveryRecord_h_ -#include "QueuedMessage.h" +//#include "QueuedMessage.h" #include <boost/shared_ptr.hpp> @@ -38,6 +38,7 @@ namespace storePerftools { namespace asyncPerf { class MessageConsumer; +class QueuedMessage; class DeliveryRecord { public: diff --git a/cpp/src/tests/storePerftools/asyncPerf/MessageAsyncContext.cpp b/cpp/src/tests/storePerftools/asyncPerf/MessageAsyncContext.cpp index abb6b5c657..5bcf3fe401 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/MessageAsyncContext.cpp +++ b/cpp/src/tests/storePerftools/asyncPerf/MessageAsyncContext.cpp @@ -22,6 +22,7 @@ */ #include "MessageAsyncContext.h" + #include "SimpleMessage.h" #include <cassert> diff --git a/cpp/src/tests/storePerftools/asyncPerf/MessageAsyncContext.h b/cpp/src/tests/storePerftools/asyncPerf/MessageAsyncContext.h index 8418c4c760..77d7be286b 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/MessageAsyncContext.h +++ b/cpp/src/tests/storePerftools/asyncPerf/MessageAsyncContext.h @@ -25,7 +25,6 @@ #define tests_storePerfTools_asyncPerf_MessageContext_h_ #include "qpid/asyncStore/AsyncOperation.h" -#include "qpid/broker/AsyncStore.h" // qpid::broker::BrokerAsyncContext #include <boost/intrusive_ptr.hpp> #include <boost/shared_ptr.hpp> diff --git a/cpp/src/tests/storePerftools/asyncPerf/MessageDeque.cpp b/cpp/src/tests/storePerftools/asyncPerf/MessageDeque.cpp index 8b79a91ac1..1fa2c087ac 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/MessageDeque.cpp +++ b/cpp/src/tests/storePerftools/asyncPerf/MessageDeque.cpp @@ -22,6 +22,7 @@ */ #include "MessageDeque.h" + #include "QueuedMessage.h" namespace tests { diff --git a/cpp/src/tests/storePerftools/asyncPerf/PerfTest.cpp b/cpp/src/tests/storePerftools/asyncPerf/PerfTest.cpp index 1497b678a0..6377cc0d85 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/PerfTest.cpp +++ b/cpp/src/tests/storePerftools/asyncPerf/PerfTest.cpp @@ -34,8 +34,6 @@ #include "qpid/Modules.h" // Use with loading store as module #include "qpid/asyncStore/AsyncStoreImpl.h" #include "qpid/asyncStore/AsyncStoreOptions.h" -#include "qpid/broker/AsyncStore.h" -#include "qpid/sys/Poller.h" #include <iomanip> diff --git a/cpp/src/tests/storePerftools/asyncPerf/PerfTest.h b/cpp/src/tests/storePerftools/asyncPerf/PerfTest.h index 7cbb71322f..e4d99021b5 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/PerfTest.h +++ b/cpp/src/tests/storePerftools/asyncPerf/PerfTest.h @@ -36,9 +36,6 @@ #include <deque> namespace qpid { -namespace broker { -class AsyncStore; -} namespace asyncStore { class AsyncStoreImpl; class AsyncStoreOptions; @@ -63,6 +60,8 @@ public: const qpid::asyncStore::AsyncStoreOptions& aso); virtual ~PerfTest(); void run(); + + // --- Interface tests::storePerftools::common::Streamable --- void toStream(std::ostream& os = std::cout) const; private: diff --git a/cpp/src/tests/storePerftools/asyncPerf/QueueAsyncContext.cpp b/cpp/src/tests/storePerftools/asyncPerf/QueueAsyncContext.cpp index c1c657727b..f2eea9bad3 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/QueueAsyncContext.cpp +++ b/cpp/src/tests/storePerftools/asyncPerf/QueueAsyncContext.cpp @@ -22,6 +22,7 @@ */ #include "QueueAsyncContext.h" + #include "SimpleMessage.h" #include <cassert> diff --git a/cpp/src/tests/storePerftools/asyncPerf/QueueAsyncContext.h b/cpp/src/tests/storePerftools/asyncPerf/QueueAsyncContext.h index 3a8850c699..e3e87b8ad8 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/QueueAsyncContext.h +++ b/cpp/src/tests/storePerftools/asyncPerf/QueueAsyncContext.h @@ -25,6 +25,7 @@ #define tests_storePerftools_asyncPerf_QueueContext_h_ #include "qpid/asyncStore/AsyncOperation.h" +#include "qpid/broker/AsyncResultHandle.h" #include "qpid/broker/AsyncStore.h" #include "qpid/broker/TxnHandle.h" diff --git a/cpp/src/tests/storePerftools/asyncPerf/QueuedMessage.h b/cpp/src/tests/storePerftools/asyncPerf/QueuedMessage.h index 7d4e5bbbe4..d872cfde58 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/QueuedMessage.h +++ b/cpp/src/tests/storePerftools/asyncPerf/QueuedMessage.h @@ -55,7 +55,7 @@ public: SimpleQueue* getQueue() const; boost::intrusive_ptr<SimpleMessage> payload() const; - // -- Transaction handling --- + // --- Transaction handling --- void prepareEnqueue(qpid::broker::TxnHandle& th); void commitEnqueue(); void abortEnqueue(); diff --git a/cpp/src/tests/storePerftools/asyncPerf/SimpleMessage.cpp b/cpp/src/tests/storePerftools/asyncPerf/SimpleMessage.cpp index 889f7a4cdd..bacf438b9f 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/SimpleMessage.cpp +++ b/cpp/src/tests/storePerftools/asyncPerf/SimpleMessage.cpp @@ -23,7 +23,7 @@ #include "SimpleMessage.h" -#include "qpid/asyncStore/AsyncStoreImpl.h" +#include <string.h> // memcpy() namespace tests { namespace storePerftools { diff --git a/cpp/src/tests/storePerftools/asyncPerf/SimpleMessage.h b/cpp/src/tests/storePerftools/asyncPerf/SimpleMessage.h index 01f54c1c19..169f5a8959 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/SimpleMessage.h +++ b/cpp/src/tests/storePerftools/asyncPerf/SimpleMessage.h @@ -32,8 +32,6 @@ namespace tests { namespace storePerftools { namespace asyncPerf { -class SimpleQueue; - class SimpleMessage: public qpid::broker::PersistableMessage, public qpid::broker::DataSource { diff --git a/cpp/src/tests/storePerftools/asyncPerf/SimpleQueue.cpp b/cpp/src/tests/storePerftools/asyncPerf/SimpleQueue.cpp index 3bce2fb52a..2a6f2b208b 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/SimpleQueue.cpp +++ b/cpp/src/tests/storePerftools/asyncPerf/SimpleQueue.cpp @@ -28,13 +28,13 @@ #include "MessageDeque.h" #include "PersistableQueuedMessage.h" #include "QueueAsyncContext.h" -#include "QueuedMessage.h" #include "SimpleMessage.h" -#include "qpid/asyncStore/AsyncStoreImpl.h" #include "qpid/broker/AsyncResultHandle.h" +#include "qpid/broker/TxnHandle.h" #include <boost/make_shared.hpp> +#include <string.h> // memcpy() namespace tests { namespace storePerftools { @@ -80,7 +80,6 @@ SimpleQueue::handleAsyncResult(const qpid::broker::AsyncResultHandle* const arh) std::cerr << "Queue name=\"" << qc->getQueue()->m_name << "\": Operation " << qc->getOpStr() << ": failure " << arh->getErrNo() << " (" << arh->getErrMsg() << ")" << std::endl; } else { -//std::cout << "QQQ SimpleQueue::handleAsyncResult() op=" << qc->getOpStr() << std::endl << std::flush; // Handle async success here switch(qc->getOpCode()) { case qpid::asyncStore::AsyncOperation::QUEUE_CREATE: @@ -169,11 +168,7 @@ SimpleQueue::deliver(boost::intrusive_ptr<SimpleMessage> msg) } else { qm = boost::make_shared<QueuedMessage>(new QueuedMessage(this, msg)); } -//boost::shared_ptr<PersistableQueuedMessage> pqm1 = boost::dynamic_pointer_cast<PersistableQueuedMessage>(qm); -//assert(pqm1.get()); enqueue(s_nullTxnHandle, qm); -//boost::shared_ptr<PersistableQueuedMessage> pqm2 = boost::dynamic_pointer_cast<PersistableQueuedMessage>(qm); -//assert(pqm2.get()); push(qm); } @@ -226,10 +221,6 @@ SimpleQueue::dequeue(qpid::broker::TxnHandle& th, } if (qm->payload()->isPersistent() && m_store) { qm->payload()->dequeueAsync(shared_from_this(), m_store); -//assert(qm.get()); -//boost::shared_ptr<PersistableQueuedMessage> pqm = boost::dynamic_pointer_cast<PersistableQueuedMessage>(qm); -//assert(pqm.get()); -//return asyncDequeue(th, pqm); return asyncDequeue(th, boost::dynamic_pointer_cast<PersistableQueuedMessage>(qm)); } return true; @@ -381,7 +372,6 @@ SimpleQueue::asyncEnqueue(qpid::broker::TxnHandle& th, { assert(pqm.get()); // qm.payload()->setPersistenceId(m_store->getNextRid()); // TODO: rid is set by store itself - find way to do this -//std::cout << "QQQ Queue=\"" << m_name << "\": asyncEnqueue() rid=0x" << std::hex << pqm->payload()->getPersistenceId() << std::dec << std::endl << std::flush; boost::shared_ptr<QueueAsyncContext> qac(new QueueAsyncContext(shared_from_this(), pqm->payload(), th, @@ -405,7 +395,6 @@ SimpleQueue::asyncDequeue(qpid::broker::TxnHandle& th, boost::shared_ptr<PersistableQueuedMessage> pqm) { assert(pqm.get()); -//std::cout << "QQQ Queue=\"" << m_name << "\": asyncDequeue() rid=0x" << std::hex << qm.payload()->getPersistenceId() << std::dec << std::endl << std::flush; boost::shared_ptr<QueueAsyncContext> qac(new QueueAsyncContext(shared_from_this(), pqm->payload(), th, @@ -438,7 +427,6 @@ SimpleQueue::destroyCheck(const std::string& opDescr) const void SimpleQueue::createComplete(const boost::shared_ptr<QueueAsyncContext> qc) { -//std::cout << "QQQ Queue name=\"" << qc->getQueue()->getName() << "\": createComplete()" << std::endl << std::flush; assert(qc->getQueue().get() == this); --m_asyncOpCounter; } @@ -447,7 +435,6 @@ SimpleQueue::createComplete(const boost::shared_ptr<QueueAsyncContext> qc) void SimpleQueue::flushComplete(const boost::shared_ptr<QueueAsyncContext> qc) { -//std::cout << "QQQ Queue name=\"" << qc->getQueue()->getName() << "\": flushComplete()" << std::endl << std::flush; assert(qc->getQueue().get() == this); --m_asyncOpCounter; } @@ -456,7 +443,6 @@ SimpleQueue::flushComplete(const boost::shared_ptr<QueueAsyncContext> qc) void SimpleQueue::destroyComplete(const boost::shared_ptr<QueueAsyncContext> qc) { -//std::cout << "QQQ Queue name=\"" << qc->getQueue()->getName() << "\": destroyComplete()" << std::endl << std::flush; assert(qc->getQueue().get() == this); --m_asyncOpCounter; m_destroyed = true; @@ -466,7 +452,6 @@ SimpleQueue::destroyComplete(const boost::shared_ptr<QueueAsyncContext> qc) void SimpleQueue::enqueueComplete(const boost::shared_ptr<QueueAsyncContext> qc) { -//std::cout << "QQQ Queue name=\"" << qc->getQueue()->getName() << "\": enqueueComplete() rid=0x" << std::hex << qc->getMessage()->getPersistenceId() << std::dec << std::endl << std::flush; assert(qc->getQueue().get() == this); --m_asyncOpCounter; @@ -482,7 +467,6 @@ SimpleQueue::enqueueComplete(const boost::shared_ptr<QueueAsyncContext> qc) void SimpleQueue::dequeueComplete(const boost::shared_ptr<QueueAsyncContext> qc) { -//std::cout << "QQQ Queue name=\"" << qc->getQueue()->getName() << "\": dequeueComplete() rid=0x" << std::hex << qc->getMessage()->getPersistenceId() << std::dec << std::endl << std::flush; assert(qc->getQueue().get() == this); --m_asyncOpCounter; diff --git a/cpp/src/tests/storePerftools/asyncPerf/SimpleQueue.h b/cpp/src/tests/storePerftools/asyncPerf/SimpleQueue.h index 81ea8b022b..2763ae3159 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/SimpleQueue.h +++ b/cpp/src/tests/storePerftools/asyncPerf/SimpleQueue.h @@ -36,7 +36,7 @@ namespace qpid { namespace asyncStore { -class AsyncStoreImpl; +//class AsyncStoreImpl; } namespace broker { class AsyncResultQueue; diff --git a/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.cpp b/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.cpp index 0c34520d06..7a0d6bed33 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.cpp +++ b/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.cpp @@ -26,7 +26,7 @@ #include "PersistableQueuedMessage.h" #include "QueuedMessage.h" #include "SimpleMessage.h" -#include "SimpleQueue.h" // debug msg +#include "SimpleQueue.h" #include "qpid/log/Statement.h" diff --git a/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.h b/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.h index a7255314bd..17c3b3778d 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.h +++ b/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.h @@ -32,11 +32,6 @@ #include <boost/shared_ptr.hpp> #include <list> -namespace qpid { -namespace broker { -class TransactionContext; -}} - namespace tests { namespace storePerftools { namespace asyncPerf { |