diff options
author | Kim van der Riet <kpvdr@apache.org> | 2012-07-24 18:27:54 +0000 |
---|---|---|
committer | Kim van der Riet <kpvdr@apache.org> | 2012-07-24 18:27:54 +0000 |
commit | 75e9139d60bc049fabf9b3b779ddd157bb5160bb (patch) | |
tree | f2f3d1e43cc42428518270a39a8264f41c478648 /cpp/src | |
parent | dd79efca55e3ff0a0e0c25e395967ce9b3f80482 (diff) | |
download | qpid-python-75e9139d60bc049fabf9b3b779ddd157bb5160bb.tar.gz |
QPID-3858: WIP: Renamed AsyncTransaction to AsyncTransactionalStore; changed some of the broker contexts to more specific classes.
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1365207 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/asyncStore/AsyncOperation.cpp | 31 | ||||
-rw-r--r-- | cpp/src/qpid/asyncStore/AsyncOperation.h | 12 | ||||
-rw-r--r-- | cpp/src/qpid/asyncStore/AsyncStoreImpl.cpp | 52 | ||||
-rw-r--r-- | cpp/src/qpid/asyncStore/AsyncStoreImpl.h | 20 | ||||
-rw-r--r-- | cpp/src/qpid/broker/AsyncStore.h | 30 | ||||
-rw-r--r-- | cpp/src/qpid/broker/TxnAsyncContext.h | 23 | ||||
-rw-r--r-- | cpp/src/qpid/broker/TxnBuffer.cpp | 2 | ||||
-rw-r--r-- | cpp/src/qpid/broker/TxnBuffer.h | 6 | ||||
-rw-r--r-- | cpp/src/tests/asyncstore.cmake | 1 | ||||
-rw-r--r-- | cpp/src/tests/storePerftools/asyncPerf/TxnPublish.cpp | 5 |
10 files changed, 100 insertions, 82 deletions
diff --git a/cpp/src/qpid/asyncStore/AsyncOperation.cpp b/cpp/src/qpid/asyncStore/AsyncOperation.cpp index a22f803fcd..0e3586854c 100644 --- a/cpp/src/qpid/asyncStore/AsyncOperation.cpp +++ b/cpp/src/qpid/asyncStore/AsyncOperation.cpp @@ -23,11 +23,10 @@ #include "AsyncOperation.h" -//#include "qpid/Exception.h" #include "qpid/broker/AsyncResultHandle.h" #include "qpid/broker/AsyncResultHandleImpl.h" - -//#include <sstream> +#include "qpid/broker/QueueAsyncContext.h" +#include "qpid/broker/TxnAsyncContext.h" namespace qpid { namespace asyncStore { @@ -68,8 +67,8 @@ AsyncOperation::submitResult(const int errNo, // --- class AsyncOpTxnPrepare --- AsyncOpTxnPrepare::AsyncOpTxnPrepare(qpid::broker::TxnHandle& txnHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt) : - AsyncOperation(brokerCtxt), + boost::shared_ptr<qpid::broker::TpcTxnAsyncContext> txnCtxt) : + AsyncOperation(boost::dynamic_pointer_cast<qpid::broker::BrokerAsyncContext>(txnCtxt)), m_txnHandle(txnHandle) {} @@ -91,8 +90,8 @@ AsyncOpTxnPrepare::getOpStr() const { // --- class AsyncOpTxnCommit --- AsyncOpTxnCommit::AsyncOpTxnCommit(qpid::broker::TxnHandle& txnHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt) : - AsyncOperation(brokerCtxt), + boost::shared_ptr<qpid::broker::TxnAsyncContext> txnCtxt) : + AsyncOperation(boost::dynamic_pointer_cast<qpid::broker::BrokerAsyncContext>(txnCtxt)), m_txnHandle(txnHandle) {} @@ -113,8 +112,8 @@ AsyncOpTxnCommit::getOpStr() const { // --- class AsyncOpTxnAbort --- AsyncOpTxnAbort::AsyncOpTxnAbort(qpid::broker::TxnHandle& txnHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt) : - AsyncOperation(brokerCtxt), + boost::shared_ptr<qpid::broker::TxnAsyncContext> txnCtxt) : + AsyncOperation(boost::dynamic_pointer_cast<qpid::broker::BrokerAsyncContext>(txnCtxt)), m_txnHandle(txnHandle) {} @@ -181,9 +180,9 @@ AsyncOpConfigDestroy::getOpStr() const { // --- class AsyncOpQueueCreate --- AsyncOpQueueCreate::AsyncOpQueueCreate(qpid::broker::QueueHandle& queueHandle, - const qpid::broker::DataSource* const data, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt) : - AsyncOperation(brokerCtxt), + const qpid::broker::DataSource* const data, + boost::shared_ptr<qpid::broker::QueueAsyncContext> queueCtxt) : + AsyncOperation(boost::dynamic_pointer_cast<qpid::broker::BrokerAsyncContext>(queueCtxt)), m_queueHandle(queueHandle), m_data(data) {} @@ -205,8 +204,8 @@ AsyncOpQueueCreate::getOpStr() const { // --- class AsyncOpQueueFlush --- AsyncOpQueueFlush::AsyncOpQueueFlush(qpid::broker::QueueHandle& queueHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt) : - AsyncOperation(brokerCtxt), + boost::shared_ptr<qpid::broker::QueueAsyncContext> queueCtxt) : + AsyncOperation(boost::dynamic_pointer_cast<qpid::broker::BrokerAsyncContext>(queueCtxt)), m_queueHandle(queueHandle) {} @@ -227,8 +226,8 @@ AsyncOpQueueFlush::getOpStr() const { // --- class AsyncOpQueueDestroy --- AsyncOpQueueDestroy::AsyncOpQueueDestroy(qpid::broker::QueueHandle& queueHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt) : - AsyncOperation(brokerCtxt), + boost::shared_ptr<qpid::broker::QueueAsyncContext> queueCtxt) : + AsyncOperation(boost::dynamic_pointer_cast<qpid::broker::BrokerAsyncContext>(queueCtxt)), m_queueHandle(queueHandle) {} diff --git a/cpp/src/qpid/asyncStore/AsyncOperation.h b/cpp/src/qpid/asyncStore/AsyncOperation.h index 2b195d7443..2894816ca4 100644 --- a/cpp/src/qpid/asyncStore/AsyncOperation.h +++ b/cpp/src/qpid/asyncStore/AsyncOperation.h @@ -51,7 +51,7 @@ private: class AsyncOpTxnPrepare: public qpid::asyncStore::AsyncOperation { public: AsyncOpTxnPrepare(qpid::broker::TxnHandle& txnHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt); + boost::shared_ptr<qpid::broker::TpcTxnAsyncContext> txnCtxt); virtual ~AsyncOpTxnPrepare(); virtual void executeOp(boost::shared_ptr<AsyncStoreImpl> store); virtual const char* getOpStr() const; @@ -63,7 +63,7 @@ private: class AsyncOpTxnCommit: public qpid::asyncStore::AsyncOperation { public: AsyncOpTxnCommit(qpid::broker::TxnHandle& txnHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt); + boost::shared_ptr<qpid::broker::TxnAsyncContext> txnCtxt); virtual ~AsyncOpTxnCommit(); virtual void executeOp(boost::shared_ptr<AsyncStoreImpl> store); virtual const char* getOpStr() const; @@ -75,7 +75,7 @@ private: class AsyncOpTxnAbort: public qpid::asyncStore::AsyncOperation { public: AsyncOpTxnAbort(qpid::broker::TxnHandle& txnHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt); + boost::shared_ptr<qpid::broker::TxnAsyncContext> txnCtxt); virtual ~AsyncOpTxnAbort(); virtual void executeOp(boost::shared_ptr<AsyncStoreImpl> store); virtual const char* getOpStr() const; @@ -114,7 +114,7 @@ class AsyncOpQueueCreate: public qpid::asyncStore::AsyncOperation { public: AsyncOpQueueCreate(qpid::broker::QueueHandle& queueHandle, const qpid::broker::DataSource* const data, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt); + boost::shared_ptr<qpid::broker::QueueAsyncContext> queueCtxt); virtual ~AsyncOpQueueCreate(); virtual void executeOp(boost::shared_ptr<AsyncStoreImpl> store); virtual const char* getOpStr() const; @@ -127,7 +127,7 @@ private: class AsyncOpQueueFlush: public qpid::asyncStore::AsyncOperation { public: AsyncOpQueueFlush(qpid::broker::QueueHandle& queueHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt); + boost::shared_ptr<qpid::broker::QueueAsyncContext> queueCtxt); virtual ~AsyncOpQueueFlush(); virtual void executeOp(boost::shared_ptr<AsyncStoreImpl> store); virtual const char* getOpStr() const; @@ -139,7 +139,7 @@ private: class AsyncOpQueueDestroy: public qpid::asyncStore::AsyncOperation { public: AsyncOpQueueDestroy(qpid::broker::QueueHandle& queueHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt); + boost::shared_ptr<qpid::broker::QueueAsyncContext> queueCtxt); virtual ~AsyncOpQueueDestroy(); virtual void executeOp(boost::shared_ptr<AsyncStoreImpl> store); virtual const char* getOpStr() const; diff --git a/cpp/src/qpid/asyncStore/AsyncStoreImpl.cpp b/cpp/src/qpid/asyncStore/AsyncStoreImpl.cpp index e8379b95e2..4aeab4c7bf 100644 --- a/cpp/src/qpid/asyncStore/AsyncStoreImpl.cpp +++ b/cpp/src/qpid/asyncStore/AsyncStoreImpl.cpp @@ -35,11 +35,11 @@ #include "qpid/broker/EnqueueHandle.h" #include "qpid/broker/EventHandle.h" #include "qpid/broker/MessageHandle.h" +#include "qpid/broker/QueueAsyncContext.h" #include "qpid/broker/QueueHandle.h" +#include "qpid/broker/TxnAsyncContext.h" #include "qpid/broker/TxnHandle.h" -//#include <boost/make_shared.hpp> - namespace qpid { namespace asyncStore { @@ -95,28 +95,28 @@ AsyncStoreImpl::createTxnHandle(const std::string& xid, void AsyncStoreImpl::submitPrepare(qpid::broker::TxnHandle& txnHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt) + boost::shared_ptr<qpid::broker::TpcTxnAsyncContext> TxnCtxt) { - boost::shared_ptr<const AsyncOperation> op(new AsyncOpTxnPrepare(txnHandle, brokerCtxt)); - brokerCtxt->setOpStr(op->getOpStr()); + boost::shared_ptr<const AsyncOperation> op(new AsyncOpTxnPrepare(txnHandle, TxnCtxt)); + TxnCtxt->setOpStr(op->getOpStr()); m_operations.submit(op); } void AsyncStoreImpl::submitCommit(qpid::broker::TxnHandle& txnHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt) + boost::shared_ptr<qpid::broker::TxnAsyncContext> TxnCtxt) { - boost::shared_ptr<const AsyncOperation> op(new AsyncOpTxnCommit(txnHandle, brokerCtxt)); - brokerCtxt->setOpStr(op->getOpStr()); + boost::shared_ptr<const AsyncOperation> op(new AsyncOpTxnCommit(txnHandle, TxnCtxt)); + TxnCtxt->setOpStr(op->getOpStr()); m_operations.submit(op); } void AsyncStoreImpl::submitAbort(qpid::broker::TxnHandle& txnHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt) + boost::shared_ptr<qpid::broker::TxnAsyncContext> TxnCtxt) { - boost::shared_ptr<const AsyncOperation> op(new AsyncOpTxnAbort(txnHandle, brokerCtxt)); - brokerCtxt->setOpStr(op->getOpStr()); + boost::shared_ptr<const AsyncOperation> op(new AsyncOpTxnAbort(txnHandle, TxnCtxt)); + TxnCtxt->setOpStr(op->getOpStr()); m_operations.submit(op); } @@ -178,28 +178,28 @@ AsyncStoreImpl::submitDestroy(qpid::broker::ConfigHandle& cfgHandle, void AsyncStoreImpl::submitCreate(qpid::broker::QueueHandle& queueHandle, const qpid::broker::DataSource* const dataSrc, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt) + boost::shared_ptr<qpid::broker::QueueAsyncContext> QueueCtxt) { - boost::shared_ptr<const AsyncOperation> op(new AsyncOpQueueCreate(queueHandle, dataSrc, brokerCtxt)); - brokerCtxt->setOpStr(op->getOpStr()); + boost::shared_ptr<const AsyncOperation> op(new AsyncOpQueueCreate(queueHandle, dataSrc, QueueCtxt)); + QueueCtxt->setOpStr(op->getOpStr()); m_operations.submit(op); } void AsyncStoreImpl::submitDestroy(qpid::broker::QueueHandle& queueHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt) + boost::shared_ptr<qpid::broker::QueueAsyncContext> QueueCtxt) { - boost::shared_ptr<const AsyncOperation> op(new AsyncOpQueueDestroy(queueHandle, brokerCtxt)); - brokerCtxt->setOpStr(op->getOpStr()); + boost::shared_ptr<const AsyncOperation> op(new AsyncOpQueueDestroy(queueHandle, QueueCtxt)); + QueueCtxt->setOpStr(op->getOpStr()); m_operations.submit(op); } void AsyncStoreImpl::submitFlush(qpid::broker::QueueHandle& queueHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt) + boost::shared_ptr<qpid::broker::QueueAsyncContext> QueueCtxt) { - boost::shared_ptr<const AsyncOperation> op(new AsyncOpQueueFlush(queueHandle, brokerCtxt)); - brokerCtxt->setOpStr(op->getOpStr()); + boost::shared_ptr<const AsyncOperation> op(new AsyncOpQueueFlush(queueHandle, QueueCtxt)); + QueueCtxt->setOpStr(op->getOpStr()); m_operations.submit(op); } @@ -227,20 +227,20 @@ AsyncStoreImpl::submitDestroy(qpid::broker::EventHandle& eventHandle, void AsyncStoreImpl::submitEnqueue(qpid::broker::EnqueueHandle& enqHandle, qpid::broker::TxnHandle& txnHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt) + boost::shared_ptr<qpid::broker::QueueAsyncContext> QueueCtxt) { - boost::shared_ptr<const AsyncOperation> op(new AsyncOpMsgEnqueue(enqHandle, txnHandle, brokerCtxt)); - brokerCtxt->setOpStr(op->getOpStr()); + boost::shared_ptr<const AsyncOperation> op(new AsyncOpMsgEnqueue(enqHandle, txnHandle, QueueCtxt)); + QueueCtxt->setOpStr(op->getOpStr()); m_operations.submit(op); } void AsyncStoreImpl::submitDequeue(qpid::broker::EnqueueHandle& enqHandle, qpid::broker::TxnHandle& txnHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt) + boost::shared_ptr<qpid::broker::QueueAsyncContext> QueueCtxt) { - boost::shared_ptr<const AsyncOperation> op(new AsyncOpMsgDequeue(enqHandle, txnHandle, brokerCtxt)); - brokerCtxt->setOpStr(op->getOpStr()); + boost::shared_ptr<const AsyncOperation> op(new AsyncOpMsgDequeue(enqHandle, txnHandle, QueueCtxt)); + QueueCtxt->setOpStr(op->getOpStr()); m_operations.submit(op); } diff --git a/cpp/src/qpid/asyncStore/AsyncStoreImpl.h b/cpp/src/qpid/asyncStore/AsyncStoreImpl.h index 7dee03dc6d..3e29039aea 100644 --- a/cpp/src/qpid/asyncStore/AsyncStoreImpl.h +++ b/cpp/src/qpid/asyncStore/AsyncStoreImpl.h @@ -42,7 +42,9 @@ class Poller; namespace asyncStore { -class AsyncStoreImpl : public qpid::broker::AsyncStore { +class AsyncStoreImpl : public qpid::broker::AsyncTransactionalStore, + public qpid::broker::AsyncStore +{ public: AsyncStoreImpl(boost::shared_ptr<qpid::sys::Poller> poller, const AsyncStoreOptions& opts); @@ -63,11 +65,11 @@ public: qpid::broker::TxnBuffer* tb); void submitPrepare(qpid::broker::TxnHandle& txnHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt); + boost::shared_ptr<qpid::broker::TpcTxnAsyncContext> TxnCtxt); void submitCommit(qpid::broker::TxnHandle& txnHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt); + boost::shared_ptr<qpid::broker::TxnAsyncContext> TxnCtxt); void submitAbort(qpid::broker::TxnHandle& txnHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt); + boost::shared_ptr<qpid::broker::TxnAsyncContext> TxnCtxt); // --- Interface from AsyncStore --- @@ -89,11 +91,11 @@ public: void submitCreate(qpid::broker::QueueHandle& queueHandle, const qpid::broker::DataSource* const dataSrc, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt); + boost::shared_ptr<qpid::broker::QueueAsyncContext> QueueCtxt); void submitDestroy(qpid::broker::QueueHandle& queueHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt); + boost::shared_ptr<qpid::broker::QueueAsyncContext> QueueCtxt); void submitFlush(qpid::broker::QueueHandle& queueHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt); + boost::shared_ptr<qpid::broker::QueueAsyncContext> QueueCtxt); void submitCreate(qpid::broker::EventHandle& eventHandle, const qpid::broker::DataSource* const dataSrc, @@ -105,10 +107,10 @@ public: void submitEnqueue(qpid::broker::EnqueueHandle& enqHandle, qpid::broker::TxnHandle& txnHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt); + boost::shared_ptr<qpid::broker::QueueAsyncContext> QueueCtxt); void submitDequeue(qpid::broker::EnqueueHandle& enqHandle, qpid::broker::TxnHandle& txnHandle, - boost::shared_ptr<qpid::broker::BrokerAsyncContext> brokerCtxt); + boost::shared_ptr<qpid::broker::QueueAsyncContext> QueueCtxt); // Legacy - Restore FTD message, is NOT async! virtual int loadContent(qpid::broker::MessageHandle& msgHandle, diff --git a/cpp/src/qpid/broker/AsyncStore.h b/cpp/src/qpid/broker/AsyncStore.h index 1c8f4b0737..5fb2e0a1eb 100644 --- a/cpp/src/qpid/broker/AsyncStore.h +++ b/cpp/src/qpid/broker/AsyncStore.h @@ -68,11 +68,14 @@ class MessageHandle; class QueueHandle; class TxnHandle; +class QueueAsyncContext; +class TpcTxnAsyncContext; +class TxnAsyncContext; class TxnBuffer; -class AsyncTransaction { +class AsyncTransactionalStore { public: - virtual ~AsyncTransaction() {} + virtual ~AsyncTransactionalStore() {} virtual TxnHandle createTxnHandle() = 0; virtual TxnHandle createTxnHandle(TxnBuffer* tb) = 0; @@ -82,16 +85,16 @@ public: // TODO: Remove boost::shared_ptr<BrokerAsyncContext> from this interface virtual void submitPrepare(TxnHandle&, - boost::shared_ptr<BrokerAsyncContext>) = 0; // Distributed txns only + boost::shared_ptr<TpcTxnAsyncContext>) = 0; // Distributed txns only virtual void submitCommit(TxnHandle&, - boost::shared_ptr<BrokerAsyncContext>) = 0; + boost::shared_ptr<TxnAsyncContext>) = 0; virtual void submitAbort(TxnHandle&, - boost::shared_ptr<BrokerAsyncContext>) = 0; + boost::shared_ptr<TxnAsyncContext>) = 0; void testOp() const {} }; // Subclassed by store: -class AsyncStore : public AsyncTransaction { +class AsyncStore { public: virtual ~AsyncStore() {} @@ -110,6 +113,9 @@ public: // --- Store async interface --- // TODO: Remove boost::shared_ptr<BrokerAsyncContext> from this interface + + // TODO: Switch from BrokerAsyncContext (parent class) to ConfigAsyncContext + // when theses features (and async context classes) are developed. virtual void submitCreate(ConfigHandle&, const DataSource* const, boost::shared_ptr<BrokerAsyncContext>) = 0; @@ -118,12 +124,14 @@ public: virtual void submitCreate(QueueHandle&, const DataSource* const, - boost::shared_ptr<BrokerAsyncContext>) = 0; + boost::shared_ptr<QueueAsyncContext>) = 0; virtual void submitDestroy(QueueHandle&, - boost::shared_ptr<BrokerAsyncContext>) = 0; + boost::shared_ptr<QueueAsyncContext>) = 0; virtual void submitFlush(QueueHandle&, - boost::shared_ptr<BrokerAsyncContext>) = 0; + boost::shared_ptr<QueueAsyncContext>) = 0; + // TODO: Switch from BrokerAsyncContext (parent class) to EventAsyncContext + // when theses features (and async context classes) are developed. virtual void submitCreate(EventHandle&, const DataSource* const, TxnHandle&, @@ -134,10 +142,10 @@ public: virtual void submitEnqueue(EnqueueHandle&, TxnHandle&, - boost::shared_ptr<BrokerAsyncContext>) = 0; + boost::shared_ptr<QueueAsyncContext>) = 0; virtual void submitDequeue(EnqueueHandle&, TxnHandle&, - boost::shared_ptr<BrokerAsyncContext>) = 0; + boost::shared_ptr<QueueAsyncContext>) = 0; // Legacy - Restore FTD message, is NOT async! virtual int loadContent(MessageHandle&, diff --git a/cpp/src/qpid/broker/TxnAsyncContext.h b/cpp/src/qpid/broker/TxnAsyncContext.h index 0c35b110a8..9c617238e8 100644 --- a/cpp/src/qpid/broker/TxnAsyncContext.h +++ b/cpp/src/qpid/broker/TxnAsyncContext.h @@ -29,17 +29,18 @@ #include "qpid/asyncStore/AsyncOperation.h" namespace qpid { -namespace asyncStore { -class AsyncOperation; -} +//namespace asyncStore { +//class AsyncOperation; +//} namespace broker { -class TxnHandle; +class AsyncResultHandle; +class AsyncResultQueue; +//class TxnHandle; typedef void (*AsyncResultCallback)(const AsyncResultHandle* const); -class TxnAsyncContext: public BrokerAsyncContext -{ +class TxnAsyncContext: public BrokerAsyncContext { public: TxnAsyncContext(TxnBuffer* const tb, AsyncResultCallback rcb, @@ -57,6 +58,16 @@ private: AsyncResultQueue* const m_arq; }; +class TpcTxnAsyncContext : public TxnAsyncContext { +public: + TpcTxnAsyncContext(TxnBuffer* const tb, + AsyncResultCallback rcb, + AsyncResultQueue* const arq) : + TxnAsyncContext(tb, rcb, arq) + {} + virtual ~TpcTxnAsyncContext() {} +}; + }} // namespace qpid::broker #endif // qpid_broker_TxnAsyncContext_h_ diff --git a/cpp/src/qpid/broker/TxnBuffer.cpp b/cpp/src/qpid/broker/TxnBuffer.cpp index ba00293452..f85301e036 100644 --- a/cpp/src/qpid/broker/TxnBuffer.cpp +++ b/cpp/src/qpid/broker/TxnBuffer.cpp @@ -81,7 +81,7 @@ TxnBuffer::rollback() } bool -TxnBuffer::commitLocal(AsyncTransaction* const store) +TxnBuffer::commitLocal(AsyncTransactionalStore* const store) { if (store) { try { diff --git a/cpp/src/qpid/broker/TxnBuffer.h b/cpp/src/qpid/broker/TxnBuffer.h index bd9743cad7..7b85a1b6c4 100644 --- a/cpp/src/qpid/broker/TxnBuffer.h +++ b/cpp/src/qpid/broker/TxnBuffer.h @@ -36,7 +36,7 @@ namespace broker { class AsyncResultHandle; class AsyncResultQueue; -class AsyncTransaction; +class AsyncTransactionalStore; class TxnOp; class TxnBuffer { @@ -48,7 +48,7 @@ public: bool prepare(TxnHandle& th); void commit(); void rollback(); - bool commitLocal(AsyncTransaction* const store); + bool commitLocal(AsyncTransactionalStore* const store); // --- Async operations --- void asyncLocalCommit(); @@ -60,7 +60,7 @@ private: std::vector<boost::shared_ptr<TxnOp> > m_ops; qpid::sys::Mutex m_opsMutex; TxnHandle m_txnHandle; - AsyncTransaction* m_store; + AsyncTransactionalStore* m_store; AsyncResultQueue& m_resultQueue; typedef enum {NONE = 0, PREPARE, COMMIT, ROLLBACK, COMPLETE} e_txnState; diff --git a/cpp/src/tests/asyncstore.cmake b/cpp/src/tests/asyncstore.cmake index 2e3081bbc1..9c0fd0c1b5 100644 --- a/cpp/src/tests/asyncstore.cmake +++ b/cpp/src/tests/asyncstore.cmake @@ -59,7 +59,6 @@ set (asyncStorePerf_SOURCES storePerftools/asyncPerf/MessageProducer.cpp storePerftools/asyncPerf/PerfTest.cpp storePerftools/asyncPerf/PersistableQueuedMessage.cpp -# storePerftools/asyncPerf/QueueAsyncContext.cpp storePerftools/asyncPerf/QueuedMessage.cpp storePerftools/asyncPerf/SimpleMessage.cpp storePerftools/asyncPerf/SimpleQueue.cpp diff --git a/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.cpp b/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.cpp index 7a0d6bed33..3d27449aa4 100644 --- a/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.cpp +++ b/cpp/src/tests/storePerftools/asyncPerf/TxnPublish.cpp @@ -29,7 +29,6 @@ #include "SimpleQueue.h" #include "qpid/log/Statement.h" - #include <boost/make_shared.hpp> namespace tests { @@ -100,9 +99,9 @@ TxnPublish::deliverTo(const boost::shared_ptr<SimpleQueue>& queue) { boost::shared_ptr<QueuedMessage> qm; if (m_msg->isPersistent() && queue->getStore()) { - qm = boost::make_shared<PersistableQueuedMessage>(new PersistableQueuedMessage(queue.get(), m_msg)); + qm = boost::shared_ptr<PersistableQueuedMessage>(new PersistableQueuedMessage(queue.get(), m_msg)); } else { - qm = boost::make_shared<QueuedMessage>(new QueuedMessage(queue.get(), m_msg)); + qm = boost::shared_ptr<QueuedMessage>(new QueuedMessage(queue.get(), m_msg)); } m_queues.push_back(qm); m_delivered = true; |