diff options
| author | Alan Conway <aconway@apache.org> | 2012-05-28 18:24:31 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2012-05-28 18:24:31 +0000 |
| commit | 7064d141a8c4c33385bf0962d83d4a2797b37dc5 (patch) | |
| tree | 52866311f22c63356f2e1fc41ce58e3a9ac2ed49 /qpid/cpp/include | |
| parent | 9b6714700c49e24825a707dcd3c748d6c0be8be2 (diff) | |
| download | qpid-python-7064d141a8c4c33385bf0962d83d4a2797b37dc5.tar.gz | |
QPID-3603: Failover optimization restored.
A backup broker that fails over to a new primary can avoid downloading messages
that it already has from the previous primary. The backup sends its position to
the primary as a client-arg and the primary sends back any necessary dequeues
and starts replicating after the messages on the backup.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1343350 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/include')
| -rw-r--r-- | qpid/cpp/include/qpid/framing/SequenceNumber.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/qpid/cpp/include/qpid/framing/SequenceNumber.h b/qpid/cpp/include/qpid/framing/SequenceNumber.h index dd85d97a52..00fa2469c8 100644 --- a/qpid/cpp/include/qpid/framing/SequenceNumber.h +++ b/qpid/cpp/include/qpid/framing/SequenceNumber.h @@ -57,12 +57,18 @@ boost::equality_comparable< QPID_COMMON_EXTERN uint32_t encodedSize() const; template <class S> void serialize(S& s) { s(value); } - - friend inline int32_t operator-(const SequenceNumber& a, const SequenceNumber& b); }; inline int32_t operator-(const SequenceNumber& a, const SequenceNumber& b) { - return int32_t(a.value - b.value); + return int32_t(a.getValue() - b.getValue()); +} + +inline SequenceNumber operator+(const SequenceNumber& a, int32_t n) { + return SequenceNumber(a.getValue() + n); +} + +inline SequenceNumber operator-(const SequenceNumber& a, int32_t n) { + return SequenceNumber(a.getValue() - n); } struct Window |
