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 "Tsz Wo (Nicholas), SZE (JIRA)" <ji...@apache.org> on 2010/07/16 04:25:50 UTC

[jira] Created: (HDFS-1304) There is no unit test for HftpFileSystem.open(..)

There is no unit test for HftpFileSystem.open(..)
-------------------------------------------------

                 Key: HDFS-1304
                 URL: https://issues.apache.org/jira/browse/HDFS-1304
             Project: Hadoop HDFS
          Issue Type: Improvement
          Components: test
            Reporter: Tsz Wo (Nicholas), SZE


HftpFileSystem.open(..) first opens an URL connection to namenode's FileDataServlet and then is redirected to datanode's StreamFile servlet.  Such redirection does not work in the unit test environment because the redirect URL uses real hostname instead of localhost.

One way to get around it is to use fault-injection in order to replace the real hostname with localhost.

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


[jira] Commented: (HDFS-1304) There is no unit test for HftpFileSystem.open(..)

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

Hudson commented on HDFS-1304:
------------------------------

Integrated in Hadoop-Hdfs-trunk-Commit #396 (See [https://hudson.apache.org/hudson/job/Hadoop-Hdfs-trunk-Commit/396/])
    

> There is no unit test for HftpFileSystem.open(..)
> -------------------------------------------------
>
>                 Key: HDFS-1304
>                 URL: https://issues.apache.org/jira/browse/HDFS-1304
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: test
>            Reporter: Tsz Wo (Nicholas), SZE
>            Assignee: Tsz Wo (Nicholas), SZE
>             Fix For: 0.22.0
>
>         Attachments: h1304_20100921.patch, h1304_20100922.patch
>
>
> HftpFileSystem.open(..) first opens an URL connection to namenode's FileDataServlet and then is redirected to datanode's StreamFile servlet.  Such redirection does not work in the unit test environment because the redirect URL uses real hostname instead of localhost.
> One way to get around it is to use fault-injection in order to replace the real hostname with localhost.

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


[jira] Updated: (HDFS-1304) There is no unit test for HftpFileSystem.open(..)

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

Konstantin Boudnik updated HDFS-1304:
-------------------------------------

    Hadoop Flags: [Reviewed]

+1 patch looks good.

> There is no unit test for HftpFileSystem.open(..)
> -------------------------------------------------
>
>                 Key: HDFS-1304
>                 URL: https://issues.apache.org/jira/browse/HDFS-1304
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: test
>            Reporter: Tsz Wo (Nicholas), SZE
>            Assignee: Tsz Wo (Nicholas), SZE
>         Attachments: h1304_20100921.patch, h1304_20100922.patch
>
>
> HftpFileSystem.open(..) first opens an URL connection to namenode's FileDataServlet and then is redirected to datanode's StreamFile servlet.  Such redirection does not work in the unit test environment because the redirect URL uses real hostname instead of localhost.
> One way to get around it is to use fault-injection in order to replace the real hostname with localhost.

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


[jira] Updated: (HDFS-1304) There is no unit test for HftpFileSystem.open(..)

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

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

    Attachment: h1304_20100921.patch

h1304_20100921.patch: fault injection unit test.

> There is no unit test for HftpFileSystem.open(..)
> -------------------------------------------------
>
>                 Key: HDFS-1304
>                 URL: https://issues.apache.org/jira/browse/HDFS-1304
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: test
>            Reporter: Tsz Wo (Nicholas), SZE
>         Attachments: h1304_20100921.patch
>
>
> HftpFileSystem.open(..) first opens an URL connection to namenode's FileDataServlet and then is redirected to datanode's StreamFile servlet.  Such redirection does not work in the unit test environment because the redirect URL uses real hostname instead of localhost.
> One way to get around it is to use fault-injection in order to replace the real hostname with localhost.

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


[jira] Updated: (HDFS-1304) There is no unit test for HftpFileSystem.open(..)

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

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

      Status: Patch Available  (was: Open)
    Assignee: Tsz Wo (Nicholas), SZE

> There is no unit test for HftpFileSystem.open(..)
> -------------------------------------------------
>
>                 Key: HDFS-1304
>                 URL: https://issues.apache.org/jira/browse/HDFS-1304
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: test
>            Reporter: Tsz Wo (Nicholas), SZE
>            Assignee: Tsz Wo (Nicholas), SZE
>         Attachments: h1304_20100921.patch
>
>
> HftpFileSystem.open(..) first opens an URL connection to namenode's FileDataServlet and then is redirected to datanode's StreamFile servlet.  Such redirection does not work in the unit test environment because the redirect URL uses real hostname instead of localhost.
> One way to get around it is to use fault-injection in order to replace the real hostname with localhost.

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


[jira] Commented: (HDFS-1304) There is no unit test for HftpFileSystem.open(..)

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

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

