[
https://issues.apache.org/jira/browse/HBASE-3644?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006799#comment-13006799
]
Nicolas Spiegelberg commented on HBASE-3644:
--------------------------------------------
I think, for 0.90, it should suffice to just remove
{code}
result ^= stringValue.hashCode();
{code}
Even if a.stringValue != b.stringValue, it's okay for a.hashCode() ==
b.hashCode() && !a.equals(b), just can't have the other way around. This
wouldn't solve the case where stringValue matches but address doesn't, however
that's not the common case and I'm pretty sure that's not possible anymore
because of HBASE-2806.
However, it seems like the stringValue is sort of unnecessary and can be
removed in 0.92. Because of checkBindAddressCanBeResolved() from HBASE-2806,
you're guaranteed that the hostname will always be resolved when working with
an HServerAddress. Because of HBASE-3286, we use address.getHostName() to
generate stringValue anyways. It seems like stringValue is just a legacy
variable that can be removed. JD, Stack, or any other people who worked on
this class, am I missing something?
> HServerAddress Violates Equivalence Relations
> ---------------------------------------------
>
> Key: HBASE-3644
> URL: https://issues.apache.org/jira/browse/HBASE-3644
> Project: HBase
> Issue Type: Bug
> Affects Versions: 0.90.2, 0.92.0
> Reporter: Nicolas Spiegelberg
> Assignee: Nicolas Spiegelberg
> Fix For: 0.90.2, 0.92.0
>
>
> See HBASE-3387 or
> http://www.ibm.com/developerworks/java/library/j-jtp05273.html#N10184 .
> Basically, 'a' denotes HServerAddress(DNS) & 'b' denotes
> HServerAddress(nslookup(DNS)). This is extremely common within HBase when
> 'conf/regionserver' contains DNS entries because ClusterStatus.getServers()
> is IP-based. You have a.address.equals(b.address) &&
> !a.stringValue.equals(b.stringValue). In this case, a.equals(b) while
> a.hashCode() != b.hashCode().
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira