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 | add4380ec811d23d0808b3b59dc74160e829f277 (patch) | |
| tree | 52c5bb92d9c2deff0b54439129aea4d3e73e4ac6 /cpp/include | |
| parent | 809082c99f22aa6026638110315b9ec9229254e9 (diff) | |
| download | qpid-python-add4380ec811d23d0808b3b59dc74160e829f277.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/qpid@1343350 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/include')
| -rw-r--r-- | cpp/include/qpid/framing/SequenceNumber.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/cpp/include/qpid/framing/SequenceNumber.h b/cpp/include/qpid/framing/SequenceNumber.h index dd85d97a52..00fa2469c8 100644 --- a/cpp/include/qpid/framing/SequenceNumber.h +++ b/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 |
