HBASE-1979 MurmurHash does not yield the same results as the reference C++ implementation when size % 4 >= 2

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@835840 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew Kyle Purtell 2009-11-13 13:10:14 +00:00
parent bbb6ce9d34
commit 463eea1343
2 changed files with 6 additions and 3 deletions

View File

@ -111,6 +111,9 @@ Release 0.21.0 - Unreleased
miss the earlier keys on a lookup miss the earlier keys on a lookup
(Schubert Zhang via Stack) (Schubert Zhang via Stack)
HBASE-1977 Add ts and allow setting VERSIONS when scanning in shell HBASE-1977 Add ts and allow setting VERSIONS when scanning in shell
HBASE-1979 MurmurHash does not yield the same results as the reference C++
implementation when size % 4 >= 2 (Olivier Gillet via Andrew
Purtell)
IMPROVEMENTS IMPROVEMENTS
HBASE-1760 Cleanup TODOs in HTable HBASE-1760 Cleanup TODOs in HTable

View File

@ -63,13 +63,13 @@ public class MurmurHash extends Hash {
if (left != 0) { if (left != 0) {
if (left >= 3) { if (left >= 3) {
h ^= data[length - 3] << 16; h ^= data[len_m + 2] << 16;
} }
if (left >= 2) { if (left >= 2) {
h ^= data[length - 2] << 8; h ^= data[len_m + 1] << 8;
} }
if (left >= 1) { if (left >= 1) {
h ^= data[length - 1]; h ^= data[len_m];
} }
h *= m; h *= m;