[
https://issues.apache.org/jira/browse/HADOOP-5687?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12712219#action_12712219
]
Steve Loughran commented on HADOOP-5687:
----------------------------------------
I'm going to stick some more tests in -from my experiments we need to have all
the methods that work out the filesystem fail in ways that are meaningful and
helpful.
# Telling someone their URI lacks an authority because their default fs is
file:// certainly finds a symptom of the problem, but misses the point that
file: URIs are a no-no.
# HADOOP-5140 shows the problem surfaces elsewhere if the URI in the config
isn't parsable. In that situation you get a fairly meaningless message. If you
are lucky, the error message is vaguely meaningful -but it wont be enough to
help someone trying to bring up a cluster work out what the problem is, not
without them delving into the code and discovering that hadoop was looking up
fs.default.name at the time
{code}
Testcase: testHttpNoHostURI took 0.044 sec
Caused an ERROR
null
java.lang.IllegalArgumentException
at java.net.URI.create(URI.java:842)
at org.apache.hadoop.fs.FileSystem.getDefaultUri(FileSystem.java:105)
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.testHttpNoHostURI(TestNameNodeAddress.java:102)
Caused by: java.net.URISyntaxException: Expected authority at index 7: http://
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 java.net.URI.create(URI.java:840)
Testcase: testUnexpandedHdfsURI took 0.036 sec
Caused an ERROR
null
java.lang.IllegalArgumentException
at java.net.URI.create(URI.java:842)
at org.apache.hadoop.fs.FileSystem.getDefaultUri(FileSystem.java:105)
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)
Caused by: java.net.URISyntaxException: Illegal character in authority at index
7: hdfs://${hostname}/
at java.net.URI$Parser.fail(URI.java:2809)
at java.net.URI$Parser.parseAuthority(URI.java:3147)
at java.net.URI$Parser.parseHierarchical(URI.java:3058)
at java.net.URI$Parser.parse(URI.java:3014)
at java.net.URI.<init>(URI.java:578)
at java.net.URI.create(URI.java:840)
{code}
> 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-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.