summaryrefslogtreecommitdiff
path: root/qpid/cpp/include
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
commit1d55ce68b88256a4de0329d3104436b0c581000c (patch)
treee94c576b90ee33caddd96d6efccdbf2bab51080c /qpid/cpp/include
parent0fb93ca81a3517d66339b3e890282ea4c82546a9 (diff)
downloadqpid-python-1d55ce68b88256a4de0329d3104436b0c581000c.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@1493771 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/include')
-rw-r--r--qpid/cpp/include/qpid/types/Uuid.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/qpid/cpp/include/qpid/types/Uuid.h b/qpid/cpp/include/qpid/types/Uuid.h
index 02af4c7e7f..5e3ee94db0 100644
--- a/qpid/cpp/include/qpid/types/Uuid.h
+++ b/qpid/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*/