hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashwin Shankar (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-9582) Non-existent file to "hadoop fs -conf" doesn't throw error
Date Wed, 22 May 2013 21:36:20 GMT

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

Ashwin Shankar commented on HADOOP-9582:
----------------------------------------

{quote}I've been looking at this a bit more, and now I'm worried about some compatibility
issue. It looks like -conf can be used to specify any resource path. Is this right, or am
I misreading it?{quote}
I'm not sure whether URIs are allowed for '-conf' option.I checked up the documentation and
javadoc, it doesn't talk about URIs. But I would tend to believe that URIs are allowed ,since
its allowed for other options like hadoop fs -fs <URI>.If this is the case,then you're
right,we have a problem.

{quote}At the same time, delving into Configuration.loadResource() looks like it gets the
URI of the Path instance, calls getPath() on it and then converts it to a file for loading
(skipping missing entries).{quote}
Yes,that's right. Here is where it gets interesting and I have a question for you.
Configuration.loadResource() has the following code :
{code}
if (doc == null && root == null) {
        if (quiet)
          return null;
        throw new RuntimeException(resource + " not found");
      }
{code}
Looking at the code,it seems that if 'file' doesn't exist we do throw RuntimeException if
the 'quiet' flag is false,which means removing the 'quiet' flag seems to solve our problem.My
question is why is there a 'quiet' flag in the first place ? I tried to look at svn file history
and this particular code snippet goes back to early days(2006),hence no documentation about
it. 
Do you know about this flag ?
Is there some ancient use-case where its legal to give a non-existent config file as arguments
while loading it 'quietly' ? because this patch will break that.   
                
> Non-existent file to "hadoop fs -conf" doesn't throw error
> ----------------------------------------------------------
>
>                 Key: HADOOP-9582
>                 URL: https://issues.apache.org/jira/browse/HADOOP-9582
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: conf
>    Affects Versions: 3.0.0, 0.23.7, 2.0.4-alpha
>            Reporter: Ashwin Shankar
>         Attachments: HADOOP-9582.txt, HADOOP-9582.txt
>
>
> When we run :
> hadoop fs -conf BAD_FILE -ls /
> we expect hadoop to throw an error,but it doesn't.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message