jinhyukify commented on code in PR #7782:
URL: https://github.com/apache/hbase/pull/7782#discussion_r3040161760
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/util/BloomFilterUtil.java:
##########
@@ -278,4 +279,31 @@ public static byte[] getBloomFilterParam(BloomType
bloomFilterType, Configuratio
}
return bloomParam;
}
+
+ /**
+ * Generate the two hash values needed for Bloom filter index generation.
Bloom filters require a
+ * (hash1, hash2) pair to derive multiple probe locations.
+ * <ul>
+ * <li>If the hash implementation provides a 64-bit hash, we split the
64-bit value into two
+ * 32-bit hashes to avoid extra hashing cost.</li>
+ * <li>Otherwise, fall back to classic double hashing by rehashing with
hash1 as the seed.</li>
+ * </ul>
+ * @param hash the hash function
+ * @param key the hash key
+ * @return a pair of hash values (hash1, hash2)
+ */
+ public static Pair<Integer, Integer> getHashPair(Hash hash, HashKey<?> key) {
Review Comment:
Good call. Done in 870c1fa5fbbed079a55a70dc5e328d0d167a22be
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]