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:
parent
0ce1829c73
commit
6fb4643705
|
@ -58,6 +58,7 @@ Trunk (unreleased changes)
|
||||||
(Edward Yoon via Stack)
|
(Edward Yoon via Stack)
|
||||||
HADOOP-2347 REST servlet not thread safe but run in a threaded manner
|
HADOOP-2347 REST servlet not thread safe but run in a threaded manner
|
||||||
(Bryan Duxbury via Stack)
|
(Bryan Duxbury via Stack)
|
||||||
|
HADOOP-2365 Result of HashFunction.hash() contains all identical values
|
||||||
|
|
||||||
IMPROVEMENTS
|
IMPROVEMENTS
|
||||||
HADOOP-2401 Add convenience put method that takes writable
|
HADOOP-2401 Add convenience put method that takes writable
|
||||||
|
|
|
@ -112,7 +112,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++) {
|
||||||
result[i] = Math.abs(JenkinsHash.hash(b, initval)) % maxValue;
|
initval = result[i] = Math.abs(JenkinsHash.hash(b, initval)) % maxValue;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}//end hash()
|
}//end hash()
|
||||||
|
|
|
@ -74,7 +74,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(new StringKey("graknyl")));
|
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")));
|
||||||
}
|
}
|
||||||
|
@ -91,7 +91,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(new StringKey("graknyl")));
|
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")));
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,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(new StringKey("graknyl")));
|
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