HBASE-849 Speed improvement in JenkinsHash

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@689888 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2008-08-28 16:49:51 +00:00
parent f277d7d3b0
commit bd74b7d721
2 changed files with 5 additions and 4 deletions

View File

@ -34,6 +34,7 @@ Release 0.18.0 - Unreleased
Kellerman) Kellerman)
HBASE-843 Deleting and recreating a table in a single process does not work HBASE-843 Deleting and recreating a table in a single process does not work
(Jonathan Gray via Jim Kellerman) (Jonathan Gray via Jim Kellerman)
HBASE-849 Speed improvement in JenkinsHash (Andrzej Bialecki via Stack)
IMPROVEMENTS IMPROVEMENTS
HBASE-801 When a table haven't disable, shell could response in a "user HBASE-801 When a table haven't disable, shell could response in a "user

View File

@ -43,8 +43,8 @@ public class JenkinsHash {
private static long BYTE_MASK = 0x00000000000000ffL; private static long BYTE_MASK = 0x00000000000000ffL;
private static long rot(long val, int pos) { private static long rot(long val, int pos) {
return Long.valueOf(Integer.rotateLeft( return ((long)(Integer.rotateLeft(
Long.valueOf(val & INT_MASK).intValue(), pos)).longValue() & INT_MASK; (int)(val & INT_MASK), pos)) & INT_MASK);
} }
/** /**
@ -202,7 +202,7 @@ public class JenkinsHash {
a = (a + (key[offset + 0] & BYTE_MASK)) & INT_MASK; a = (a + (key[offset + 0] & BYTE_MASK)) & INT_MASK;
break; break;
case 0: case 0:
return Long.valueOf(c & INT_MASK).intValue(); return (int)(c & INT_MASK);
} }
/* /*
* final -- final mixing of 3 32-bit values (a,b,c) into c * final -- final mixing of 3 32-bit values (a,b,c) into c
@ -249,7 +249,7 @@ public class JenkinsHash {
b ^= a; b = (b - rot(a,14)) & INT_MASK; b ^= a; b = (b - rot(a,14)) & INT_MASK;
c ^= b; c = (c - rot(b,24)) & INT_MASK; c ^= b; c = (c - rot(b,24)) & INT_MASK;
return Long.valueOf(c & INT_MASK).intValue(); return (int)(c & INT_MASK);
} }
/** /**