[ 
https://issues.apache.org/jira/browse/HBASE-1136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

stack updated HBASE-1136:
-------------------------

       Resolution: Fixed
    Fix Version/s: 0.20.0
           Status: Resolved  (was: Patch Available)

Committed to TRUNK.  Thanks for the patch Jonathan.

Please open a new patch against Hadoop with a patch for 
src/core/org/apache/hadoop/util/bloom/HashFunction.java.  HashFunction was 
moved there by HADOOP-3063 (We'll move to using the hadoop versions in next 
hbase).  I can commit it after letting it air for a while in case objection.

> HashFunction inadvertently destroys some randomness
> ---------------------------------------------------
>
>                 Key: HBASE-1136
>                 URL: https://issues.apache.org/jira/browse/HBASE-1136
>             Project: Hadoop HBase
>          Issue Type: Bug
>            Reporter: Jonathan Ellis
>             Fix For: 0.20.0
>
>         Attachments: hash.patch
>
>
> the code
>       for (int i = 0, initval = 0; i < nbHash; i++) {
>         initval = result[i] = Math.abs(hashFunction.hash(b, initval) % 
> maxValue);
>       }
> restricts initval for the next hash to the [0, maxValue) range of the hash 
> indexes returned.  This is suboptimal, particularly for larger nbHash and 
> smaller maxValue.  Instead, use:
>       for (int i = 0, initval = 0; i < nbHash; i++) {
>         initval = hashFunction.hash(b, initval);
>         result[i] = Math.abs(initval) % maxValue;
>       }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to