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

Steve Loughran commented on HADOOP-5687:
----------------------------------------

also, if fs.default.name=="", it gets patched to be hdfs://, which then fails 
later on in the parse phase for having no authority. 

I'm patching FileSystem to be more detailed, with something like

{code}
Testcase: testEmptyURI took 0.08 sec
        Caused an ERROR
Unable to parse the fs.default.name value of "" patched to be "hdfs://" 
:Expected authority at index 7
java.lang.IllegalArgumentException: Unable to parse the fs.default.name value 
of "" patched to be "hdfs://" :Expected authority at index 7
        at org.apache.hadoop.fs.FileSystem.getDefaultUri(FileSystem.java:114)
        at 
org.apache.hadoop.hdfs.server.namenode.NameNode.getAddress(NameNode.java:192)
        at 
org.apache.hadoop.hdfs.TestNameNodeAddress.getAddress(TestNameNodeAddress.java:54)
        at 
org.apache.hadoop.hdfs.TestNameNodeAddress.testEmptyURI(TestNameNodeAddress.java:90)
Caused by: java.net.URISyntaxException: Expected authority at index 7: hdfs://
        at java.net.URI$Parser.fail(URI.java:2809)
        at java.net.URI$Parser.failExpecting(URI.java:2815)
        at java.net.URI$Parser.parseHierarchical(URI.java:3063)
        at java.net.URI$Parser.parse(URI.java:3014)
        at java.net.URI.<init>(URI.java:578)
        at org.apache.hadoop.fs.FileSystem.getDefaultUri(FileSystem.java:108)
{code}
That is, it prints the patched and unpatched valies if a patching has taken 
place.

But not if there is no patching
{code}
Unable to parse the fs.default.name value of "hdfs://${hostname}/" :Illegal 
character in authority at index 7
java.lang.IllegalArgumentException: Unable to parse the fs.default.name value 
of "hdfs://${hostname}/" :Illegal character in authority at index 7
        at org.apache.hadoop.fs.FileSystem.getDefaultUri(FileSystem.java:114)
        at 
org.apache.hadoop.hdfs.server.namenode.NameNode.getAddress(NameNode.java:192)
        at 
org.apache.hadoop.hdfs.TestNameNodeAddress.getAddress(TestNameNodeAddress.java:54)
        at 
org.apache.hadoop.hdfs.TestNameNodeAddress.testUnexpandedHdfsURI(TestNameNodeAddress.java:118
{code}

I will file a separate bugrep against fixnames. This patch changes the 
reporting, not the name fixing.

> Hadoop NameNode throws NPE if fs.default.name is the default value
> ------------------------------------------------------------------
>
>                 Key: HADOOP-5687
>                 URL: https://issues.apache.org/jira/browse/HADOOP-5687
>             Project: Hadoop Core
>          Issue Type: Improvement
>          Components: dfs
>            Reporter: Philip Zeyliger
>            Assignee: Philip Zeyliger
>            Priority: Minor
>             Fix For: 0.21.0
>
>         Attachments: HADOOP-5687-extension-1.patch, HADOOP-5687-v3.patch, 
> HADOOP-5687-v4.patch, HADOOP-5687-v5.patch, HADOOP-5687-v5.patch, 
> HADOOP-5687.patch, HADOOP-5687.patch
>
>
> Throwing NPE is confusing; instead, an exception with a useful string 
> description could be thrown instead.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to