diff --git a/gms/endpoint_state.hh b/gms/endpoint_state.hh index 14a1917f4d..e434fc48f8 100644 --- a/gms/endpoint_state.hh +++ b/gms/endpoint_state.hh @@ -43,6 +43,13 @@ private: db_clock::time_point _update_timestamp; bool _is_alive; public: + bool operator==(const endpoint_state& other) const { + return _heart_beat_state == other._heart_beat_state && + _application_state == other._application_state && + _update_timestamp == other._update_timestamp && + _is_alive == other._is_alive; + } + endpoint_state() : _heart_beat_state(0) , _update_timestamp(db_clock::now()) diff --git a/gms/heart_beat_state.hh b/gms/heart_beat_state.hh index 9b4a04deac..fa628370b6 100644 --- a/gms/heart_beat_state.hh +++ b/gms/heart_beat_state.hh @@ -35,6 +35,10 @@ private: int32_t _generation; int32_t _version; public: + bool operator==(const heart_beat_state& other) const { + return _generation == other._generation && _version == other._version; + } + heart_beat_state(int32_t gen) : _generation(gen) , _version(0) { diff --git a/gms/versioned_value.hh b/gms/versioned_value.hh index 6e7ce95cfa..b6fbdd0d19 100644 --- a/gms/versioned_value.hh +++ b/gms/versioned_value.hh @@ -72,6 +72,11 @@ public: int version; sstring value; public: + bool operator==(const versioned_value& other) const { + return version == other.version && + value == other.value; + } + versioned_value() : version(version_generator::get_next_version()) , value("") {