[
https://issues.apache.org/jira/browse/HDFS-1460?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrew Look updated HDFS-1460:
------------------------------
Attachment: HDFS-1460.txt
Attached is a patch for the issue in question.
Note that I made a change in the way toString() is rendered that could
potentially break backwards compatibility. As a result, I modified three
assertions in TestPath.testNormalize() in order to correctly interpret the
absolute pathnames as canonical paths.
For instance, consider the assertion:
assertEquals("//foo/", new Path("//foo/").toString());
The two slashes at the beginning of the string are only rendered because the
URI is created with "foo" as the authority; if those two slashes were part of
the path, they would get normalized to a single slash. Also, the trailing slash
would have been trimmed if the whole string had been considered a path; the
trailing slash is only inserted after an authority.
Therefore, if we are not treating "foo" as the hostname/authority but instead
as the first directory in a path, then new Path("//foo/").toString() should be
equal to "/foo".
Hopefully no one was depending on the first directory being an authority in a
scheme-less URI string, otherwise this might break compatibility. If URI's are
being used correctly, however, this should be okay.
> support for multiple slashes in the path separator
> --------------------------------------------------
>
> Key: HDFS-1460
> URL: https://issues.apache.org/jira/browse/HDFS-1460
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: hdfs client
> Affects Versions: 0.23.0
> Environment: Linux running JDK 1.6
> Reporter: Sudharsan Sampath
> Assignee: Andrew Look
> Priority: Minor
> Labels: newbie
> Fix For: 0.23.0
>
> Attachments: HDFS-1460.txt
>
>
> the parsing of the input path string to identify the uri authority conflicts
> with the file system paths. For instance the following is a valid path in
> both the linux file system and the hdfs.
> //user/directory1//directory2.
> While this works perfectly fine in the command line for manipulating hdfs,
> the same fails when specified as the input path for a mapper class with the
> following expcetion.
> Exception in thread "main" java.net.UnknownHostException: unknown host: user
> at org.apache.hadoop.ipc.Client$Connection.<init>(Client.java:195)
> as the org.apache.hadoop.fs.Path class assumes the string that follows the
> '//' to be an uri authority
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira