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

Daryn Sharp commented on HADOOP-7447:
-------------------------------------

To be consistent with the rest of the code, the main change should be:
{code}
if (!src.stat.isDirectory()) {
  throw new PathIsNotDirectoryException(src.toString());
}
{code}

Since {{copyMerge}} apparently returns null on various failures, you should 
check for that too (add newlines as you see fit):
{code}
if (FileUtil.copyMerge(src.fs, src.path, dst.fs, dst.path, false, getConf(), 
delimiter) == null) {
  throw new PathIOException(src.toString());
}
{code}

Please add some tests to {{TestHDFSCLI}} to cover the cases you've fixed.  
Thanks!

> Add a warning message for FsShell -getmerge when the src path is no a 
> directory
> -------------------------------------------------------------------------------
>
>                 Key: HADOOP-7447
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7447
>             Project: Hadoop Common
>          Issue Type: Improvement
>          Components: fs
>    Affects Versions: 0.20.3
>            Reporter: XieXianshan
>            Assignee: XieXianshan
>         Attachments: HADOOP-7447
>
>
> While the <src> specified for FsShell -getmerge is not a directory,the 
> command does nothing and there's no any message explaining the issue.
> Furthermore,the exitCode is zero.
> $ hdfs dfs -getmerge /user/hadoop/testfile /work/tmp/testfile
> $ echo $?
> 0
> $ ls /work/tmp/testfile
> ls: cannot access /work/tmp/testfile: No such file or directory

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to