You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Kenneth Giusti <kg...@apache.org> on 2011/06/17 21:59:00 UTC

Review Request: Proposed modifications to C++ Broker / Store interface for QPID-3079

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/934/
-----------------------------------------------------------

Review request for qpid, Gordon Sim, Kim van der Riet, and Steve Huston.


Summary
-------

In order to solve QPID-3079, I'd like to make the following changes to the MessageStore API.

The problem with the existing api is that, when a dequeue() is completed, only the message is notified (via a call to PersistableMessage::dequeueComplete()).  Since a single instance of a message may be dequeued from multiple queues simultaneously, this approach does not provide enough context to allow the broker to identify -which- dequeue is being completed.

The proposed solution is to provide a new method to the PersistableQueue class that is called by the store when a dequeue completes:

  virtual void dequeueComplete(const boost::intrusive_ptr<PersistableMessage>&) = 0;

This allows the broker to identify both the queue that is the source of the dequeue, plus the message that was dequeued.  

I've also modified the MessageStore::dequeue() interface to take a shared_ptr to the queue, much like the intrusive_ptr that is currently used to pass the message.  This allows an asynchronous dequeue to hold a valid pointer to the queue until the dequeue completes.

(Gordon has suggested that I make the same changes to the MessageStore::enqueue() interface for symmetry - something that I'd like to do if there is agreement).

All changes for QPID-3079 are available on the qpid-3079 branch in svn.  The changes included in this review are merely the store-related modifications - I wanted to focus on these separately.  The full review of QPID-3079 is available here: https://reviews.apache.org/r/860/  - and feel free to checkout the branch if you'd like :)


This addresses bug qpid-3079.
    https://issues.apache.org/jira/browse/qpid-3079


Diffs
-----

  /branches/qpid-3079/qpid/cpp/src/qpid/broker/MessageStore.h 1124895 
  /branches/qpid-3079/qpid/cpp/src/qpid/broker/MessageStoreModule.h 1124895 
  /branches/qpid-3079/qpid/cpp/src/qpid/broker/MessageStoreModule.cpp 1124895 
  /branches/qpid-3079/qpid/cpp/src/qpid/broker/PersistableQueue.h 1124895 
  /branches/qpid-3079/qpid/cpp/src/qpid/store/MessageStorePlugin.h 1124895 
  /branches/qpid-3079/qpid/cpp/src/qpid/store/MessageStorePlugin.cpp 1124895 
  /branches/qpid-3079/qpid/cpp/src/qpid/store/StorageProvider.h 1124895 
  /branches/qpid-3079/qpid/cpp/src/qpid/store/ms-clfs/MSSqlClfsProvider.cpp 1124895 
  /branches/qpid-3079/qpid/cpp/src/qpid/store/ms-sql/MSSqlProvider.cpp 1124895 

Diff: https://reviews.apache.org/r/934/diff


Testing
-------

I've tested these changes against the Linux-based store implementation.  I've only verified that the sql stores build under windows thus far - Steve, are there any unit tests for these stores?  If so, is this something I can run?  Otherwise, could you try running them from the qpid-3079 branch and let me know if there are failures?  Thx.


Thanks,

Kenneth