You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kp...@apache.org on 2012/08/01 16:05:24 UTC
svn commit: r1368006 [2/2] - in /qpid/branches/asyncstore/cpp/src: ./
qpid/asyncStore/ qpid/broker/ tests/ tests/storePerftools/asyncPerf/
Copied: qpid/branches/asyncstore/cpp/src/qpid/broker/SimpleTxnOp.h (from r1367535, qpid/branches/asyncstore/cpp/src/qpid/broker/TxnOp.h)
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/qpid/broker/SimpleTxnOp.h?p2=qpid/branches/asyncstore/cpp/src/qpid/broker/SimpleTxnOp.h&p1=qpid/branches/asyncstore/cpp/src/qpid/broker/TxnOp.h&r1=1367535&r2=1368006&rev=1368006&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/qpid/broker/TxnOp.h (original)
+++ qpid/branches/asyncstore/cpp/src/qpid/broker/SimpleTxnOp.h Wed Aug 1 14:05:21 2012
@@ -18,27 +18,27 @@
*/
/**
- * \file TxnOp.h
+ * \file SimpleTxnOp.h
*/
-#ifndef qpid_broker_TxnOp_h_
-#define qpid_broker_TxnOp_h_
+#ifndef qpid_broker_SimpleTxnOp_h_
+#define qpid_broker_SimpleTxnOp_h_
#include <boost/shared_ptr.hpp>
namespace qpid {
namespace broker {
-class TxnBuffer;
+class SimpleTxnBuffer;
-class TxnOp{
+class SimpleTxnOp{
public:
- virtual ~TxnOp() {}
- virtual bool prepare(qpid::broker::TxnBuffer*) throw() = 0;
+ virtual ~SimpleTxnOp() {}
+ virtual bool prepare(SimpleTxnBuffer*) throw() = 0;
virtual void commit() throw() = 0;
virtual void rollback() throw() = 0;
};
}} // namespace qpid::broker
-#endif // qpid_broker_TxnOp_h_
+#endif // qpid_broker_SimpleTxnOp_h_
Copied: qpid/branches/asyncstore/cpp/src/qpid/broker/SimpleTxnPublish.cpp (from r1367535, qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.cpp)
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/qpid/broker/SimpleTxnPublish.cpp?p2=qpid/branches/asyncstore/cpp/src/qpid/broker/SimpleTxnPublish.cpp&p1=qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.cpp&r1=1367535&r2=1368006&rev=1368006&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.cpp (original)
+++ qpid/branches/asyncstore/cpp/src/qpid/broker/SimpleTxnPublish.cpp Wed Aug 1 14:05:21 2012
@@ -18,30 +18,29 @@
*/
/**
- * \file TxnPublish.cpp
+ * \file SimpleTxnPublish.cpp
*/
-#include "TxnPublish.h"
+#include "SimpleTxnPublish.h"
-#include "QueuedMessage.h"
#include "SimpleMessage.h"
#include "SimpleQueue.h"
+#include "SimpleQueuedMessage.h"
#include "qpid/log/Statement.h"
#include <boost/make_shared.hpp>
-namespace tests {
-namespace storePerftools {
-namespace asyncPerf {
+namespace qpid {
+namespace broker {
-TxnPublish::TxnPublish(boost::intrusive_ptr<SimpleMessage> msg) :
+SimpleTxnPublish::SimpleTxnPublish(boost::intrusive_ptr<SimpleMessage> msg) :
m_msg(msg)
{}
-TxnPublish::~TxnPublish() {}
+SimpleTxnPublish::~SimpleTxnPublish() {}
bool
-TxnPublish::prepare(qpid::broker::TxnBuffer* tb) throw() {
+SimpleTxnPublish::prepare(SimpleTxnBuffer* tb) throw() {
try {
while (!m_queues.empty()) {
m_queues.front()->prepareEnqueue(tb);
@@ -58,9 +57,9 @@ TxnPublish::prepare(qpid::broker::TxnBuf
}
void
-TxnPublish::commit() throw() {
+SimpleTxnPublish::commit() throw() {
try {
- for (std::list<boost::shared_ptr<QueuedMessage> >::iterator i = m_prepared.begin(); i != m_prepared.end(); ++i) {
+ for (std::list<boost::shared_ptr<SimpleQueuedMessage> >::iterator i = m_prepared.begin(); i != m_prepared.end(); ++i) {
(*i)->commitEnqueue();
}
} catch (const std::exception& e) {
@@ -71,9 +70,9 @@ TxnPublish::commit() throw() {
}
void
-TxnPublish::rollback() throw() {
+SimpleTxnPublish::rollback() throw() {
try {
- for (std::list<boost::shared_ptr<QueuedMessage> >::iterator i = m_prepared.begin(); i != m_prepared.end(); ++i) {
+ for (std::list<boost::shared_ptr<SimpleQueuedMessage> >::iterator i = m_prepared.begin(); i != m_prepared.end(); ++i) {
(*i)->abortEnqueue();
}
} catch (const std::exception& e) {
@@ -84,19 +83,19 @@ TxnPublish::rollback() throw() {
}
uint64_t
-TxnPublish::contentSize() {
+SimpleTxnPublish::contentSize() {
return m_msg->contentSize();
}
void
-TxnPublish::deliverTo(const boost::shared_ptr<SimpleQueue>& queue) {
- m_queues.push_back(boost::shared_ptr<QueuedMessage>(new QueuedMessage(queue.get(), m_msg)));
+SimpleTxnPublish::deliverTo(const boost::shared_ptr<SimpleQueue>& queue) {
+ m_queues.push_back(boost::shared_ptr<SimpleQueuedMessage>(new SimpleQueuedMessage(queue.get(), m_msg)));
m_delivered = true;
}
SimpleMessage&
-TxnPublish::getMessage() {
+SimpleTxnPublish::getMessage() {
return *m_msg;
}
-}}} // namespace tests::storePerftools::asyncPerf
+}} // namespace qpid::broker
Copied: qpid/branches/asyncstore/cpp/src/qpid/broker/SimpleTxnPublish.h (from r1367535, qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.h)
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/qpid/broker/SimpleTxnPublish.h?p2=qpid/branches/asyncstore/cpp/src/qpid/broker/SimpleTxnPublish.h&p1=qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.h&r1=1367535&r2=1368006&rev=1368006&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.h (original)
+++ qpid/branches/asyncstore/cpp/src/qpid/broker/SimpleTxnPublish.h Wed Aug 1 14:05:21 2012
@@ -18,37 +18,36 @@
*/
/**
- * \file TxnPublish.h
+ * \file SimpleTxnPublish.h
*/
-#ifndef tests_storePerftools_asyncPerf_TxnPublish_h_
-#define tests_storePerftools_asyncPerf_TxnPublish_h_
+#ifndef qpid_broker_SimpleTxnPublish_h_
+#define qpid_broker_SimpleTxnPublish_h_
-#include "Deliverable.h"
-
-#include "qpid/broker/TxnOp.h"
+#include "SimpleDeliverable.h"
+#include "SimpleTxnOp.h"
#include <boost/intrusive_ptr.hpp>
#include <boost/shared_ptr.hpp>
#include <list>
-namespace tests {
-namespace storePerftools {
-namespace asyncPerf {
-class QueuedMessage;
+namespace qpid {
+namespace broker {
+
+class SimpleQueuedMessage;
class SimpleMessage;
class SimpleQueue;
-class TxnPublish : public qpid::broker::TxnOp,
- public Deliverable
+class SimpleTxnPublish : public SimpleTxnOp,
+ public SimpleDeliverable
{
public:
- TxnPublish(boost::intrusive_ptr<SimpleMessage> msg);
- virtual ~TxnPublish();
+ SimpleTxnPublish(boost::intrusive_ptr<SimpleMessage> msg);
+ virtual ~SimpleTxnPublish();
// --- Interface TxOp ---
- bool prepare(qpid::broker::TxnBuffer* tb) throw();
+ bool prepare(SimpleTxnBuffer* tb) throw();
void commit() throw();
void rollback() throw();
@@ -59,10 +58,10 @@ public:
private:
boost::intrusive_ptr<SimpleMessage> m_msg;
- std::list<boost::shared_ptr<QueuedMessage> > m_queues;
- std::list<boost::shared_ptr<QueuedMessage> > m_prepared;
+ std::list<boost::shared_ptr<SimpleQueuedMessage> > m_queues;
+ std::list<boost::shared_ptr<SimpleQueuedMessage> > m_prepared;
};
-}}} // namespace tests::storePerftools::asyncPerf
+}} // namespace qpid::broker
-#endif // tests_storePerftools_asyncPerf_TxnPublish_h_
+#endif // qpid_broker_SimpleTxnPublish_h_
Modified: qpid/branches/asyncstore/cpp/src/qpid/broker/TxnAsyncContext.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/qpid/broker/TxnAsyncContext.cpp?rev=1368006&r1=1368005&r2=1368006&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/qpid/broker/TxnAsyncContext.cpp (original)
+++ qpid/branches/asyncstore/cpp/src/qpid/broker/TxnAsyncContext.cpp Wed Aug 1 14:05:21 2012
@@ -26,7 +26,7 @@
namespace qpid {
namespace broker {
-TxnAsyncContext::TxnAsyncContext(TxnBuffer* const tb,
+TxnAsyncContext::TxnAsyncContext(SimpleTxnBuffer* const tb,
AsyncResultCallback rcb,
AsyncResultQueue* const arq):
m_tb(tb),
@@ -37,7 +37,7 @@ TxnAsyncContext::TxnAsyncContext(TxnBuff
TxnAsyncContext::~TxnAsyncContext()
{}
-TxnBuffer*
+SimpleTxnBuffer*
TxnAsyncContext::getTxnBuffer() const
{
return m_tb;
Modified: qpid/branches/asyncstore/cpp/src/qpid/broker/TxnAsyncContext.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/qpid/broker/TxnAsyncContext.h?rev=1368006&r1=1368005&r2=1368006&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/qpid/broker/TxnAsyncContext.h (original)
+++ qpid/branches/asyncstore/cpp/src/qpid/broker/TxnAsyncContext.h Wed Aug 1 14:05:21 2012
@@ -29,38 +29,34 @@
#include "qpid/asyncStore/AsyncOperation.h"
namespace qpid {
-//namespace asyncStore {
-//class AsyncOperation;
-//}
namespace broker {
class AsyncResultHandle;
class AsyncResultQueue;
-//class TxnHandle;
typedef void (*AsyncResultCallback)(const AsyncResultHandle* const);
class TxnAsyncContext: public BrokerAsyncContext {
public:
- TxnAsyncContext(TxnBuffer* const tb,
+ TxnAsyncContext(SimpleTxnBuffer* const tb,
AsyncResultCallback rcb,
AsyncResultQueue* const arq);
virtual ~TxnAsyncContext();
- TxnBuffer* getTxnBuffer() const;
+ SimpleTxnBuffer* getTxnBuffer() const;
// --- Interface BrokerAsyncContext ---
AsyncResultQueue* getAsyncResultQueue() const;
void invokeCallback(const AsyncResultHandle* const) const;
private:
- TxnBuffer* const m_tb;
+ SimpleTxnBuffer* const m_tb;
AsyncResultCallback m_rcb;
AsyncResultQueue* const m_arq;
};
class TpcTxnAsyncContext : public TxnAsyncContext {
public:
- TpcTxnAsyncContext(TxnBuffer* const tb,
+ TpcTxnAsyncContext(SimpleTxnBuffer* const tb,
AsyncResultCallback rcb,
AsyncResultQueue* const arq) :
TxnAsyncContext(tb, rcb, arq)
Modified: qpid/branches/asyncstore/cpp/src/tests/asyncstore.cmake
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/tests/asyncstore.cmake?rev=1368006&r1=1368005&r2=1368006&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/asyncstore.cmake (original)
+++ qpid/branches/asyncstore/cpp/src/tests/asyncstore.cmake Wed Aug 1 14:05:21 2012
@@ -51,20 +51,20 @@ endif (UNIX)
# Async store perf test (asyncPerf)
set (asyncStorePerf_SOURCES
- storePerftools/asyncPerf/Deliverable.cpp
- storePerftools/asyncPerf/DeliveryRecord.cpp
- storePerftools/asyncPerf/MessageAsyncContext.cpp
storePerftools/asyncPerf/MessageConsumer.cpp
- storePerftools/asyncPerf/MessageDeque.cpp
storePerftools/asyncPerf/MessageProducer.cpp
storePerftools/asyncPerf/PerfTest.cpp
- storePerftools/asyncPerf/QueuedMessage.cpp
- storePerftools/asyncPerf/SimpleMessage.cpp
- storePerftools/asyncPerf/SimpleQueue.cpp
+# storePerftools/asyncPerf/SimpleDeliverable.cpp
+# storePerftools/asyncPerf/SimpleDeliveryRecord.cpp
+# storePerftools/asyncPerf/SimpleMessage.cpp
+# storePerftools/asyncPerf/SimpleMessageAsyncContext.cpp
+# storePerftools/asyncPerf/SimpleMessageDeque.cpp
+# storePerftools/asyncPerf/SimpleQueue.cpp
+# storePerftools/asyncPerf/SimpleQueuedMessage.cpp
+# storePerftools/asyncPerf/SimpleTxnAccept.cpp
+# storePerftools/asyncPerf/SimpleTxnPublish.cpp
storePerftools/asyncPerf/TestOptions.cpp
storePerftools/asyncPerf/TestResult.cpp
- storePerftools/asyncPerf/TxnAccept.cpp
- storePerftools/asyncPerf/TxnPublish.cpp
storePerftools/common/Parameters.cpp
storePerftools/common/PerftoolError.cpp
Modified: qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/MessageConsumer.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/MessageConsumer.cpp?rev=1368006&r1=1368005&r2=1368006&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/MessageConsumer.cpp (original)
+++ qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/MessageConsumer.cpp Wed Aug 1 14:05:21 2012
@@ -23,13 +23,12 @@
#include "MessageConsumer.h"
-#include "DeliveryRecord.h"
-#include "SimpleQueue.h"
#include "TestOptions.h"
-#include "TxnAccept.h"
-#include "qpid/asyncStore/AsyncStoreImpl.h"
-#include "qpid/broker/TxnBuffer.h"
+#include "qpid/broker/SimpleDeliveryRecord.h"
+#include "qpid/broker/SimpleQueue.h"
+#include "qpid/broker/SimpleTxnAccept.h"
+#include "qpid/broker/SimpleTxnBuffer.h"
#include <stdint.h> // uint32_t
@@ -38,9 +37,9 @@ namespace storePerftools {
namespace asyncPerf {
MessageConsumer::MessageConsumer(const TestOptions& perfTestParams,
- qpid::asyncStore::AsyncStoreImpl* store,
+ qpid::broker::AsyncStore* store,
qpid::broker::AsyncResultQueue& arq,
- boost::shared_ptr<SimpleQueue> queue) :
+ boost::shared_ptr<qpid::broker::SimpleQueue> queue) :
m_perfTestParams(perfTestParams),
m_store(store),
m_resultQueue(arq),
@@ -50,7 +49,7 @@ MessageConsumer::MessageConsumer(const T
MessageConsumer::~MessageConsumer() {}
void
-MessageConsumer::record(boost::shared_ptr<DeliveryRecord> dr) {
+MessageConsumer::record(boost::shared_ptr<qpid::broker::SimpleDeliveryRecord> dr) {
m_unacked.push_back(dr);
}
@@ -61,9 +60,9 @@ void*
MessageConsumer::runConsumers() {
const bool useTxns = m_perfTestParams.m_deqTxnBlockSize > 0U;
uint16_t opsInTxnCnt = 0U;
- qpid::broker::TxnBuffer* tb = 0;
+ qpid::broker::SimpleTxnBuffer* tb = 0;
if (useTxns) {
- tb = new qpid::broker::TxnBuffer(m_resultQueue);
+ tb = new qpid::broker::SimpleTxnBuffer(m_resultQueue);
}
uint32_t msgsPerConsumer = m_perfTestParams.m_numEnqThreadsPerQueue * m_perfTestParams.m_numMsgs /
@@ -74,19 +73,19 @@ MessageConsumer::runConsumers() {
++numMsgs;
if (useTxns) {
// --- Transactional dequeue ---
- boost::shared_ptr<TxnAccept> ta(new TxnAccept(m_unacked));
+ boost::shared_ptr<qpid::broker::SimpleTxnAccept> ta(new qpid::broker::SimpleTxnAccept(m_unacked));
m_unacked.clear();
tb->enlist(ta);
if (++opsInTxnCnt >= m_perfTestParams.m_deqTxnBlockSize) {
tb->commitLocal(m_store);
if (numMsgs < m_perfTestParams.m_numMsgs) {
- tb = new qpid::broker::TxnBuffer(m_resultQueue);
+ tb = new qpid::broker::SimpleTxnBuffer(m_resultQueue);
}
opsInTxnCnt = 0U;
}
} else {
// --- Non-transactional dequeue ---
- for (std::deque<boost::shared_ptr<DeliveryRecord> >::iterator i = m_unacked.begin(); i != m_unacked.end(); ++i) {
+ for (std::deque<boost::shared_ptr<qpid::broker::SimpleDeliveryRecord> >::iterator i = m_unacked.begin(); i != m_unacked.end(); ++i) {
(*i)->accept();
}
m_unacked.clear();
Modified: qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/MessageConsumer.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/MessageConsumer.h?rev=1368006&r1=1368005&r2=1368006&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/MessageConsumer.h (original)
+++ qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/MessageConsumer.h Wed Aug 1 14:05:21 2012
@@ -24,44 +24,44 @@
#ifndef tests_storePerftools_asyncPerf_MessageConsumer_h_
#define tests_storePerftools_asyncPerf_MessageConsumer_h_
+#include "qpid/broker/SimpleConsumer.h"
+
#include "boost/shared_ptr.hpp"
#include <deque>
namespace qpid {
-namespace asyncStore {
-class AsyncStoreImpl;
-}
namespace broker {
class AsyncResultQueue;
+class AsyncStore;
+class SimpleDeliveryRecord;
+class SimpleQueue;
}}
namespace tests {
namespace storePerftools {
namespace asyncPerf {
-class DeliveryRecord;
-class SimpleQueue;
class TestOptions;
-class MessageConsumer
+class MessageConsumer: public qpid::broker::SimpleConsumer
{
public:
MessageConsumer(const TestOptions& perfTestParams,
- qpid::asyncStore::AsyncStoreImpl* store,
+ qpid::broker::AsyncStore* store,
qpid::broker::AsyncResultQueue& arq,
- boost::shared_ptr<SimpleQueue> queue);
+ boost::shared_ptr<qpid::broker::SimpleQueue> queue);
virtual ~MessageConsumer();
- void record(boost::shared_ptr<DeliveryRecord> dr);
+ void record(boost::shared_ptr<qpid::broker::SimpleDeliveryRecord> dr);
void commitComplete();
void* runConsumers();
static void* startConsumers(void* ptr);
private:
const TestOptions& m_perfTestParams;
- qpid::asyncStore::AsyncStoreImpl* m_store;
+ qpid::broker::AsyncStore* m_store;
qpid::broker::AsyncResultQueue& m_resultQueue;
- boost::shared_ptr<SimpleQueue> m_queue;
- std::deque<boost::shared_ptr<DeliveryRecord> > m_unacked;
+ boost::shared_ptr<qpid::broker::SimpleQueue> m_queue;
+ std::deque<boost::shared_ptr<qpid::broker::SimpleDeliveryRecord> > m_unacked;
};
}}} // namespace tests::storePerftools::asyncPerf
Modified: qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/MessageProducer.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/MessageProducer.cpp?rev=1368006&r1=1368005&r2=1368006&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/MessageProducer.cpp (original)
+++ qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/MessageProducer.cpp Wed Aug 1 14:05:21 2012
@@ -23,13 +23,12 @@
#include "MessageProducer.h"
-#include "SimpleMessage.h"
-#include "SimpleQueue.h"
#include "TestOptions.h"
-#include "TxnPublish.h"
-#include "qpid/asyncStore/AsyncStoreImpl.h"
-#include "qpid/broker/TxnBuffer.h"
+#include "qpid/broker/SimpleMessage.h"
+#include "qpid/broker/SimpleQueue.h"
+#include "qpid/broker/SimpleTxnBuffer.h"
+#include "qpid/broker/SimpleTxnPublish.h"
#include <stdint.h> // uint32_t
@@ -39,9 +38,9 @@ namespace asyncPerf {
MessageProducer::MessageProducer(const TestOptions& perfTestParams,
const char* msgData,
- qpid::asyncStore::AsyncStoreImpl* store,
+ qpid::broker::AsyncStore* store,
qpid::broker::AsyncResultQueue& arq,
- boost::shared_ptr<SimpleQueue> queue) :
+ boost::shared_ptr<qpid::broker::SimpleQueue> queue) :
m_perfTestParams(perfTestParams),
m_msgData(msgData),
m_store(store),
@@ -55,14 +54,14 @@ void*
MessageProducer::runProducers() {
const bool useTxns = m_perfTestParams.m_enqTxnBlockSize > 0U;
uint16_t recsInTxnCnt = 0U;
- qpid::broker::TxnBuffer* tb = 0;
+ qpid::broker::SimpleTxnBuffer* tb = 0;
if (useTxns) {
- tb = new qpid::broker::TxnBuffer(m_resultQueue);
+ tb = new qpid::broker::SimpleTxnBuffer(m_resultQueue);
}
for (uint32_t numMsgs=0; numMsgs<m_perfTestParams.m_numMsgs; ++numMsgs) {
- boost::intrusive_ptr<SimpleMessage> msg(new SimpleMessage(m_msgData, m_perfTestParams.m_msgSize, m_store));
+ boost::intrusive_ptr<qpid::broker::SimpleMessage> msg(new qpid::broker::SimpleMessage(m_msgData, m_perfTestParams.m_msgSize, m_store));
if (useTxns) {
- boost::shared_ptr<TxnPublish> op(new TxnPublish(msg));
+ boost::shared_ptr<qpid::broker::SimpleTxnPublish> op(new qpid::broker::SimpleTxnPublish(msg));
op->deliverTo(m_queue);
tb->enlist(op);
if (++recsInTxnCnt >= m_perfTestParams.m_enqTxnBlockSize) {
@@ -72,7 +71,7 @@ MessageProducer::runProducers() {
// transaction until the current commit cycle completes. So use another instance. This
// instance should auto-delete when the async commit cycle completes.
if ((numMsgs + 1) < m_perfTestParams.m_numMsgs) {
- tb = new qpid::broker::TxnBuffer(m_resultQueue);
+ tb = new qpid::broker::SimpleTxnBuffer(m_resultQueue);
}
recsInTxnCnt = 0U;
}
Modified: qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/MessageProducer.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/MessageProducer.h?rev=1368006&r1=1368005&r2=1368006&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/MessageProducer.h (original)
+++ qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/MessageProducer.h Wed Aug 1 14:05:21 2012
@@ -27,19 +27,17 @@
#include "boost/shared_ptr.hpp"
namespace qpid {
-namespace asyncStore {
-class AsyncStoreImpl;
-}
namespace broker {
class AsyncResultQueue;
-class TxnBuffer;
+class AsyncStore;
+class SimpleQueue;
+class SimpleTxnBuffer;
}}
namespace tests {
namespace storePerftools {
namespace asyncPerf {
-class SimpleQueue;
class TestOptions;
class MessageProducer
@@ -47,18 +45,18 @@ class MessageProducer
public:
MessageProducer(const TestOptions& perfTestParams,
const char* msgData,
- qpid::asyncStore::AsyncStoreImpl* store,
+ qpid::broker::AsyncStore* store,
qpid::broker::AsyncResultQueue& arq,
- boost::shared_ptr<SimpleQueue> queue);
+ boost::shared_ptr<qpid::broker::SimpleQueue> queue);
virtual ~MessageProducer();
void* runProducers();
static void* startProducers(void* ptr);
private:
const TestOptions& m_perfTestParams;
const char* m_msgData;
- qpid::asyncStore::AsyncStoreImpl* m_store;
+ qpid::broker::AsyncStore* m_store;
qpid::broker::AsyncResultQueue& m_resultQueue;
- boost::shared_ptr<SimpleQueue> m_queue;
+ boost::shared_ptr<qpid::broker::SimpleQueue> m_queue;
};
}}} // namespace tests::storePerftools::asyncPerf
Modified: qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/PerfTest.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/PerfTest.cpp?rev=1368006&r1=1368005&r2=1368006&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/PerfTest.cpp (original)
+++ qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/PerfTest.cpp Wed Aug 1 14:05:21 2012
@@ -25,7 +25,6 @@
#include "MessageConsumer.h"
#include "MessageProducer.h"
-#include "SimpleQueue.h"
#include "tests/storePerftools/version.h"
#include "tests/storePerftools/common/ScopedTimer.h"
@@ -34,6 +33,7 @@
#include "qpid/Modules.h" // Use with loading store as module
#include "qpid/asyncStore/AsyncStoreImpl.h"
#include "qpid/asyncStore/AsyncStoreOptions.h"
+#include "qpid/broker/SimpleQueue.h"
#include <iomanip>
@@ -55,8 +55,7 @@ PerfTest::PerfTest(const TestOptions& to
std::memset((void*)m_msgData, 0, (size_t)to.m_msgSize);
}
-PerfTest::~PerfTest()
-{
+PerfTest::~PerfTest() {
m_poller->shutdown();
m_pollingThread.join();
@@ -68,8 +67,7 @@ PerfTest::~PerfTest()
}
void
-PerfTest::run()
-{
+PerfTest::run() {
if (m_testOpts.m_durable) {
prepareStore();
}
@@ -113,8 +111,7 @@ PerfTest::run()
}
void
-PerfTest::toStream(std::ostream& os) const
-{
+PerfTest::toStream(std::ostream& os) const {
m_testOpts.printVals(os);
os << std::endl;
m_storeOpts.printVals(os);
@@ -124,16 +121,15 @@ PerfTest::toStream(std::ostream& os) con
// private
void
-PerfTest::prepareStore()
-{
- m_store = new qpid::asyncStore::AsyncStoreImpl(m_poller, m_storeOpts);
- m_store->initialize();
+PerfTest::prepareStore() {
+ qpid::asyncStore::AsyncStoreImpl* s = new qpid::asyncStore::AsyncStoreImpl(m_poller, m_storeOpts);
+ s->initialize();
+ m_store = s;
}
// private
void
-PerfTest::destroyStore()
-{
+PerfTest::destroyStore() {
if (m_store) {
delete m_store;
}
@@ -141,12 +137,11 @@ PerfTest::destroyStore()
// private
void
-PerfTest::prepareQueues()
-{
+PerfTest::prepareQueues() {
for (uint16_t i = 0; i < m_testOpts.m_numQueues; ++i) {
std::ostringstream qname;
qname << "queue_" << std::setw(4) << std::setfill('0') << i;
- boost::shared_ptr<SimpleQueue> mpq(new SimpleQueue(qname.str(), m_queueArgs, m_store, m_resultQueue));
+ boost::shared_ptr<qpid::broker::SimpleQueue> mpq(new qpid::broker::SimpleQueue(qname.str(), m_queueArgs, m_store, m_resultQueue));
mpq->asyncCreate();
m_queueList.push_back(mpq);
}
@@ -154,8 +149,7 @@ PerfTest::prepareQueues()
// private
void
-PerfTest::destroyQueues()
-{
+PerfTest::destroyQueues() {
while (m_queueList.size() > 0) {
m_queueList.front()->asyncDestroy(m_testOpts.m_destroyQueuesOnCompletion);
m_queueList.pop_front();
@@ -163,8 +157,7 @@ PerfTest::destroyQueues()
}
int
-runPerfTest(int argc, char** argv)
-{
+runPerfTest(int argc, char** argv) {
// Load async store module
qpid::tryShlib ("asyncStore.so", false);
@@ -212,7 +205,6 @@ runPerfTest(int argc, char** argv)
// -----------------------------------------------------------------
int
-main(int argc, char** argv)
-{
+main(int argc, char** argv) {
return tests::storePerftools::asyncPerf::runPerfTest(argc, argv);
}
Modified: qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/PerfTest.h
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/PerfTest.h?rev=1368006&r1=1368005&r2=1368006&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/PerfTest.h (original)
+++ qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/PerfTest.h Wed Aug 1 14:05:21 2012
@@ -37,9 +37,11 @@
namespace qpid {
namespace asyncStore {
-class AsyncStoreImpl;
class AsyncStoreOptions;
}
+namespace broker {
+class SimpleQueue;
+}
namespace sys {
class Poller;
}}
@@ -48,7 +50,6 @@ namespace tests {
namespace storePerftools {
namespace asyncPerf {
-class SimpleQueue;
class MessageConsumer;
class MessageProducer;
class TestOptions;
@@ -73,8 +74,8 @@ private:
boost::shared_ptr<qpid::sys::Poller> m_poller;
qpid::sys::Thread m_pollingThread;
qpid::broker::AsyncResultQueueImpl m_resultQueue;
- qpid::asyncStore::AsyncStoreImpl* m_store;
- std::deque<boost::shared_ptr<SimpleQueue> > m_queueList;
+ qpid::broker::AsyncStore* m_store;
+ std::deque<boost::shared_ptr<qpid::broker::SimpleQueue> > m_queueList;
std::deque<boost::shared_ptr<MessageProducer> > m_producers;
std::deque<boost::shared_ptr<MessageConsumer> > m_consumers;
Modified: qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/TestOptions.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/TestOptions.cpp?rev=1368006&r1=1368005&r2=1368006&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/TestOptions.cpp (original)
+++ qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/TestOptions.cpp Wed Aug 1 14:05:21 2012
@@ -62,12 +62,10 @@ TestOptions::TestOptions(const uint32_t
doAddOptions();
}
-TestOptions::~TestOptions()
-{}
+TestOptions::~TestOptions() {}
void
-TestOptions::printVals(std::ostream& os) const
-{
+TestOptions::printVals(std::ostream& os) const {
tests::storePerftools::common::TestOptions::printVals(os);
os << " Num enqueus per transaction [-t, --enq-txn-size]: " << m_enqTxnBlockSize << std::endl;
os << " Num dequeues per transaction [-d, --deq-txn-size]: " << m_deqTxnBlockSize << std::endl;
@@ -77,8 +75,7 @@ TestOptions::printVals(std::ostream& os)
// private
void
-TestOptions::doAddOptions()
-{
+TestOptions::doAddOptions() {
addOptions()
("enq-txn-size,t", qpid::optValue(m_enqTxnBlockSize, "N"),
"Num enqueus per transaction (0 = no transactions)")
Modified: qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/TestResult.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/TestResult.cpp?rev=1368006&r1=1368005&r2=1368006&view=diff
==============================================================================
--- qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/TestResult.cpp (original)
+++ qpid/branches/asyncstore/cpp/src/tests/storePerftools/asyncPerf/TestResult.cpp Wed Aug 1 14:05:21 2012
@@ -32,12 +32,10 @@ TestResult::TestResult(const TestOptions
m_testOpts(to)
{}
-TestResult::~TestResult()
-{}
+TestResult::~TestResult() {}
void
-TestResult::toStream(std::ostream& os) const
-{
+TestResult::toStream(std::ostream& os) const {
double msgsRate;
os << "TEST RESULTS:" << std::endl;
os << " Msgs per thread: " << m_testOpts.m_numMsgs << std::endl;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org