[ 
https://issues.apache.org/jira/browse/HDFS-8597?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14586705#comment-14586705
 ] 

Xiaoyu Yao commented on HDFS-8597:
----------------------------------

The test takes dfs.datanode.data.dir from "hdfs-default.xml"
{code}
  <name>dfs.datanode.data.dir</name>
  <value>file://${hadoop.tmp.dir}/dfs/data</value>
{code}

The location ends up as 
file://C:\Users\xiaoyu\hadoop\trunk\hadoop\hadoop-hdfs-project\hadoop-hdfs\target/test/dfs/data
 before passing to Util.stringAsURI(). However, the Java URI class cannot 
handle mix '/' and '\' separator in the path, which causes the exception. 

The fix is to use Java Path class to normalize the path separator and then 
convert it to URI. 

> Fix TestFSImage#testZeroBlockSize on Windows
> --------------------------------------------
>
>                 Key: HDFS-8597
>                 URL: https://issues.apache.org/jira/browse/HDFS-8597
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: datanode, test
>    Affects Versions: 2.6.0
>            Reporter: Xiaoyu Yao
>            Assignee: Xiaoyu Yao
>         Attachments: HDFS-8597.00.patch
>
>
> The last portion of the dfs.datanode.data.dir is incorrectly formatted.
> {code}2015-06-14 09:44:37,133 INFO  hdfs.MiniDFSCluster 
> (MiniDFSCluster.java:startDataNodes(1413)) - Starting DataNode 0 with 
> dfs.datanode.data.dir: 
> file://C:\Users\xiaoyu\hadoop\trunk\hadoop\hadoop-hdfs-project\hadoop-hdfs\target/test/dfs/data
> 2015-06-14 09:44:37,141 ERROR common.Util (Util.java:stringAsURI(50)) - 
> Syntax error in URI 
> file://C:\Users\xiaoyu\hadoop\trunk\hadoop\hadoop-hdfs-project\hadoop-hdfs\target/test/dfs/data.
>  Please check hdfs configuration.
> java.net.URISyntaxException: Illegal character in authority at index 7: 
> file://C:\Users\xiaoyu\hadoop\trunk\hadoop\hadoop-hdfs-project\hadoop-hdfs\target/test/dfs/data
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to