You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Masatake Iwasaki (JIRA)" <ji...@apache.org> on 2016/02/26 03:27:18 UTC

[jira] [Commented] (HADOOP-12842) LocalFileSystem checksum file creation fails when source filename contains a colon

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

Masatake Iwasaki commented on HADOOP-12842:
-------------------------------------------

bq. In most FileSystems you can create a file with a colon character in it

[Specification|https://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-common/filesystem/model.html] says that ':' is not allowed to be in path element.

{noformat}
Path elements MUST NOT contain the characters {'/', ':'}.
{noformat}


> LocalFileSystem checksum file creation fails when source filename contains a colon
> ----------------------------------------------------------------------------------
>
>                 Key: HADOOP-12842
>                 URL: https://issues.apache.org/jira/browse/HADOOP-12842
>             Project: Hadoop Common
>          Issue Type: Bug
>    Affects Versions: 2.6.4
>            Reporter: Plamen Jeliazkov
>            Assignee: Plamen Jeliazkov
>            Priority: Minor
>         Attachments: HADOOP-12842_trunk.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In most FileSystems you can create a file with a colon character in it, including HDFS. If you try to use the LocalFileSystem implementation (which extends ChecksumFileSystem) to create a file with a colon character in it you get a URISyntaxException during the creation of the checksum file because of the use of {code}new Path(path, checksumFile){code} where checksumFile will be considered as a relative path during URI parsing due to starting with a "." and containing a ":" in the path.  
> Running the following test inside TestLocalFileSystem causes the failure:
> {code}
> @Test
>   public void testColonFilePath() throws Exception {
>     FileSystem fs = fileSys;
>     Path file = new Path(TEST_ROOT_DIR + Path.SEPARATOR + "fileWith:InIt");
>     fs.delete(file, true);
>     FSDataOutputStream out = fs.create(file);
>     try {
>       out.write("text1".getBytes());
>     } finally {
>       out.close();
>     }
> }
> {code}
> With the following stack trace:
> {code}
> java.lang.IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: .fileWith:InIt.crc
> 	at java.net.URI.checkPath(URI.java:1804)
> 	at java.net.URI.<init>(URI.java:752)
> 	at org.apache.hadoop.fs.Path.initialize(Path.java:201)
> 	at org.apache.hadoop.fs.Path.<init>(Path.java:170)
> 	at org.apache.hadoop.fs.Path.<init>(Path.java:92)
> 	at org.apache.hadoop.fs.ChecksumFileSystem.getChecksumFile(ChecksumFileSystem.java:88)
> 	at org.apache.hadoop.fs.ChecksumFileSystem$ChecksumFSOutputSummer.<init>(ChecksumFileSystem.java:397)
> 	at org.apache.hadoop.fs.ChecksumFileSystem.create(ChecksumFileSystem.java:456)
> 	at org.apache.hadoop.fs.ChecksumFileSystem.create(ChecksumFileSystem.java:435)
> 	at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:921)
> 	at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:902)
> 	at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:798)
> 	at org.apache.hadoop.fs.FileSystem.create(FileSystem.java:787)
> 	at org.apache.hadoop.fs.TestLocalFileSystem.testColonFilePath(TestLocalFileSystem.java:625)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)