-
Notifications
You must be signed in to change notification settings - Fork 513
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
(fixes #5193) Serialize BucketMetadata#hashType as String #5194
Conversation
@@ -371,6 +393,19 @@ int rehashBucket(byte[] keyBytes, int newNumBuckets) { | |||
// Serialization | |||
//////////////////////////////////////// | |||
|
|||
private static class HashFunctionSupplier implements Supplier<HashFunction>, Serializable { |
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.
this class/signature is required for Guava's Suppliers::memoize to construct a Serializable memoized supplier: https://github.com/google/guava/blob/v32.1.2/guava/src/com/google/common/base/Suppliers.java#L112-L115
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5194 +/- ##
=======================================
Coverage 63.05% 63.05%
=======================================
Files 300 300
Lines 10947 10947
Branches 740 740
=======================================
Hits 6903 6903
Misses 4044 4044 ☔ View full report in Codecov by Sentry. |
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.
If I read this correctly, this only improves case where one of the read partition hashType is not supported. We'll read metadata but fail during comparison with a message saying there is a metadata mismatch.
However if all hashType are equal but not supported, we're still failing at a later stage, correct ?
Note: Hash function is only used on write. Reader can work even if hash type is not known as long as they match |
Yup, reader only needs to access HashFunction as something Comparable across other metadata.json files 👍 After that, it doesn't need to invoke it at all. |
see #5193 for motivation/details
Note that this change should have no user-facing impact--all
public
BucketMetadata constructors still use typeHashType
, notString
.I did standardize on the amount of overloaded constructors per BucketMetadata... some implementations had specializations for Void secondary keys and some did not. In the interest of simplicity (and since for the most part, users should not be constructing these directly), I removed the specialized overloads for Void secondary keys.