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:
parent
879fe35bbb
commit
ce2995c49d
|
@ -3,8 +3,6 @@ Release 0.20.0 - Unreleased
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
||||||
BUG FIXES
|
BUG FIXES
|
||||||
HBASE-1136 HashFunction inadvertently destroys some randomness
|
|
||||||
(Jonathan Ellis via Stack)
|
|
||||||
HBASE-1140 "ant clean test" fails (Nitay Joffe via Stack)
|
HBASE-1140 "ant clean test" fails (Nitay Joffe via Stack)
|
||||||
|
|
||||||
IMPROVEMENTS
|
IMPROVEMENTS
|
||||||
|
|
|
@ -118,8 +118,7 @@ public final class HashFunction {
|
||||||
}
|
}
|
||||||
int[] result = new int[nbHash];
|
int[] result = new int[nbHash];
|
||||||
for (int i = 0, initval = 0; i < nbHash; i++) {
|
for (int i = 0, initval = 0; i < nbHash; i++) {
|
||||||
initval = hashFunction.hash(b, initval);
|
initval = result[i] = Math.abs(hashFunction.hash(b, initval) % maxValue);
|
||||||
result[i] = Math.abs(initval) % maxValue;
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}//end hash()
|
}//end hash()
|
||||||
|
|
|
@ -274,7 +274,7 @@ public class TestFilter extends TestCase {
|
||||||
bf.add(k2);
|
bf.add(k2);
|
||||||
bf.add(k3);
|
bf.add(k3);
|
||||||
assertTrue(bf.membershipTest(key));
|
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("xyzzy")));
|
||||||
assertFalse(bf.membershipTest(new StringKey("abcd")));
|
assertFalse(bf.membershipTest(new StringKey("abcd")));
|
||||||
|
|
||||||
|
@ -287,7 +287,7 @@ public class TestFilter extends TestCase {
|
||||||
bf2.add(key);
|
bf2.add(key);
|
||||||
bf.or(bf2);
|
bf.or(bf2);
|
||||||
assertTrue(bf.membershipTest(key));
|
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("xyzzy")));
|
||||||
assertFalse(bf.membershipTest(new StringKey("abcd")));
|
assertFalse(bf.membershipTest(new StringKey("abcd")));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue