From ec15d60a2d3cf6d503699c59edec4900a4fa40d8 Mon Sep 17 00:00:00 2001 From: Vlad Zolotarov Date: Fri, 1 Sep 2017 14:47:53 -0400 Subject: [PATCH] db::commitlog::replay_position: added std::hash It's needed for hinted handoff. Signed-off-by: Vlad Zolotarov --- db/commitlog/replay_position.hh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/db/commitlog/replay_position.hh b/db/commitlog/replay_position.hh index 16856ed049..3423741d03 100644 --- a/db/commitlog/replay_position.hh +++ b/db/commitlog/replay_position.hh @@ -42,6 +42,7 @@ #include #include "utils/UUID.hh" +#include "utils/hash.hh" namespace db { @@ -134,3 +135,12 @@ private: std::ostream& operator<<(std::ostream& out, const replay_position& s); } + +namespace std { +template <> +struct hash { + size_t operator()(const db::replay_position& v) const { + return utils::tuple_hash()(v.id, v.pos); + } +}; +}