You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org> on 2011/03/23 15:50:05 UTC

[jira] [Created] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

equals() and hashCode() implementation need to change in StandardSocketFactory
------------------------------------------------------------------------------

                 Key: HADOOP-7208
                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
             Project: Hadoop Common
          Issue Type: Bug
            Reporter: Uma Maheswara Rao G


  In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
private Map<SocketFactory, Client> clients =
      new HashMap<SocketFactory, Client>();

 Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13041635#comment-13041635 ] 

Hadoop QA commented on HADOOP-7208:
-----------------------------------

+1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12480944/HADOOP-7208-3.patch
  against trunk revision 1128789.

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 3 new or modified tests.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 findbugs.  The patch does not introduce any new Findbugs (version 1.3.9) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    +1 core tests.  The patch passed core unit tests.

    +1 system test framework.  The patch passed system test framework compile.

Test results: https://builds.apache.org/hudson/job/PreCommit-HADOOP-Build/545//testReport/
Findbugs warnings: https://builds.apache.org/hudson/job/PreCommit-HADOOP-Build/545//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: https://builds.apache.org/hudson/job/PreCommit-HADOOP-Build/545//console

This message is automatically generated.

> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.23.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7208-2.patch, HADOOP-7208-3.patch, HADOOP-7208.patch
>
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035235#comment-13035235 ] 

Uma Maheswara Rao G commented on HADOOP-7208:
---------------------------------------------

Sorry for the delay in replying and patch preparation.

We may need this change if we use our custom StandardSocketFactory

In the equals method if we change the implementation like 
return obj.getClass().getName().equals(this.getClass().getName());

It gives a findbug error.

Is it fine ? is there any way to get approval for the same.

> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uma Maheswara Rao G updated HADOOP-7208:
----------------------------------------

    Attachment: HADOOP-7208.patch

> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>         Attachments: HADOOP-7208.patch
>
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uma Maheswara Rao G reassigned HADOOP-7208:
-------------------------------------------

    Assignee: Uma Maheswara Rao G

> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13014451#comment-13014451 ] 

Uma Maheswara Rao G commented on HADOOP-7208:
---------------------------------------------

equals and hashcode implementation in the class  org.apache.hadoop.net.StandardSocketFactory

> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uma Maheswara Rao G updated HADOOP-7208:
----------------------------------------

    Status: Patch Available  (was: Open)

> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.23.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7208-2.patch, HADOOP-7208.patch
>
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13014407#comment-13014407 ] 

Konstantin Shvachko commented on HADOOP-7208:
---------------------------------------------

Which implementations of equals and hashcode do you mean?

> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "ramkrishna.s.vasudevan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ramkrishna.s.vasudevan updated HADOOP-7208:
-------------------------------------------

    Status: Patch Available  (was: Open)

> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.23.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7208-2.patch, HADOOP-7208-3.patch, HADOOP-7208.patch
>
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uma Maheswara Rao G updated HADOOP-7208:
----------------------------------------

    Status: Open  (was: Patch Available)

> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.23.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7208-2.patch, HADOOP-7208.patch
>
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uma Maheswara Rao G updated HADOOP-7208:
----------------------------------------

    Attachment: HADOOP-7208-3.patch

> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.23.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7208-2.patch, HADOOP-7208-3.patch, HADOOP-7208.patch
>
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13037989#comment-13037989 ] 

Hadoop QA commented on HADOOP-7208:
-----------------------------------

+1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12480117/HADOOP-7208.patch
  against trunk revision 1126287.

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 3 new or modified tests.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 findbugs.  The patch does not introduce any new Findbugs (version 1.3.9) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    +1 core tests.  The patch passed core unit tests.

    +1 system test framework.  The patch passed system test framework compile.

Test results: https://builds.apache.org/hudson/job/PreCommit-HADOOP-Build/504//testReport/
Findbugs warnings: https://builds.apache.org/hudson/job/PreCommit-HADOOP-Build/504//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: https://builds.apache.org/hudson/job/PreCommit-HADOOP-Build/504//console

This message is automatically generated.

> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.23.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7208.patch
>
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uma Maheswara Rao G updated HADOOP-7208:
----------------------------------------

        Fix Version/s: 0.23.0
    Affects Version/s: 0.23.0
         Hadoop Flags: [Reviewed]
               Status: Patch Available  (was: Open)

> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.23.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7208.patch
>
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038259#comment-13038259 ] 

Todd Lipcon commented on HADOOP-7208:
-------------------------------------

- please use spaces, not tabs for indentation
- should probably remove the comment "dummy hash code"
- in tests, please use assertEquals instead of assertTrue with an == condition. Same for the false assertion
- to illustrate the bug, does DummySocketFactory need to override anything at all? I think it could just be an empty subclass. Also, the attached javadoc doesn't represent what it does

> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.23.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7208.patch
>
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13040983#comment-13040983 ] 

Todd Lipcon commented on HADOOP-7208:
-------------------------------------

- There are still hard tabs in this patch.
- there is no contract that hashCode() has to differ if two objects are unequal -- so your unit test there is not valid
- for the implementation of hashcode, might as well use getClass().hashCode() -- you don't need to get the class name


> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.23.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7208-2.patch, HADOOP-7208.patch
>
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "Steve Loughran (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035249#comment-13035249 ] 

Steve Loughran commented on HADOOP-7208:
----------------------------------------

checking by classname is wrong because if you have >1 classloader you can have multiple classes with the name -even singleton classes.

Better to use this.getClass().equals(that.getClass())

For a real review you really need to attach the patch


> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "Hadoop QA (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038599#comment-13038599 ] 

Hadoop QA commented on HADOOP-7208:
-----------------------------------

+1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12480249/HADOOP-7208-2.patch
  against trunk revision 1126719.

    +1 @author.  The patch does not contain any @author tags.

    +1 tests included.  The patch appears to include 3 new or modified tests.

    +1 javadoc.  The javadoc tool did not generate any warning messages.

    +1 javac.  The applied patch does not increase the total number of javac compiler warnings.

    +1 findbugs.  The patch does not introduce any new Findbugs (version 1.3.9) warnings.

    +1 release audit.  The applied patch does not increase the total number of release audit warnings.

    +1 core tests.  The patch passed core unit tests.

    +1 system test framework.  The patch passed system test framework compile.

Test results: https://builds.apache.org/hudson/job/PreCommit-HADOOP-Build/514//testReport/
Findbugs warnings: https://builds.apache.org/hudson/job/PreCommit-HADOOP-Build/514//artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Console output: https://builds.apache.org/hudson/job/PreCommit-HADOOP-Build/514//console

This message is automatically generated.

> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.23.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7208-2.patch, HADOOP-7208.patch
>
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13042109#comment-13042109 ] 

Hudson commented on HADOOP-7208:
--------------------------------

Integrated in Hadoop-Common-trunk #706 (See [https://builds.apache.org/hudson/job/Hadoop-Common-trunk/706/])
    HADOOP-7208. Fix implementation of equals() and hashCode() in StandardSocketFactory. Contributed by Uma Maheswara Rao G.

todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1129840
Files : 
* /hadoop/common/trunk/CHANGES.txt
* /hadoop/common/trunk/src/test/core/org/apache/hadoop/ipc/TestSocketFactory.java
* /hadoop/common/trunk/src/java/org/apache/hadoop/net/StandardSocketFactory.java


> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.23.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7208-2.patch, HADOOP-7208-3.patch, HADOOP-7208.patch
>
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Todd Lipcon updated HADOOP-7208:
--------------------------------

      Resolution: Fixed
    Hadoop Flags: [Reviewed]
          Status: Resolved  (was: Patch Available)

+1. Committed to trunk. Thanks, Uma

> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.23.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7208-2.patch, HADOOP-7208-3.patch, HADOOP-7208.patch
>
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "ramkrishna.s.vasudevan (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ramkrishna.s.vasudevan updated HADOOP-7208:
-------------------------------------------

    Hadoop Flags:   (was: [Reviewed])

> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.23.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7208-2.patch, HADOOP-7208-3.patch, HADOOP-7208.patch
>
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "Todd Lipcon (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Todd Lipcon updated HADOOP-7208:
--------------------------------

    Status: Open  (was: Patch Available)

> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.23.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7208-2.patch, HADOOP-7208.patch
>
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13041758#comment-13041758 ] 

Hudson commented on HADOOP-7208:
--------------------------------

Integrated in Hadoop-Common-trunk-Commit #629 (See [https://builds.apache.org/hudson/job/Hadoop-Common-trunk-Commit/629/])
    HADOOP-7208. Fix implementation of equals() and hashCode() in StandardSocketFactory. Contributed by Uma Maheswara Rao G.

todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1129840
Files : 
* /hadoop/common/trunk/CHANGES.txt
* /hadoop/common/trunk/src/test/core/org/apache/hadoop/ipc/TestSocketFactory.java
* /hadoop/common/trunk/src/java/org/apache/hadoop/net/StandardSocketFactory.java


> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.23.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7208-2.patch, HADOOP-7208-3.patch, HADOOP-7208.patch
>
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (HADOOP-7208) equals() and hashCode() implementation need to change in StandardSocketFactory

Posted by "Uma Maheswara Rao G (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-7208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Uma Maheswara Rao G updated HADOOP-7208:
----------------------------------------

    Attachment: HADOOP-7208-2.patch

> equals() and hashCode() implementation need to change in StandardSocketFactory
> ------------------------------------------------------------------------------
>
>                 Key: HADOOP-7208
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7208
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 0.23.0
>            Reporter: Uma Maheswara Rao G
>            Assignee: Uma Maheswara Rao G
>             Fix For: 0.23.0
>
>         Attachments: HADOOP-7208-2.patch, HADOOP-7208.patch
>
>
>   In Hadoop IPC Client, we are using ClientCache which will maintain the HashMap to keep the Client references.
> private Map<SocketFactory, Client> clients =
>       new HashMap<SocketFactory, Client>();
>  Now let us say, we want use two standard factories with Hadoop. MyStandardSocketFactory (which extends StandardSocketFactory), and StandardSocketFactory. In this case, because of equals and hashcode implementation, MyStandardSocketFactory client can be overridden by StandardSocketFactoryClient

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira