hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Cutting (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-80) binary key
Date Tue, 14 Mar 2006 20:10:41 GMT
    [ http://issues.apache.org/jira/browse/HADOOP-80?page=comments#action_12370406 ] 

Doug Cutting commented on HADOOP-80:
------------------------------------

Overall this looks good.  A couple of questions:

1. Why call setSize(0) in read()?  This looks like a no-op.  Am I missing something?

2. Why bother to use md5 for hashCode()?  That could be expensive.  Why not implement this
like java.util.Arrays.hashCode() and UTF8.hashCode():

  public int hashCode() {
    int hash = 1;
    for (int i = 0; i < size; i++)
      hash = (31 * hash) + (int)bytes[i];
    return hash;
  }



> binary key
> ----------
>
>          Key: HADOOP-80
>          URL: http://issues.apache.org/jira/browse/HADOOP-80
>      Project: Hadoop
>         Type: New Feature
>   Components: io
>     Versions: 0.1
>     Reporter: Owen O'Malley
>     Assignee: Owen O'Malley
>      Fix For: 0.1
>  Attachments: binary-key.patch
>
> I needed a binary key type, so I extended BytesWritable to be comparable also.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message