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 "Chris Nauroth (JIRA)" <ji...@apache.org> on 2012/10/25 00:34:12 UTC

[jira] [Created] (HADOOP-8975) TestFileContextResolveAfs fails on Windows

Chris Nauroth created HADOOP-8975:
-------------------------------------

             Summary: TestFileContextResolveAfs fails on Windows
                 Key: HADOOP-8975
                 URL: https://issues.apache.org/jira/browse/HADOOP-8975
             Project: Hadoop Common
          Issue Type: Bug
          Components: fs
    Affects Versions: trunk-win
            Reporter: Chris Nauroth
            Assignee: Chris Nauroth


This appears to be a Windows-specific path parsing issues.

--
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

[jira] [Updated] (HADOOP-8975) TestFileContextResolveAfs fails on Windows

Posted by "Chris Nauroth (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8975?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Nauroth updated HADOOP-8975:
----------------------------------

    Attachment: HADOOP-8975-branch-trunk-win.patch

Thank you, Brandon.  Here is a new patch that uses Path.isUriPathAbsolute instead.  Is one of these methods preferred over the other?  Actually, why do we have 2 methods that do the same thing?  :-)
                
> TestFileContextResolveAfs fails on Windows
> ------------------------------------------
>
>                 Key: HADOOP-8975
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8975
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: trunk-win
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>         Attachments: HADOOP-8975-branch-trunk-win.patch, HADOOP-8975-branch-trunk-win.patch
>
>
> This appears to be a Windows-specific path parsing issues.

--
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

[jira] [Commented] (HADOOP-8975) TestFileContextResolveAfs fails on Windows

Posted by "Brandon Li (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8975?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13490980#comment-13490980 ] 

Brandon Li commented on HADOOP-8975:
------------------------------------

Sorry of the late reply.
The change of method isAbsolute() and isUriPathAbsolute() was added in JIRA HADOOP-4952.
{noformat}
 
+  /**
+   *  True if the path component (i.e. directory) of this URI is absolute.
+   */
+  public boolean isUriPathAbsolute() {
+    int start = hasWindowsDrive(uri.getPath(), true) ? 3 : 0;
+    return uri.getPath().startsWith(SEPARATOR, start);
+   }
+  
   /** True if the directory of this path is absolute. */
+  /**
+   * There is some ambiguity here. An absolute path is a slash
+   * relative name without a scheme or an authority.
+   * So either this method was incorrectly named or its
+   * implementation is incorrect.
+   */
   public boolean isAbsolute() {
-    int start = hasWindowsDrive(uri.getPath(), true) ? 3 : 0;
-    return uri.getPath().startsWith(SEPARATOR, start);
+     return isUriPathAbsolute();
   }
{noformat}

I guess the change was made to highlight the true method functionality, so the author made a new method isUriPathAbsolute() and added comments to isAbsolute(). However, the isAbsolute() was not removed since it might be out of the scope of that JIRA.

+1 to the new patch.

                
> TestFileContextResolveAfs fails on Windows
> ------------------------------------------
>
>                 Key: HADOOP-8975
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8975
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: trunk-win
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>         Attachments: HADOOP-8975-branch-trunk-win.patch, HADOOP-8975-branch-trunk-win.patch
>
>
> This appears to be a Windows-specific path parsing issues.

--
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

[jira] [Commented] (HADOOP-8975) TestFileContextResolveAfs fails on Windows

Posted by "Chris Nauroth (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8975?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13483672#comment-13483672 ] 

Chris Nauroth commented on HADOOP-8975:
---------------------------------------

{code}
Running org.apache.hadoop.fs.TestFileContextResolveAfs
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.406 sec <<< FAILURE!
testFileContextResolveAfs(org.apache.hadoop.fs.TestFileContextResolveAfs)  Time elapsed: 16 sec  <<< ERROR!
java.lang.IllegalArgumentException: Wrong FS: file://C:\hdc\hadoop-common-project\hadoop-common\target/test/data, expected: file:///
	at org.apache.hadoop.fs.FileSystem.checkPath(FileSystem.java:592)
	at org.apache.hadoop.fs.RawLocalFileSystem.pathToFile(RawLocalFileSystem.java:67)
	at org.apache.hadoop.fs.RawLocalFileSystem.mkdirs(RawLocalFileSystem.java:383)
	at org.apache.hadoop.fs.RawLocalFileSystem.mkdirs(RawLocalFileSystem.java:397)
	at org.apache.hadoop.fs.FileSystem.primitiveMkdir(FileSystem.java:1008)
	at org.apache.hadoop.fs.DelegateToFileSystem.mkdir(DelegateToFileSystem.java:145)
	at org.apache.hadoop.fs.local.RawLocalFs.createSymlink(RawLocalFs.java:88)
	at org.apache.hadoop.fs.FilterFs.createSymlink(FilterFs.java:264)
	at org.apache.hadoop.fs.FileContext$19.next(FileContext.java:1363)
	at org.apache.hadoop.fs.FileContext$19.next(FileContext.java:1359)
	at org.apache.hadoop.fs.FileContext$FSLinkResolver.resolve(FileContext.java:2361)
	at org.apache.hadoop.fs.FileContext.createSymlink(FileContext.java:1359)
	at org.apache.hadoop.fs.TestFileContextResolveAfs.testFileContextResolveAfs(TestFileContextResolveAfs.java:56)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
{code}

                
> TestFileContextResolveAfs fails on Windows
> ------------------------------------------
>
>                 Key: HADOOP-8975
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8975
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: trunk-win
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>
> This appears to be a Windows-specific path parsing issues.

--
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

[jira] [Commented] (HADOOP-8975) TestFileContextResolveAfs fails on Windows

Posted by "Brandon Li (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8975?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13489280#comment-13489280 ] 

Brandon Li commented on HADOOP-8975:
------------------------------------

Hi Chris, in stead of calling isAbsolute(), why not call isUriPathAbsolute() directly?
                
> TestFileContextResolveAfs fails on Windows
> ------------------------------------------
>
>                 Key: HADOOP-8975
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8975
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: trunk-win
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>         Attachments: HADOOP-8975-branch-trunk-win.patch
>
>
> This appears to be a Windows-specific path parsing issues.

--
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

[jira] [Resolved] (HADOOP-8975) TestFileContextResolveAfs fails on Windows

Posted by "Suresh Srinivas (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8975?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Suresh Srinivas resolved HADOOP-8975.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: trunk-win
     Hadoop Flags: Reviewed

Committed the patch to branch-trunk-win. Thank you Chris.
                
> TestFileContextResolveAfs fails on Windows
> ------------------------------------------
>
>                 Key: HADOOP-8975
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8975
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: trunk-win
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>             Fix For: trunk-win
>
>         Attachments: HADOOP-8975-branch-trunk-win.patch, HADOOP-8975-branch-trunk-win.patch
>
>
> This appears to be a Windows-specific path parsing issues.

--
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

[jira] [Commented] (HADOOP-8975) TestFileContextResolveAfs fails on Windows

Posted by "Suresh Srinivas (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-8975?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493408#comment-13493408 ] 

Suresh Srinivas commented on HADOOP-8975:
-----------------------------------------

+1 for the patch.
                
> TestFileContextResolveAfs fails on Windows
> ------------------------------------------
>
>                 Key: HADOOP-8975
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8975
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: trunk-win
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>         Attachments: HADOOP-8975-branch-trunk-win.patch, HADOOP-8975-branch-trunk-win.patch
>
>
> This appears to be a Windows-specific path parsing issues.

--
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

[jira] [Updated] (HADOOP-8975) TestFileContextResolveAfs fails on Windows

Posted by "Chris Nauroth (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HADOOP-8975?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris Nauroth updated HADOOP-8975:
----------------------------------

    Attachment: HADOOP-8975-branch-trunk-win.patch

The attached patch fixes the test.  There were 2 problems.

TestFileContextResolveAfs had some Path manipulation logic that incorrectly mingled forward slashes and back slashes.  I fixed that by switching from String concatenation to using the Path APIs that handle it correctly.  

After fixing that, I discovered that RawLocalFs.createSymlink mishandled the Path on Windows if it contained scheme or authority.  I also switched this code to using the Path APIs that handle the conversion correctly.

                
> TestFileContextResolveAfs fails on Windows
> ------------------------------------------
>
>                 Key: HADOOP-8975
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8975
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs
>    Affects Versions: trunk-win
>            Reporter: Chris Nauroth
>            Assignee: Chris Nauroth
>         Attachments: HADOOP-8975-branch-trunk-win.patch
>
>
> This appears to be a Windows-specific path parsing issues.

--
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