HBASE-1136 HashFunction inadvertently destroys some randomness; REVERTING

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@735880 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2009-01-19 23:56:57 +00:00
parent 879fe35bbb
commit ce2995c49d
3 changed files with 3 additions and 6 deletions

View File

@ -3,8 +3,6 @@ Release 0.20.0 - Unreleased
INCOMPATIBLE CHANGES
BUG FIXES
HBASE-1136 HashFunction inadvertently destroys some randomness
(Jonathan Ellis via Stack)
HBASE-1140 "ant clean test" fails (Nitay Joffe via Stack)
IMPROVEMENTS

View File

@ -118,8 +118,7 @@ public final class HashFunction {
}
int[] result = new int[nbHash];
for (int i = 0, initval = 0; i < nbHash; i++) {
initval = hashFunction.hash(b, initval);
result[i] = Math.abs(initval) % maxValue;
initval = result[i] = Math.abs(hashFunction.hash(b, initval) % maxValue);
}
return result;
}//end hash()

View File

@ -274,7 +274,7 @@ public class TestFilter extends TestCase {
bf.add(k2);
bf.add(k3);
assertTrue(bf.membershipTest(key));
assertFalse(bf.membershipTest(k2));
assertTrue(bf.membershipTest(new StringKey("graknyl")));
assertFalse(bf.membershipTest(new StringKey("xyzzy")));
assertFalse(bf.membershipTest(new StringKey("abcd")));
@ -287,7 +287,7 @@ public class TestFilter extends TestCase {
bf2.add(key);
bf.or(bf2);
assertTrue(bf.membershipTest(key));
assertTrue(bf.membershipTest(k2));
assertTrue(bf.membershipTest(new StringKey("graknyl")));
assertFalse(bf.membershipTest(new StringKey("xyzzy")));
assertFalse(bf.membershipTest(new StringKey("abcd")));