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

Uma Maheswara Rao G commented on HDFS-1609:
-------------------------------------------

Same scenario can be applicable for cat, text, stat.. commands also.

So, instead of throwing FileNotFoundException from globAndProcess and catching 
it in each API and rethrowing the same by changing message, we can directly 
throw IOException with message.Because that will go directly to user.
 
if (null == globStatus || globStatus.length == 0) {
   throw new IOException("No such directory / file");
}

For Stat: 

inside stat API , we can handle the similar condition for wildcard characters.

FileStatus glob[] = srcFs.globStatus(srcPath);
if (null == glob || glob.length == 0)
  throw new IOException("cannot stat `" + src
        + "': No such file or directory");
 



> rmr command is not displaying any error message when a path contains wildcard 
> characters and does not exist.
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-1609
>                 URL: https://issues.apache.org/jira/browse/HDFS-1609
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: hdfs client
>    Affects Versions: 0.20.1, 0.20.2
>            Reporter: Uma Maheswara Rao G
>            Priority: Minor
>         Attachments: HDFS-1609.patch
>
>
> When we give invalid directory path then it will show error message on the 
> console. But if we provide the wildcard expression in invalid directory path 
> then it will not show any error message even there is no pattern match for 
> that path.
> linux-9j5v:/home/hadoop-hdfs-0.22.0-SNAPSHOT/bin # ./hdfs dfs -rmr /test/test
> rmr: cannot remove /test/test: No such file or directory.
> *linux-9j5v:/home/hadoop-hdfs-0.22.0-SNAPSHOT/bin # ./hdfs dfs -rmr /test* *
> *linux-9j5v:/home/hadoop-hdfs-0.22.0-SNAPSHOT/bin #*

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

        

Reply via email to