You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Konstantin Boudnik (JIRA)" <ji...@apache.org> on 2009/08/05 22:13:14 UTC

[jira] Created: (HDFS-530) Refactor TestFileAppend* to remove code duplications

Refactor TestFileAppend* to remove code duplications
----------------------------------------------------

                 Key: HDFS-530
                 URL: https://issues.apache.org/jira/browse/HDFS-530
             Project: Hadoop HDFS
          Issue Type: Improvement
          Components: test
            Reporter: Konstantin Boudnik


Clearly, TestFileAppend* were created in a copy-cat mode which produces a number of duplications.
As more tests for the new append feature are going to be developed, I'd like to get rid of these duplications and allow some a better code reuse. 

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


[jira] Commented: (HDFS-530) Refactor TestFileAppend* to remove code duplications

Posted by "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739846#action_12739846 ] 

Tsz Wo (Nicholas), SZE commented on HDFS-530:
---------------------------------------------

For this issue, I think we only has to run the tests affected since this is a test code refactoring.

> Refactor TestFileAppend* to remove code duplications
> ----------------------------------------------------
>
>                 Key: HDFS-530
>                 URL: https://issues.apache.org/jira/browse/HDFS-530
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: test
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>         Attachments: HDFS-530.patch, HDFS-530.patch
>
>
> Clearly, TestFileAppend* were created in a copy-cat mode which produces a number of duplications.
> As more tests for the new append feature are going to be developed, I'd like to get rid of these duplications and allow some a better code reuse. 

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


[jira] Commented: (HDFS-530) Refactor TestFileAppend* to remove code duplications

Posted by "gary murry (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HDFS-530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12739770#action_12739770 ] 

gary murry commented on HDFS-530:
---------------------------------

+1 the patch looks good.

> Refactor TestFileAppend* to remove code duplications
> ----------------------------------------------------
>
>                 Key: HDFS-530
>                 URL: https://issues.apache.org/jira/browse/HDFS-530
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: test
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>         Attachments: HDFS-530.patch
>
>
> Clearly, TestFileAppend* were created in a copy-cat mode which produces a number of duplications.
> As more tests for the new append feature are going to be developed, I'd like to get rid of these duplications and allow some a better code reuse. 

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


[jira] Commented: (HDFS-530) Refactor TestFileAppend* to remove code duplications

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

Hudson commented on HDFS-530:
-----------------------------

Integrated in Hadoop-Hdfs-trunk #42 (See [http://hudson.zones.apache.org/hudson/job/Hadoop-Hdfs-trunk/42/])
    . Refactor TestFileAppend* to remove code duplication.  Contributed by Konstantin Boudnik


> Refactor TestFileAppend* to remove code duplications
> ----------------------------------------------------
>
>                 Key: HDFS-530
>                 URL: https://issues.apache.org/jira/browse/HDFS-530
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: test
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 0.21.0
>
>         Attachments: HDFS-530.patch, HDFS-530.patch, HDFS-530.patch
>
>
> Clearly, TestFileAppend* were created in a copy-cat mode which produces a number of duplications.
> As more tests for the new append feature are going to be developed, I'd like to get rid of these duplications and allow some a better code reuse. 

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


[jira] Assigned: (HDFS-530) Refactor TestFileAppend* to remove code duplications

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

Konstantin Boudnik reassigned HDFS-530:
---------------------------------------

    Assignee: Konstantin Boudnik

> Refactor TestFileAppend* to remove code duplications
> ----------------------------------------------------
>
>                 Key: HDFS-530
>                 URL: https://issues.apache.org/jira/browse/HDFS-530
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: test
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>
> Clearly, TestFileAppend* were created in a copy-cat mode which produces a number of duplications.
> As more tests for the new append feature are going to be developed, I'd like to get rid of these duplications and allow some a better code reuse. 

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


[jira] Updated: (HDFS-530) Refactor TestFileAppend* to remove code duplications

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

Konstantin Boudnik updated HDFS-530:
------------------------------------

    Status: Patch Available  (was: Open)

> Refactor TestFileAppend* to remove code duplications
> ----------------------------------------------------
>
>                 Key: HDFS-530
>                 URL: https://issues.apache.org/jira/browse/HDFS-530
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: test
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>         Attachments: HDFS-530.patch, HDFS-530.patch
>
>
> Clearly, TestFileAppend* were created in a copy-cat mode which produces a number of duplications.
> As more tests for the new append feature are going to be developed, I'd like to get rid of these duplications and allow some a better code reuse. 

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


[jira] Updated: (HDFS-530) Refactor TestFileAppend* to remove code duplications

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

Konstantin Boudnik updated HDFS-530:
------------------------------------

    Attachment: HDFS-530.patch

One more common method is pulled to AppendTestIUtil.

Local execution of test-patch seems to be Ok

{noformat}
+1 overall.

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

    +1 tests included.  The patch appears to include 12 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 warnings.

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


