summaryrefslogtreecommitdiff
path: root/cpp/include/qpid
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2013-06-17 14:19:10 +0000
committerAlan Conway <aconway@apache.org>2013-06-17 14:19:10 +0000
commit1093062db03077998823cbefb9ca9645076694ea (patch)
tree577707a6dafe630794aaafd69a7d127ee88a9dbd /cpp/include/qpid
parent1ac5dfc01dbfaa648d5f75eec8b066696f307e61 (diff)
downloadqpid-python-1093062db03077998823cbefb9ca9645076694ea.tar.gz
QPID-4348: HA Use independent sequence numbers for identifying messages
Previously HA code used queue sequence numbers to identify messasges. This assumes that message sequence is identical on primary and backup. Implementing new features (for example transactions) requires that we tolerate ordering differences between primary and backups. This patch introduces a new, queue-scoped HA sequence number managed by the HA plugin. The HA ID is set *before* the message is enqueued and assigned a queue sequence number. This means it is possible to identify messages before they are enqueued, e.g. messages in an open transaction. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1493771 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/include/qpid')
-rw-r--r--cpp/include/qpid/types/Uuid.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/cpp/include/qpid/types/Uuid.h b/cpp/include/qpid/types/Uuid.h
index 02af4c7e7f..5e3ee94db0 100644
--- a/cpp/include/qpid/types/Uuid.h
+++ b/cpp/include/qpid/types/Uuid.h
@@ -57,7 +57,7 @@ class QPID_TYPES_CLASS_EXTERN Uuid
/** String value in format 1b4e28ba-2fa1-11d2-883f-b9a761bde3fb. */
QPID_TYPES_EXTERN std::string str() const;
- QPID_TYPES_EXTERN size_t size() const;
+ QPID_TYPES_EXTERN size_t size() const;
QPID_TYPES_EXTERN const unsigned char* data() const;
friend QPID_TYPES_EXTERN bool operator==(const Uuid&, const Uuid&);
@@ -69,6 +69,14 @@ class QPID_TYPES_CLASS_EXTERN Uuid
friend QPID_TYPES_EXTERN std::ostream& operator<<(std::ostream&, Uuid);
friend QPID_TYPES_EXTERN std::istream& operator>>(std::istream&, Uuid&);
+ /** Hash value suitable for use with unordered_map */
+ size_t hash() const;
+
+ /** Hasher for use with unordered_map */
+ struct Hasher {
+ size_t operator()(const Uuid& u) const { return u.hash(); }
+ };
+
private:
unsigned char bytes[16];
};
@@ -91,4 +99,5 @@ QPID_TYPES_EXTERN std::istream& operator>>(std::istream&, Uuid&);
}} // namespace qpid::types
+
#endif /*!QPID_TYPES_UUID_H*/