You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "stack (JIRA)" <ji...@apache.org> on 2009/11/12 20:26:39 UTC

[jira] Commented: (HBASE-1976) HBaseConfiguration implements hashCode() without implementing equals()

    [ https://issues.apache.org/jira/browse/HBASE-1976?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12777138#action_12777138 ] 

stack commented on HBASE-1976:
------------------------------

Good one.

That we make a hashcode on the HBaseConfiguration looks kinda broke to me; that its done w/o a companion equals is doubly broke.

Hadoop Configuration does not hashcode nor equals.  Doing this on a Configuration object, especially a fat one like the Hadoop Configuration would be expensive (might hash the paths of the files read to make up the Configuration).   Seems like folks have been able to live w/o wanting to use an Hadoop Configuration as a key in a map or without having to call equals on the config.  That seems reasonable.

Only in hbase, we do use HBaseConfiguration as a key.  Its put into a static hash in the client.  The HBC instance is used to key the Map of cached regions.  The way it does this -- keying caches by HBC instance -- is broke too.

Lets REMOVE hashcode from HBC.  Having other than object equivalence would be expensive to maintain.  Need to fix client so it doesn't use HBC as a key as part of this issue.

> HBaseConfiguration implements hashCode() without implementing equals()
> ----------------------------------------------------------------------
>
>                 Key: HBASE-1976
>                 URL: https://issues.apache.org/jira/browse/HBASE-1976
>             Project: Hadoop HBase
>          Issue Type: Bug
>    Affects Versions: 0.20.1
>         Environment: HBase
>            Reporter: Age Mooij
>
> I was browsing though the HBase 0.20.1 code in order to learn about the way HBase deals with Configuration and I noticed that HBaseConfiguration overrides hashCode() without implementing equals(). This can cause some tricky, hard to debug problems whenever instances of this class are added to Maps or HashSets.

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