> Refactor TestFileAppend* to remove code duplications
> ----------------------------------------------------
>
>                 Key: HDFS-530
>                 URL: https://issues.apache.org/jira/browse/HDFS-530
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: test
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>         Attachments: HDFS-530.patch, HDFS-530.patch
>
>
> Clearly, TestFileAppend* were created in a copy-cat mode which produces a number of duplications.
> As more tests for the new append feature are going to be developed, I'd like to get rid of these duplications and allow some a better code reuse. 

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


[jira] Updated: (HDFS-530) Refactor TestFileAppend* to remove code duplications

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

Tsz Wo (Nicholas), SZE updated HDFS-530:
----------------------------------------

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

I have committed this.  Thanks, Cos!

> Refactor TestFileAppend* to remove code duplications
> ----------------------------------------------------
>
>                 Key: HDFS-530
>                 URL: https://issues.apache.org/jira/browse/HDFS-530
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: test
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>             Fix For: 0.21.0
>
>         Attachments: HDFS-530.patch, HDFS-530.patch, HDFS-530.patch
>
>
> Clearly, TestFileAppend* were created in a copy-cat mode which produces a number of duplications.
> As more tests for the new append feature are going to be developed, I'd like to get rid of these duplications and allow some a better code reuse. 

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


[jira] Updated: (HDFS-530) Refactor TestFileAppend* to remove code duplications

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

Konstantin Boudnik updated HDFS-530:
------------------------------------

    Attachment: HDFS-530.patch

Yet another redundant method is removed. 

Affected tests are passing:
{noformat}
run-test-hdfs:
    [junit] Running org.apache.hadoop.hdfs.TestFileAppend
    [junit] Tests run: 3, Failures: 0, Errors: 0, Time elapsed: 13.682 sec
    [junit] Running org.apache.hadoop.hdfs.TestFileAppend2
    [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 110.166 sec
    [junit] Running org.apache.hadoop.hdfs.TestFileAppend3
    [junit] Tests run: 6, Failures: 0, Errors: 0, Time elapsed: 16.689 sec

checkfailure:

BUILD SUCCESSFUL
{noformat}

> Refactor TestFileAppend* to remove code duplications
> ----------------------------------------------------
>
>                 Key: HDFS-530
>                 URL: https://issues.apache.org/jira/browse/HDFS-530
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: test
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>         Attachments: HDFS-530.patch, HDFS-530.patch, HDFS-530.patch
>
>
> Clearly, TestFileAppend* were created in a copy-cat mode which produces a number of duplications.
> As more tests for the new append feature are going to be developed, I'd like to get rid of these duplications and allow some a better code reuse. 

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


[jira] Commented: (HDFS-530) Refactor TestFileAppend* to remove code duplications

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

Hadoop QA commented on HDFS-530:
--------------------------------

+1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12415693/HDFS-530.patch
  against trunk revision 801500.

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

    +1 tests included.  The patch appears to include 12 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 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.

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

This message is automatically generated.

> Refactor TestFileAppend* to remove code duplications
> ----------------------------------------------------
>
>                 Key: HDFS-530
>                 URL: https://issues.apache.org/jira/browse/HDFS-530
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: test
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>         Attachments: HDFS-530.patch, HDFS-530.patch, HDFS-530.patch
>
>
> Clearly, TestFileAppend* were created in a copy-cat mode which produces a number of duplications.
> As more tests for the new append feature are going to be developed, I'd like to get rid of these duplications and allow some a better code reuse. 

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


[jira] Updated: (HDFS-530) Refactor TestFileAppend* to remove code duplications

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

Konstantin Boudnik updated HDFS-530:
------------------------------------

    Attachment: HDFS-530.patch

- few common methods are moved to AppendTestUtil class to reduce code duplication; side effects in some methods are replaced with adequate return types
- some common declarations are moved to AppendTestUtil and converted to constants
- a potential synchronization problem is addressed by declaring a synchronized object {{final}}
{noformat}
-  ArrayList<Path> testFiles = new ArrayList<Path>();
+  final ArrayList<Path> testFiles = new ArrayList<Path>();
{noformat}
- JavaDoc warnings are fixed
- code redundancies are fixed here and there. I.e. 
{noformat}
-                   dataset.detachBlock(b, 1) == false);
+            !dataset.detachBlock(b, 1));
{noformat}
- a bit of performance optimization is done

> Refactor TestFileAppend* to remove code duplications
> ----------------------------------------------------
>
>                 Key: HDFS-530
>                 URL: https://issues.apache.org/jira/browse/HDFS-530
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: test
>            Reporter: Konstantin Boudnik
>            Assignee: Konstantin Boudnik
>         Attachments: HDFS-530.patch
>
>
> Clearly, TestFileAppend* were created in a copy-cat mode which produces a number of duplications.
> As more tests for the new append feature are going to be developed, I'd like to get rid of these duplications and allow some a better code reuse. 

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