You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-issues@hadoop.apache.org by "Bhallamudi Venkata Siva Kamesh (JIRA)" <ji...@apache.org> on 2011/01/06 11:04:48 UTC

[jira] Created: (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

Better to check the reflexive property of the object while overriding equals method of it
-----------------------------------------------------------------------------------------

                 Key: MAPREDUCE-2249
                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
             Project: Hadoop Map/Reduce
          Issue Type: Improvement
          Components: jobtracker, tasktracker
    Affects Versions: 0.21.0
         Environment: NA
            Reporter: Bhallamudi Venkata Siva Kamesh
             Fix For: 0.22.0, 0.23.0


It is better to check the reflexive property of the object while overriding equals method of it.
 
It improves the performance when a heavy object is compared to itself.

For example pls find the below snippet from Counters.java

  {code:title=Current Implementation|borderStyle=solid}
  @Override
  public synchronized boolean equals(Object obj) {
    boolean isEqual = false;
    if (obj != null && obj instanceof Counters) {
      Counters other = (Counters) obj;
      if (size() == other.size()) {
        isEqual = true;
        for (Map.Entry<String, Group> entry : this.counters.entrySet()) {
          String key = entry.getKey();
          Group sourceGroup = entry.getValue();
          Group targetGroup = other.getGroup(key);
          if (!sourceGroup.equals(targetGroup)) {
            isEqual = false;
            break;
          }
        }
      }
    }
    return isEqual;
  }
  {code}     

  {code:title=Proposed Implementation|borderStyle=solid}
  @Override
  public synchronized boolean equals(Object obj) {
    if(this == obj) { 
      return true;
    }
    boolean isEqual = false;
    if (obj != null && obj instanceof Counters) {
      Counters other = (Counters) obj;
      if (size() == other.size()) {
        isEqual = true;
        for (Map.Entry<String, Group> entry : this.counters.entrySet()) {
          String key = entry.getKey();
          Group sourceGroup = entry.getValue();
          Group targetGroup = other.getGroup(key);
          if (!sourceGroup.equals(targetGroup)) {
            isEqual = false;
            break;
          }
        }
      }
    }
    return isEqual;
  }
  {code}

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


[jira] Updated: (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

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

Todd Lipcon updated MAPREDUCE-2249:
-----------------------------------

    Status: Open  (was: Patch Available)

Looks like there are still tab characters in the new patch.

> Better to check the reflexive property of the object while overriding equals method of it
> -----------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2249
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: jobtracker, tasktracker
>    Affects Versions: 0.22.0, 0.23.0
>         Environment: NA
>            Reporter: Bhallamudi Venkata Siva Kamesh
>         Attachments: MAPREDUCE-2249-1.patch, MAPREDUCE-2249.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> It is better to check the reflexive property of the object while overriding equals method of it.
>  
> It improves the performance when a heavy object is compared to itself.

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

[jira] Updated: (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

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

Devaraj K updated MAPREDUCE-2249:
---------------------------------

    Affects Version/s: 0.23.0
               Status: Patch Available  (was: Open)

Provided patch for trunk as per the above comments.

> Better to check the reflexive property of the object while overriding equals method of it
> -----------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2249
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: jobtracker, tasktracker
>    Affects Versions: 0.22.0, 0.23.0
>         Environment: NA
>            Reporter: Bhallamudi Venkata Siva Kamesh
>         Attachments: MAPREDUCE-2249-1.patch, MAPREDUCE-2249.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> It is better to check the reflexive property of the object while overriding equals method of it.
>  
> It improves the performance when a heavy object is compared to itself.

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

        

[jira] [Commented] (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

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

Todd Lipcon commented on MAPREDUCE-2249:
----------------------------------------

+1, will commit shortly

> Better to check the reflexive property of the object while overriding equals method of it
> -----------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2249
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>    Affects Versions: 0.22.0, 0.23.0
>         Environment: NA
>            Reporter: Bhallamudi Venkata Siva Kamesh
>            Assignee: Devaraj K
>         Attachments: MAPREDUCE-2249-1.patch, MAPREDUCE-2249-2.patch, MAPREDUCE-2249.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> It is better to check the reflexive property of the object while overriding equals method of it.
>  
> It improves the performance when a heavy object is compared to itself.

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

        

[jira] Updated: (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

Posted by "Bhallamudi Venkata Siva Kamesh (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAPREDUCE-2249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bhallamudi Venkata Siva Kamesh updated MAPREDUCE-2249:
------------------------------------------------------

    Attachment: MAPREDUCE-2249-1.patch

> Better to check the reflexive property of the object while overriding equals method of it
> -----------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2249
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: jobtracker, tasktracker
>    Affects Versions: 0.21.0
>         Environment: NA
>            Reporter: Bhallamudi Venkata Siva Kamesh
>         Attachments: MAPREDUCE-2249-1.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> It is better to check the reflexive property of the object while overriding equals method of it.
>  
> It improves the performance when a heavy object is compared to itself.

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


[jira] Updated: (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

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

Devaraj K updated MAPREDUCE-2249:
---------------------------------

    Attachment: MAPREDUCE-2249-2.patch

> Better to check the reflexive property of the object while overriding equals method of it
> -----------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2249
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: jobtracker, tasktracker
>    Affects Versions: 0.22.0, 0.23.0
>         Environment: NA
>            Reporter: Bhallamudi Venkata Siva Kamesh
>         Attachments: MAPREDUCE-2249-1.patch, MAPREDUCE-2249-2.patch, MAPREDUCE-2249.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> It is better to check the reflexive property of the object while overriding equals method of it.
>  
> It improves the performance when a heavy object is compared to itself.

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

[jira] Updated: (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

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

Devaraj K updated MAPREDUCE-2249:
---------------------------------

    Status: Patch Available  (was: Open)

Corrected the tab characters issue. Thanks Todd.

Added reflexive and commutative property checks in the equals() methods and moved the synchronization to block level.


> Better to check the reflexive property of the object while overriding equals method of it
> -----------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2249
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: jobtracker, tasktracker
>    Affects Versions: 0.22.0, 0.23.0
>         Environment: NA
>            Reporter: Bhallamudi Venkata Siva Kamesh
>         Attachments: MAPREDUCE-2249-1.patch, MAPREDUCE-2249-2.patch, MAPREDUCE-2249.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> It is better to check the reflexive property of the object while overriding equals method of it.
>  
> It improves the performance when a heavy object is compared to itself.

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

[jira] Commented: (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

Posted by "Owen O'Malley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAPREDUCE-2249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12985922#action_12985922 ] 

Owen O'Malley commented on MAPREDUCE-2249:
------------------------------------------

We should also change the check for classes to ensure commutativity. Could you change your patch to insist on equality between the classes too?. It should look like:

{code}
if (this == obj) {
  return true;
} else if (obj == null || obj.getClass() != getClass()) {
  return false;
} else {
  ...
}
{code}

> Better to check the reflexive property of the object while overriding equals method of it
> -----------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2249
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: jobtracker, tasktracker
>    Affects Versions: 0.22.0
>         Environment: NA
>            Reporter: Bhallamudi Venkata Siva Kamesh
>         Attachments: MAPREDUCE-2249-1.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> It is better to check the reflexive property of the object while overriding equals method of it.
>  
> It improves the performance when a heavy object is compared to itself.

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


[jira] Updated: (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

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

Todd Lipcon updated MAPREDUCE-2249:
-----------------------------------

    Status: Open  (was: Patch Available)

> Better to check the reflexive property of the object while overriding equals method of it
> -----------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2249
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: jobtracker, tasktracker
>    Affects Versions: 0.22.0
>         Environment: NA
>            Reporter: Bhallamudi Venkata Siva Kamesh
>         Attachments: MAPREDUCE-2249-1.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> It is better to check the reflexive property of the object while overriding equals method of it.
>  
> It improves the performance when a heavy object is compared to itself.

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


[jira] Updated: (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

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

Devaraj K updated MAPREDUCE-2249:
---------------------------------

    Attachment: MAPREDUCE-2249.patch

> Better to check the reflexive property of the object while overriding equals method of it
> -----------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2249
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: jobtracker, tasktracker
>    Affects Versions: 0.22.0
>         Environment: NA
>            Reporter: Bhallamudi Venkata Siva Kamesh
>         Attachments: MAPREDUCE-2249-1.patch, MAPREDUCE-2249.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> It is better to check the reflexive property of the object while overriding equals method of it.
>  
> It improves the performance when a heavy object is compared to itself.

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

        

[jira] [Updated] (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

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

Devaraj K updated MAPREDUCE-2249:
---------------------------------

    Component/s:     (was: jobtracker)
                     (was: tasktracker)

> Better to check the reflexive property of the object while overriding equals method of it
> -----------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2249
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>    Affects Versions: 0.22.0, 0.23.0
>         Environment: NA
>            Reporter: Bhallamudi Venkata Siva Kamesh
>            Assignee: Devaraj K
>         Attachments: MAPREDUCE-2249-1.patch, MAPREDUCE-2249-2.patch, MAPREDUCE-2249.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> It is better to check the reflexive property of the object while overriding equals method of it.
>  
> It improves the performance when a heavy object is compared to itself.

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

        

[jira] Updated: (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

Posted by "Bhallamudi Venkata Siva Kamesh (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAPREDUCE-2249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bhallamudi Venkata Siva Kamesh updated MAPREDUCE-2249:
------------------------------------------------------

    Affects Version/s:     (was: 0.21.0)
                       0.22.0
               Status: Patch Available  (was: Open)

Added reflexive check in the equals method.

> Better to check the reflexive property of the object while overriding equals method of it
> -----------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2249
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: jobtracker, tasktracker
>    Affects Versions: 0.22.0
>         Environment: NA
>            Reporter: Bhallamudi Venkata Siva Kamesh
>         Attachments: MAPREDUCE-2249-1.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> It is better to check the reflexive property of the object while overriding equals method of it.
>  
> It improves the performance when a heavy object is compared to itself.

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


[jira] [Commented] (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

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

Hadoop QA commented on MAPREDUCE-2249:
--------------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12472831/MAPREDUCE-2249-2.patch
  against trunk revision 1094093.

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

    -1 tests included.  The patch doesn't appear to include any new or modified tests.
                        Please justify why no new tests are needed for this patch.
                        Also please list what manual steps were performed to verify this patch.

    -1 javadoc.  The javadoc tool appears to have generated 1 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 contrib tests.  The patch passed contrib unit tests.

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

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

This message is automatically generated.

> Better to check the reflexive property of the object while overriding equals method of it
> -----------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2249
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: jobtracker, tasktracker
>    Affects Versions: 0.22.0, 0.23.0
>         Environment: NA
>            Reporter: Bhallamudi Venkata Siva Kamesh
>            Assignee: Devaraj K
>         Attachments: MAPREDUCE-2249-1.patch, MAPREDUCE-2249-2.patch, MAPREDUCE-2249.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> It is better to check the reflexive property of the object while overriding equals method of it.
>  
> It improves the performance when a heavy object is compared to itself.

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

[jira] [Commented] (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

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

Hudson commented on MAPREDUCE-2249:
-----------------------------------

Integrated in Hadoop-Mapreduce-trunk #731 (See [https://builds.apache.org/job/Hadoop-Mapreduce-trunk/731/])
    MAPREDUCE-2249. Check the reflexive property of Counters objects when comparing equality. Contributed by Devaraj K.

todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1144097
Files : 
* /hadoop/common/trunk/mapreduce/CHANGES.txt
* /hadoop/common/trunk/mapreduce/src/java/org/apache/hadoop/mapred/Counters.java


> Better to check the reflexive property of the object while overriding equals method of it
> -----------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2249
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>    Affects Versions: 0.22.0, 0.23.0
>         Environment: NA
>            Reporter: Bhallamudi Venkata Siva Kamesh
>            Assignee: Devaraj K
>             Fix For: 0.23.0
>
>         Attachments: MAPREDUCE-2249-1.patch, MAPREDUCE-2249-2.patch, MAPREDUCE-2249.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> It is better to check the reflexive property of the object while overriding equals method of it.
>  
> It improves the performance when a heavy object is compared to itself.

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

        

[jira] [Updated] (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

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

Todd Lipcon updated MAPREDUCE-2249:
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 0.23.0
     Hadoop Flags: [Reviewed]
           Status: Resolved  (was: Patch Available)

> Better to check the reflexive property of the object while overriding equals method of it
> -----------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2249
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>    Affects Versions: 0.22.0, 0.23.0
>         Environment: NA
>            Reporter: Bhallamudi Venkata Siva Kamesh
>            Assignee: Devaraj K
>             Fix For: 0.23.0
>
>         Attachments: MAPREDUCE-2249-1.patch, MAPREDUCE-2249-2.patch, MAPREDUCE-2249.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> It is better to check the reflexive property of the object while overriding equals method of it.
>  
> It improves the performance when a heavy object is compared to itself.

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

        

[jira] Commented: (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

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

Todd Lipcon commented on MAPREDUCE-2249:
----------------------------------------

Hi Bhallamudi. Looks like your patch introduces some tab characters. The style for Hadoop is whitespace-only, 2-indent. Could you please reformat the change?

> Better to check the reflexive property of the object while overriding equals method of it
> -----------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2249
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: jobtracker, tasktracker
>    Affects Versions: 0.22.0
>         Environment: NA
>            Reporter: Bhallamudi Venkata Siva Kamesh
>         Attachments: MAPREDUCE-2249-1.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> It is better to check the reflexive property of the object while overriding equals method of it.
>  
> It improves the performance when a heavy object is compared to itself.

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


[jira] Commented: (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

Posted by "Devaraj K (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAPREDUCE-2249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13003817#comment-13003817 ] 

Devaraj K commented on MAPREDUCE-2249:
--------------------------------------

Contrib tests failures are not because of the patch changes. These are failing since Build #105 (Mar 1, 2011 7:05:52 AM).

> Better to check the reflexive property of the object while overriding equals method of it
> -----------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2249
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: jobtracker, tasktracker
>    Affects Versions: 0.22.0, 0.23.0
>         Environment: NA
>            Reporter: Bhallamudi Venkata Siva Kamesh
>         Attachments: MAPREDUCE-2249-1.patch, MAPREDUCE-2249-2.patch, MAPREDUCE-2249.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> It is better to check the reflexive property of the object while overriding equals method of it.
>  
> It improves the performance when a heavy object is compared to itself.

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

[jira] Commented: (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

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

Hadoop QA commented on MAPREDUCE-2249:
--------------------------------------

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12472831/MAPREDUCE-2249-2.patch
  against trunk revision 1078708.

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

    -1 tests included.  The patch doesn't appear to include any new or modified tests.
                        Please justify why no new tests are needed for this patch.
                        Also please list what manual steps were performed to verify this patch.

    +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 contrib tests.  The patch failed contrib unit tests.

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

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

This message is automatically generated.

> Better to check the reflexive property of the object while overriding equals method of it
> -----------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2249
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: jobtracker, tasktracker
>    Affects Versions: 0.22.0, 0.23.0
>         Environment: NA
>            Reporter: Bhallamudi Venkata Siva Kamesh
>         Attachments: MAPREDUCE-2249-1.patch, MAPREDUCE-2249-2.patch, MAPREDUCE-2249.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> It is better to check the reflexive property of the object while overriding equals method of it.
>  
> It improves the performance when a heavy object is compared to itself.

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

[jira] [Commented] (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

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

Hudson commented on MAPREDUCE-2249:
-----------------------------------

Integrated in Hadoop-Mapreduce-trunk-Commit #735 (See [https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/735/])
    MAPREDUCE-2249. Check the reflexive property of Counters objects when comparing equality. Contributed by Devaraj K.

todd : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1144097
Files : 
* /hadoop/common/trunk/mapreduce/CHANGES.txt
* /hadoop/common/trunk/mapreduce/src/java/org/apache/hadoop/mapred/Counters.java


> Better to check the reflexive property of the object while overriding equals method of it
> -----------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2249
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>    Affects Versions: 0.22.0, 0.23.0
>         Environment: NA
>            Reporter: Bhallamudi Venkata Siva Kamesh
>            Assignee: Devaraj K
>             Fix For: 0.23.0
>
>         Attachments: MAPREDUCE-2249-1.patch, MAPREDUCE-2249-2.patch, MAPREDUCE-2249.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> It is better to check the reflexive property of the object while overriding equals method of it.
>  
> It improves the performance when a heavy object is compared to itself.

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

        

[jira] [Assigned] (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

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

Devaraj K reassigned MAPREDUCE-2249:
------------------------------------

    Assignee: Devaraj K

> Better to check the reflexive property of the object while overriding equals method of it
> -----------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2249
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: jobtracker, tasktracker
>    Affects Versions: 0.22.0, 0.23.0
>         Environment: NA
>            Reporter: Bhallamudi Venkata Siva Kamesh
>            Assignee: Devaraj K
>         Attachments: MAPREDUCE-2249-1.patch, MAPREDUCE-2249-2.patch, MAPREDUCE-2249.patch
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> It is better to check the reflexive property of the object while overriding equals method of it.
>  
> It improves the performance when a heavy object is compared to itself.

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

[jira] Updated: (MAPREDUCE-2249) Better to check the reflexive property of the object while overriding equals method of it

Posted by "Owen O'Malley (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAPREDUCE-2249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Owen O'Malley updated MAPREDUCE-2249:
-------------------------------------

    Description: 
It is better to check the reflexive property of the object while overriding equals method of it.
 
It improves the performance when a heavy object is compared to itself.


  was:
It is better to check the reflexive property of the object while overriding equals method of it.
 
It improves the performance when a heavy object is compared to itself.

For example pls find the below snippet from Counters.java

  {code:title=Current Implementation|borderStyle=solid}
  @Override
  public synchronized boolean equals(Object obj) {
    boolean isEqual = false;
    if (obj != null && obj instanceof Counters) {
      Counters other = (Counters) obj;
      if (size() == other.size()) {
        isEqual = true;
        for (Map.Entry<String, Group> entry : this.counters.entrySet()) {
          String key = entry.getKey();
          Group sourceGroup = entry.getValue();
          Group targetGroup = other.getGroup(key);
          if (!sourceGroup.equals(targetGroup)) {
            isEqual = false;
            break;
          }
        }
      }
    }
    return isEqual;
  }
  {code}     

  {code:title=Proposed Implementation|borderStyle=solid}
  @Override
  public synchronized boolean equals(Object obj) {
    if(this == obj) { 
      return true;
    }
    boolean isEqual = false;
    if (obj != null && obj instanceof Counters) {
      Counters other = (Counters) obj;
      if (size() == other.size()) {
        isEqual = true;
        for (Map.Entry<String, Group> entry : this.counters.entrySet()) {
          String key = entry.getKey();
          Group sourceGroup = entry.getValue();
          Group targetGroup = other.getGroup(key);
          if (!sourceGroup.equals(targetGroup)) {
            isEqual = false;
            break;
          }
        }
      }
    }
    return isEqual;
  }
  {code}


Please don't put proposed solutions into the descriptions. They are mailed out as part of every comment. Make a reasonably brief description and add the proposal as the first comment.

The rest of your description follows:

For example pls find the below snippet from Counters.java

  {code:title=Current Implementation|borderStyle=solid}
  @Override
  public synchronized boolean equals(Object obj) {
    boolean isEqual = false;
    if (obj != null && obj instanceof Counters) {
      Counters other = (Counters) obj;
      if (size() == other.size()) {
        isEqual = true;
        for (Map.Entry<String, Group> entry : this.counters.entrySet()) {
          String key = entry.getKey();
          Group sourceGroup = entry.getValue();
          Group targetGroup = other.getGroup(key);
          if (!sourceGroup.equals(targetGroup)) {
            isEqual = false;
            break;
          }
        }
      }
    }
    return isEqual;
  }
  {code}     

  {code:title=Proposed Implementation|borderStyle=solid}
  @Override
  public synchronized boolean equals(Object obj) {
    if(this == obj) { 
      return true;
    }
    boolean isEqual = false;
    if (obj != null && obj instanceof Counters) {
      Counters other = (Counters) obj;
      if (size() == other.size()) {
        isEqual = true;
        for (Map.Entry<String, Group> entry : this.counters.entrySet()) {
          String key = entry.getKey();
          Group sourceGroup = entry.getValue();
          Group targetGroup = other.getGroup(key);
          if (!sourceGroup.equals(targetGroup)) {
            isEqual = false;
            break;
          }
        }
      }
    }
    return isEqual;
  }
  {code}

> Better to check the reflexive property of the object while overriding equals method of it
> -----------------------------------------------------------------------------------------
>
>                 Key: MAPREDUCE-2249
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-2249
>             Project: Hadoop Map/Reduce
>          Issue Type: Improvement
>          Components: jobtracker, tasktracker
>    Affects Versions: 0.21.0
>         Environment: NA
>            Reporter: Bhallamudi Venkata Siva Kamesh
>             Fix For: 0.22.0, 0.23.0
>
>   Original Estimate: 48h
>  Remaining Estimate: 48h
>
> It is better to check the reflexive property of the object while overriding equals method of it.
>  
> It improves the performance when a heavy object is compared to itself.

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