New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
maint: Remove use of folly/hash/Hash.h #1506
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Ian Thomas <ianthomas23@gmail.com>
auto seed = hash(id_); | ||
boost::hash_combine(seed, version_id_); | ||
boost::hash_combine(seed, creation_ts_); | ||
boost::hash_combine(seed, content_hash_); | ||
boost::hash_combine(seed, key_type_); | ||
boost::hash_combine(seed, index_start_); | ||
boost::hash_combine(seed, index_end_); | ||
hash_ = seed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the returned values of get_cached_hash
must not change for backward compatibility (e.g. to be able to retrieve segments which have been stored in databases in previous versions).
Is there a way we could test that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's the case, however I agree we should check. I believe we have version backwards and forwards compatibility checks, I'll find out where they are and point you at them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
The backwards and forwards compatibility checks are performed by .github/workflows/persistent_storage.yml
.
Reference Issues/PRs
Fixes the 5th item of the folly replacement plan, issue #1412.
What does this implement or fix?
This removes the single include of
folly/hash/Hash.h
. The only explicit use of this isfolly::hash::hash_combine
which I have replaced with use ofboost::hash_combine
.It would alternatively be possible to vendor the 3 or so
folly
functions, but I have rejected this idea. One of the functions ishash_128_to_64
and is taken from cityhash which is essentially unmaintained for 11 years. I would rather use the actively maintainedboost
.Any other comments?
There are some tests of
folly::hash::commutative_hash_combine
intest_hash.cpp
, but this function is not used anywhere else in the ArcticDB code base so I have removed the test code as not being relevant.