You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org> on 2008/04/15 01:57:04 UTC

[jira] Created: (HADOOP-3254) FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList) should not use Object[] as pass-by-reference parameters

FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList) should not use Object[] as pass-by-reference parameters
---------------------------------------------------------------------------------------------------------------------------------

                 Key: HADOOP-3254
                 URL: https://issues.apache.org/jira/browse/HADOOP-3254
             Project: Hadoop Core
          Issue Type: Improvement
          Components: dfs
            Reporter: Tsz Wo (Nicholas), SZE
            Assignee: Tsz Wo (Nicholas), SZE


In FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList), xferResults initially equals to Object[] { null, null}.  If there are blocks to be replicated, xferResults[0] and xferResults[1] will be set to a Block[] and DatanodeInfo[][], respectively.  The caller of gotHeartbeat will cast these object to the original classes.  For example, in NameNode.sendHeartbeat(...),
{code}
    if (xferResults[0] != null) {
      assert(deleteList[0] == null);
      return new BlockCommand((Block[]) xferResults[0], (DatanodeInfo[][]) xferResults[1]);
    }
{code}
The use of deleteList is similar.

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


[jira] Commented: (HADOOP-3254) FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList) should not use Object[] as pass-by-reference parameters

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

Hudson commented on HADOOP-3254:
--------------------------------

Integrated in Hadoop-trunk #462 (See [http://hudson.zones.apache.org/hudson/job/Hadoop-trunk/462/])

> FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList) should not use Object[] as pass-by-reference parameters
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-3254
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3254
>             Project: Hadoop Core
>          Issue Type: Improvement
>          Components: dfs
>            Reporter: Tsz Wo (Nicholas), SZE
>            Assignee: Tsz Wo (Nicholas), SZE
>             Fix For: 0.18.0
>
>         Attachments: 3254_20080414.patch
>
>
> In FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList), xferResults initially equals to Object[] { null, null}.  If there are blocks to be replicated, xferResults[0] and xferResults[1] will be set to a Block[] and DatanodeInfo[][], respectively.  The caller of gotHeartbeat will cast these object to the original classes.  For example, in NameNode.sendHeartbeat(...),
> {code}
>     if (xferResults[0] != null) {
>       assert(deleteList[0] == null);
>       return new BlockCommand((Block[]) xferResults[0], (DatanodeInfo[][]) xferResults[1]);
>     }
> {code}
> The use of deleteList is similar.

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


[jira] Commented: (HADOOP-3254) FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList) should not use Object[] as pass-by-reference parameters

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

Hadoop QA commented on HADOOP-3254:
-----------------------------------

-1 overall.  Here are the results of testing the latest attachment 
http://issues.apache.org/jira/secure/attachment/12380126/3254_20080414.patch
against trunk revision 645773.

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

    tests included -1.  The patch doesn't appear to include any new or modified tests.
                        Please justify why no tests are needed for this patch.

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

    javac +1.  The applied patch does not generate any new javac compiler warnings.

    release audit +1.  The applied patch does not generate any new release audit warnings.

    findbugs +1.  The patch does not introduce any new Findbugs warnings.

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

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

Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2232/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2232/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2232/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2232/console

This message is automatically generated.

> FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList) should not use Object[] as pass-by-reference parameters
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-3254
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3254
>             Project: Hadoop Core
>          Issue Type: Improvement
>          Components: dfs
>            Reporter: Tsz Wo (Nicholas), SZE
>            Assignee: Tsz Wo (Nicholas), SZE
>         Attachments: 3254_20080414.patch
>
>
> In FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList), xferResults initially equals to Object[] { null, null}.  If there are blocks to be replicated, xferResults[0] and xferResults[1] will be set to a Block[] and DatanodeInfo[][], respectively.  The caller of gotHeartbeat will cast these object to the original classes.  For example, in NameNode.sendHeartbeat(...),
> {code}
>     if (xferResults[0] != null) {
>       assert(deleteList[0] == null);
>       return new BlockCommand((Block[]) xferResults[0], (DatanodeInfo[][]) xferResults[1]);
>     }
> {code}
> The use of deleteList is similar.

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


[jira] Updated: (HADOOP-3254) FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList) should not use Object[] as pass-by-reference parameters

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-3254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tsz Wo (Nicholas), SZE updated HADOOP-3254:
-------------------------------------------

    Status: Patch Available  (was: Open)

> FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList) should not use Object[] as pass-by-reference parameters
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-3254
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3254
>             Project: Hadoop Core
>          Issue Type: Improvement
>          Components: dfs
>            Reporter: Tsz Wo (Nicholas), SZE
>            Assignee: Tsz Wo (Nicholas), SZE
>         Attachments: 3254_20080414.patch
>
>
> In FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList), xferResults initially equals to Object[] { null, null}.  If there are blocks to be replicated, xferResults[0] and xferResults[1] will be set to a Block[] and DatanodeInfo[][], respectively.  The caller of gotHeartbeat will cast these object to the original classes.  For example, in NameNode.sendHeartbeat(...),
> {code}
>     if (xferResults[0] != null) {
>       assert(deleteList[0] == null);
>       return new BlockCommand((Block[]) xferResults[0], (DatanodeInfo[][]) xferResults[1]);
>     }
> {code}
> The use of deleteList is similar.

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


[jira] Commented: (HADOOP-3254) FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList) should not use Object[] as pass-by-reference parameters

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

dhruba borthakur commented on HADOOP-3254:
------------------------------------------

+1. Code looks good. 

It might be a good idea to avoid the allocation of a zero-size-array of targets in the constructor of BlockCommand.

> FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList) should not use Object[] as pass-by-reference parameters
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-3254
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3254
>             Project: Hadoop Core
>          Issue Type: Improvement
>          Components: dfs
>            Reporter: Tsz Wo (Nicholas), SZE
>            Assignee: Tsz Wo (Nicholas), SZE
>         Attachments: 3254_20080414.patch
>
>
> In FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList), xferResults initially equals to Object[] { null, null}.  If there are blocks to be replicated, xferResults[0] and xferResults[1] will be set to a Block[] and DatanodeInfo[][], respectively.  The caller of gotHeartbeat will cast these object to the original classes.  For example, in NameNode.sendHeartbeat(...),
> {code}
>     if (xferResults[0] != null) {
>       assert(deleteList[0] == null);
>       return new BlockCommand((Block[]) xferResults[0], (DatanodeInfo[][]) xferResults[1]);
>     }
> {code}
> The use of deleteList is similar.

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


[jira] Updated: (HADOOP-3254) FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList) should not use Object[] as pass-by-reference parameters

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-3254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tsz Wo (Nicholas), SZE updated HADOOP-3254:
-------------------------------------------

    Attachment: 3254_20080414.patch

3254_20080414.patch: remove the use of Object[] as pass-by-reference.

> FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList) should not use Object[] as pass-by-reference parameters
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-3254
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3254
>             Project: Hadoop Core
>          Issue Type: Improvement
>          Components: dfs
>            Reporter: Tsz Wo (Nicholas), SZE
>            Assignee: Tsz Wo (Nicholas), SZE
>         Attachments: 3254_20080414.patch
>
>
> In FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList), xferResults initially equals to Object[] { null, null}.  If there are blocks to be replicated, xferResults[0] and xferResults[1] will be set to a Block[] and DatanodeInfo[][], respectively.  The caller of gotHeartbeat will cast these object to the original classes.  For example, in NameNode.sendHeartbeat(...),
> {code}
>     if (xferResults[0] != null) {
>       assert(deleteList[0] == null);
>       return new BlockCommand((Block[]) xferResults[0], (DatanodeInfo[][]) xferResults[1]);
>     }
> {code}
> The use of deleteList is similar.

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


[jira] Updated: (HADOOP-3254) FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList) should not use Object[] as pass-by-reference parameters

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

dhruba borthakur updated HADOOP-3254:
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 0.18.0
           Status: Resolved  (was: Patch Available)

I just committed this. Thanks Nicholas!

> FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList) should not use Object[] as pass-by-reference parameters
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HADOOP-3254
>                 URL: https://issues.apache.org/jira/browse/HADOOP-3254
>             Project: Hadoop Core
>          Issue Type: Improvement
>          Components: dfs
>            Reporter: Tsz Wo (Nicholas), SZE
>            Assignee: Tsz Wo (Nicholas), SZE
>             Fix For: 0.18.0
>
>         Attachments: 3254_20080414.patch
>
>
> In FSNamesystem.gotHeartbeat(..., Object[] xferResults, Object[] deleteList), xferResults initially equals to Object[] { null, null}.  If there are blocks to be replicated, xferResults[0] and xferResults[1] will be set to a Block[] and DatanodeInfo[][], respectively.  The caller of gotHeartbeat will cast these object to the original classes.  For example, in NameNode.sendHeartbeat(...),
> {code}
>     if (xferResults[0] != null) {
>       assert(deleteList[0] == null);
>       return new BlockCommand((Block[]) xferResults[0], (DatanodeInfo[][]) xferResults[1]);
>     }
> {code}
> The use of deleteList is similar.

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