{noformat}
     [exec] +1 overall.  
     [exec] 
     [exec]     +1 @author.  The patch does not contain any @author tags.
     [exec] 
     [exec]     +1 tests included.  The patch appears to include 9 new or modified tests.
     [exec] 
     [exec]     +1 javadoc.  The javadoc tool did not generate any warning messages.
     [exec] 
     [exec]     +1 javac.  The applied patch does not increase the total number of javac compiler warnings.
     [exec] 
     [exec]     +1 findbugs.  The patch does not introduce any new Findbugs warnings.
     [exec] 
     [exec]     +1 release audit.  The applied patch does not increase the total number of release audit warnings.
     [exec] 
     [exec]     +1 system tests framework.  The patch passed system tests framework compile.
     [exec] 
{noformat}
I also have run the new unit test.  It works fine.

> There is no unit test for HftpFileSystem.open(..)
> -------------------------------------------------
>
>                 Key: HDFS-1304
>                 URL: https://issues.apache.org/jira/browse/HDFS-1304
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: test
>            Reporter: Tsz Wo (Nicholas), SZE
>            Assignee: Tsz Wo (Nicholas), SZE
>         Attachments: h1304_20100921.patch, h1304_20100922.patch
>
>
> HftpFileSystem.open(..) first opens an URL connection to namenode's FileDataServlet and then is redirected to datanode's StreamFile servlet.  Such redirection does not work in the unit test environment because the redirect URL uses real hostname instead of localhost.
> One way to get around it is to use fault-injection in order to replace the real hostname with localhost.

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


[jira] Commented: (HDFS-1304) There is no unit test for HftpFileSystem.open(..)

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

Konstantin Boudnik commented on HDFS-1304:
------------------------------------------

I have compiled and ran the test without any issues.
A couple of nits:
 - please have messages for the asserts
 - remove commented code 
 - these imports aren't used anywhere and can be removed as well
{noformat}
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hdfs.DFSClient;
import org.apache.hadoop.hdfs.DFSTestUtil;
import org.apache.hadoop.hdfs.DistributedFileSystem;
import org.apache.hadoop.hdfs.HftpFileSystem;
import org.apache.hadoop.hdfs.MiniDFSCluster;
{noformat}
Looks good otherwise. 

Also, I have discussed with Nicholas why he didn't use Mockito to simulate the server side and his point was that with MiniDFSCluster he's getting a real webserver without any extra effort to emulate it, which makes sense.

> There is no unit test for HftpFileSystem.open(..)
> -------------------------------------------------
>
>                 Key: HDFS-1304
>                 URL: https://issues.apache.org/jira/browse/HDFS-1304
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: test
>            Reporter: Tsz Wo (Nicholas), SZE
>            Assignee: Tsz Wo (Nicholas), SZE
>         Attachments: h1304_20100921.patch
>
>
> HftpFileSystem.open(..) first opens an URL connection to namenode's FileDataServlet and then is redirected to datanode's StreamFile servlet.  Such redirection does not work in the unit test environment because the redirect URL uses real hostname instead of localhost.
> One way to get around it is to use fault-injection in order to replace the real hostname with localhost.

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


[jira] Updated: (HDFS-1304) There is no unit test for HftpFileSystem.open(..)

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

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

    Attachment: h1304_20100922.patch

Thanks Cos for reviewing it.

h1304_20100922.patch: 

> please have messages for the asserts
The assert messages will be printed only when the test failed.  In such case, we can check the stack trace.

>  remove commented code
Moved the  commented codes to a method.  

> these imports aren't used anywhere and can be removed as well ...
Removed.



> There is no unit test for HftpFileSystem.open(..)
> -------------------------------------------------
>
>                 Key: HDFS-1304
>                 URL: https://issues.apache.org/jira/browse/HDFS-1304
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: test
>            Reporter: Tsz Wo (Nicholas), SZE
>            Assignee: Tsz Wo (Nicholas), SZE
>         Attachments: h1304_20100921.patch, h1304_20100922.patch
>
>
> HftpFileSystem.open(..) first opens an URL connection to namenode's FileDataServlet and then is redirected to datanode's StreamFile servlet.  Such redirection does not work in the unit test environment because the redirect URL uses real hostname instead of localhost.
> One way to get around it is to use fault-injection in order to replace the real hostname with localhost.

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


[jira] Updated: (HDFS-1304) There is no unit test for HftpFileSystem.open(..)

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

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

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

I have committed this.

> There is no unit test for HftpFileSystem.open(..)
> -------------------------------------------------
>
>                 Key: HDFS-1304
>                 URL: https://issues.apache.org/jira/browse/HDFS-1304
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: test
>            Reporter: Tsz Wo (Nicholas), SZE
>            Assignee: Tsz Wo (Nicholas), SZE
>             Fix For: 0.22.0
>
>         Attachments: h1304_20100921.patch, h1304_20100922.patch
>
>
> HftpFileSystem.open(..) first opens an URL connection to namenode's FileDataServlet and then is redirected to datanode's StreamFile servlet.  Such redirection does not work in the unit test environment because the redirect URL uses real hostname instead of localhost.
> One way to get around it is to use fault-injection in order to replace the real hostname with localhost.

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