HADOOP-2365 Result of HashFunction.hash() contains all identical values

git-svn-id: https://svn.apache.org/repos/asf/lucene/hadoop/trunk/src/contrib/hbase@601886 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jim Kellerman 2007-12-06 22:34:38 +00:00
parent 0ce1829c73
commit 6fb4643705
3 changed files with 5 additions and 4 deletions

View File

@ -58,6 +58,7 @@ Trunk (unreleased changes)
(Edward Yoon via Stack)
HADOOP-2347 REST servlet not thread safe but run in a threaded manner
(Bryan Duxbury via Stack)
HADOOP-2365 Result of HashFunction.hash() contains all identical values
IMPROVEMENTS
HADOOP-2401 Add convenience put method that takes writable

View File

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

View File

@ -74,7 +74,7 @@ public class TestFilter extends TestCase {
bf.add(k2);
bf.add(k3);
assertTrue(bf.membershipTest(key));
assertFalse(bf.membershipTest(new StringKey("graknyl")));
assertTrue(bf.membershipTest(new StringKey("graknyl")));
assertFalse(bf.membershipTest(new StringKey("xyzzy")));
assertFalse(bf.membershipTest(new StringKey("abcd")));
}
@ -91,7 +91,7 @@ public class TestFilter extends TestCase {
bf.add(k2);
bf.add(k3);
assertTrue(bf.membershipTest(key));
assertFalse(bf.membershipTest(new StringKey("graknyl")));
assertTrue(bf.membershipTest(new StringKey("graknyl")));
assertFalse(bf.membershipTest(new StringKey("xyzzy")));
assertFalse(bf.membershipTest(new StringKey("abcd")));
}
@ -108,7 +108,7 @@ public class TestFilter extends TestCase {
bf.add(k2);
bf.add(k3);
assertTrue(bf.membershipTest(key));
assertFalse(bf.membershipTest(new StringKey("graknyl")));
assertTrue(bf.membershipTest(new StringKey("graknyl")));
assertFalse(bf.membershipTest(new StringKey("xyzzy")));
assertFalse(bf.membershipTest(new StringKey("abcd")));
}