Files
scylladb/dht
Glauber Costa eee72251d0 add comparison and hash operators for dht::token
Inspired in Gleb's previous patch, this patch adds a hash and comparison
operator for dht::token.

The previous patch, however, had a number of problems. Comparisons were failing
in tokens that were verified (by me) to be equal to the ones Origin was
generating.

The main reasons for that, was that the byte-comparison loop must be unsigned,
not signed.

With the above change, the comparison function would always succeed *except*
when the integer version of _data was that of a signed one.

Looking at Origin, one verifies that the Murmur3Partitioner class overrides the
comparison functions, and just does a Long comparison with the token.

This patch implements a similar mechanism. With that, a list of tokens
generated by origin in ascending order is verified by us to also be in
ascending order.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-04-02 16:16:39 +02:00
..