hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Boudnik (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HDFS-1304) There is no unit test for HftpFileSystem.open(..)
Date Wed, 22 Sep 2010 01:09:33 GMT

    [ 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.


Mime
View raw message