You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Enis Soztutar (JIRA)" <ji...@apache.org> on 2007/07/23 16:38:31 UTC

[jira] Created: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

DistributedFileSystem.getFileStatus() fails for path "/"
--------------------------------------------------------

                 Key: HADOOP-1647
                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
             Project: Hadoop
          Issue Type: Bug
          Components: dfs
    Affects Versions: 0.15.0
            Reporter: Enis Soztutar
             Fix For: 0.15.0


DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is

{code}
 public static void main(String[] args) throws Exception{
    Configuration conf = new Configuration();
    FileSystem fs = FileSystem.get(conf);
    Path path = new Path("/");
    System.out.println("Path : \"" + path.toString() + "\"");
    System.out.println(fs.isDirectory(path));
    System.out.println(fs.getFileStatus(path).isDir()); 
  }
{code}


for Local configuration the code prints : 
{code}
Path : "/"
true
true
{code}

For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
{code}
Path : "/"
false
Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
        at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
        at org.apache.hadoop.fs.Path.<init>(Path.java:90)
        at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
        at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
        at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
        at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
        at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
        at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)

        at org.apache.hadoop.ipc.Client.call(Client.java:470)
        at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
        at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
        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:585)
        at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
        at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
        at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
        at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
        at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
        at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
{code}

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


[jira] Updated: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

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

dhruba borthakur updated HADOOP-1647:
-------------------------------------

    Attachment: fileStatus2.patch

Attach patch merged with latest trunk.

> DistributedFileSystem.getFileStatus() fails for path "/"
> --------------------------------------------------------
>
>                 Key: HADOOP-1647
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.14.0, 0.15.0
>            Reporter: Enis Soztutar
>            Assignee: dhruba borthakur
>            Priority: Blocker
>             Fix For: 0.14.0, 0.15.0
>
>         Attachments: fileStatus.patch, fileStatus2.patch, getFileStatusJavadoc.patch
>
>
> DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is
> {code}
>  public static void main(String[] args) throws Exception{
>     Configuration conf = new Configuration();
>     FileSystem fs = FileSystem.get(conf);
>     Path path = new Path("/");
>     System.out.println("Path : \"" + path.toString() + "\"");
>     System.out.println(fs.isDirectory(path));
>     System.out.println(fs.getFileStatus(path).isDir()); 
>   }
> {code}
> for Local configuration the code prints : 
> {code}
> Path : "/"
> true
> true
> {code}
> For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
> {code}
> Path : "/"
> false
> Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>         at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>         at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         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:585)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>         at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
> {code}

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


[jira] Commented: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

Posted by "Enis Soztutar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515507 ] 

Enis Soztutar commented on HADOOP-1647:
---------------------------------------

Well, i had also fixed this, but haven't time to upload it *smile*
dhruba, why not we change only,  in {{INode#computeName()}}
{code}
       if (parent != null) {
         return parent.computeName() + "/" + name;
       } else {
-        return name;
+        return "/";
       }
     }
{code}

> DistributedFileSystem.getFileStatus() fails for path "/"
> --------------------------------------------------------
>
>                 Key: HADOOP-1647
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.15.0
>            Reporter: Enis Soztutar
>            Assignee: dhruba borthakur
>             Fix For: 0.15.0
>
>         Attachments: fileStatus.patch
>
>
> DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is
> {code}
>  public static void main(String[] args) throws Exception{
>     Configuration conf = new Configuration();
>     FileSystem fs = FileSystem.get(conf);
>     Path path = new Path("/");
>     System.out.println("Path : \"" + path.toString() + "\"");
>     System.out.println(fs.isDirectory(path));
>     System.out.println(fs.getFileStatus(path).isDir()); 
>   }
> {code}
> for Local configuration the code prints : 
> {code}
> Path : "/"
> true
> true
> {code}
> For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
> {code}
> Path : "/"
> false
> Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>         at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>         at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         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:585)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>         at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
> {code}

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


[jira] Updated: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

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

dhruba borthakur updated HADOOP-1647:
-------------------------------------

    Attachment:     (was: fileStatus2.patch)

> DistributedFileSystem.getFileStatus() fails for path "/"
> --------------------------------------------------------
>
>                 Key: HADOOP-1647
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.14.0, 0.15.0
>            Reporter: Enis Soztutar
>            Assignee: dhruba borthakur
>            Priority: Blocker
>             Fix For: 0.14.0, 0.15.0
>
>         Attachments: fileStatus3.patch, getFileStatusJavadoc.patch
>
>
> DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is
> {code}
>  public static void main(String[] args) throws Exception{
>     Configuration conf = new Configuration();
>     FileSystem fs = FileSystem.get(conf);
>     Path path = new Path("/");
>     System.out.println("Path : \"" + path.toString() + "\"");
>     System.out.println(fs.isDirectory(path));
>     System.out.println(fs.getFileStatus(path).isDir()); 
>   }
> {code}
> for Local configuration the code prints : 
> {code}
> Path : "/"
> true
> true
> {code}
> For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
> {code}
> Path : "/"
> false
> Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>         at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>         at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         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:585)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>         at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
> {code}

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


[jira] Updated: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

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

dhruba borthakur updated HADOOP-1647:
-------------------------------------

    Attachment: fileStatus.patch

This patch returns "/" as the name of rootDir. 

> DistributedFileSystem.getFileStatus() fails for path "/"
> --------------------------------------------------------
>
>                 Key: HADOOP-1647
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.15.0
>            Reporter: Enis Soztutar
>            Assignee: dhruba borthakur
>             Fix For: 0.15.0
>
>         Attachments: fileStatus.patch
>
>
> DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is
> {code}
>  public static void main(String[] args) throws Exception{
>     Configuration conf = new Configuration();
>     FileSystem fs = FileSystem.get(conf);
>     Path path = new Path("/");
>     System.out.println("Path : \"" + path.toString() + "\"");
>     System.out.println(fs.isDirectory(path));
>     System.out.println(fs.getFileStatus(path).isDir()); 
>   }
> {code}
> for Local configuration the code prints : 
> {code}
> Path : "/"
> true
> true
> {code}
> For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
> {code}
> Path : "/"
> false
> Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>         at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>         at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         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:585)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>         at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
> {code}

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


[jira] Commented: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

Posted by "dhruba borthakur (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515795 ] 

dhruba borthakur commented on HADOOP-1647:
------------------------------------------

Hi Enis, i think ur patch might cause problems in some other areas. Especially if u rin the unit tests. Please let me know if my patch fixes your problem.

> DistributedFileSystem.getFileStatus() fails for path "/"
> --------------------------------------------------------
>
>                 Key: HADOOP-1647
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.14.0, 0.15.0
>            Reporter: Enis Soztutar
>            Assignee: dhruba borthakur
>             Fix For: 0.14.0, 0.15.0
>
>         Attachments: fileStatus.patch, getFileStatusJavadoc.patch
>
>
> DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is
> {code}
>  public static void main(String[] args) throws Exception{
>     Configuration conf = new Configuration();
>     FileSystem fs = FileSystem.get(conf);
>     Path path = new Path("/");
>     System.out.println("Path : \"" + path.toString() + "\"");
>     System.out.println(fs.isDirectory(path));
>     System.out.println(fs.getFileStatus(path).isDir()); 
>   }
> {code}
> for Local configuration the code prints : 
> {code}
> Path : "/"
> true
> true
> {code}
> For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
> {code}
> Path : "/"
> false
> Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>         at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>         at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         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:585)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>         at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
> {code}

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


[jira] Resolved: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

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

dhruba borthakur resolved HADOOP-1647.
--------------------------------------

    Resolution: Fixed

I just committed this. 

> DistributedFileSystem.getFileStatus() fails for path "/"
> --------------------------------------------------------
>
>                 Key: HADOOP-1647
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.14.0, 0.15.0
>            Reporter: Enis Soztutar
>            Assignee: dhruba borthakur
>            Priority: Blocker
>             Fix For: 0.14.0, 0.15.0
>
>         Attachments: fileStatus3.patch, getFileStatusJavadoc.patch
>
>
> DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is
> {code}
>  public static void main(String[] args) throws Exception{
>     Configuration conf = new Configuration();
>     FileSystem fs = FileSystem.get(conf);
>     Path path = new Path("/");
>     System.out.println("Path : \"" + path.toString() + "\"");
>     System.out.println(fs.isDirectory(path));
>     System.out.println(fs.getFileStatus(path).isDir()); 
>   }
> {code}
> for Local configuration the code prints : 
> {code}
> Path : "/"
> true
> true
> {code}
> For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
> {code}
> Path : "/"
> false
> Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>         at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>         at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         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:585)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>         at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
> {code}

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


[jira] Commented: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12516769 ] 

Raghu Angadi commented on HADOOP-1647:
--------------------------------------

+1.


> DistributedFileSystem.getFileStatus() fails for path "/"
> --------------------------------------------------------
>
>                 Key: HADOOP-1647
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.14.0, 0.15.0
>            Reporter: Enis Soztutar
>            Assignee: dhruba borthakur
>            Priority: Blocker
>             Fix For: 0.14.0, 0.15.0
>
>         Attachments: fileStatus3.patch, getFileStatusJavadoc.patch
>
>
> DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is
> {code}
>  public static void main(String[] args) throws Exception{
>     Configuration conf = new Configuration();
>     FileSystem fs = FileSystem.get(conf);
>     Path path = new Path("/");
>     System.out.println("Path : \"" + path.toString() + "\"");
>     System.out.println(fs.isDirectory(path));
>     System.out.println(fs.getFileStatus(path).isDir()); 
>   }
> {code}
> for Local configuration the code prints : 
> {code}
> Path : "/"
> true
> true
> {code}
> For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
> {code}
> Path : "/"
> false
> Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>         at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>         at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         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:585)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>         at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
> {code}

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


[jira] Commented: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12516581 ] 

Raghu Angadi commented on HADOOP-1647:
--------------------------------------

+1. As Dhruba pointed on hadoop-dev, Enis' patch results in "//root/dir1/dir2" (extra '/').


> DistributedFileSystem.getFileStatus() fails for path "/"
> --------------------------------------------------------
>
>                 Key: HADOOP-1647
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.14.0, 0.15.0
>            Reporter: Enis Soztutar
>            Assignee: dhruba borthakur
>            Priority: Blocker
>             Fix For: 0.14.0, 0.15.0
>
>         Attachments: fileStatus.patch, getFileStatusJavadoc.patch
>
>
> DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is
> {code}
>  public static void main(String[] args) throws Exception{
>     Configuration conf = new Configuration();
>     FileSystem fs = FileSystem.get(conf);
>     Path path = new Path("/");
>     System.out.println("Path : \"" + path.toString() + "\"");
>     System.out.println(fs.isDirectory(path));
>     System.out.println(fs.getFileStatus(path).isDir()); 
>   }
> {code}
> for Local configuration the code prints : 
> {code}
> Path : "/"
> true
> true
> {code}
> For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
> {code}
> Path : "/"
> false
> Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>         at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>         at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         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:585)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>         at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
> {code}

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


[jira] Updated: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

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

Enis Soztutar updated HADOOP-1647:
----------------------------------

    Attachment: getFileStatusJavadoc.patch

One line patch for slightly annoying javadoc. 

> DistributedFileSystem.getFileStatus() fails for path "/"
> --------------------------------------------------------
>
>                 Key: HADOOP-1647
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.14.0, 0.15.0
>            Reporter: Enis Soztutar
>            Assignee: dhruba borthakur
>             Fix For: 0.14.0, 0.15.0
>
>         Attachments: fileStatus.patch, getFileStatusJavadoc.patch
>
>
> DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is
> {code}
>  public static void main(String[] args) throws Exception{
>     Configuration conf = new Configuration();
>     FileSystem fs = FileSystem.get(conf);
>     Path path = new Path("/");
>     System.out.println("Path : \"" + path.toString() + "\"");
>     System.out.println(fs.isDirectory(path));
>     System.out.println(fs.getFileStatus(path).isDir()); 
>   }
> {code}
> for Local configuration the code prints : 
> {code}
> Path : "/"
> true
> true
> {code}
> For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
> {code}
> Path : "/"
> false
> Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>         at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>         at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         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:585)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>         at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
> {code}

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


[jira] Updated: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

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

dhruba borthakur updated HADOOP-1647:
-------------------------------------

    Attachment: fileStatus3.patch

Raghu had an excellent review comment saying that the rootInode can be detected by comparing inode->parent == NULL rather than comparing an inode with FSDirectory.rootDir. Incorporated this change.

> DistributedFileSystem.getFileStatus() fails for path "/"
> --------------------------------------------------------
>
>                 Key: HADOOP-1647
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.14.0, 0.15.0
>            Reporter: Enis Soztutar
>            Assignee: dhruba borthakur
>            Priority: Blocker
>             Fix For: 0.14.0, 0.15.0
>
>         Attachments: fileStatus3.patch, getFileStatusJavadoc.patch
>
>
> DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is
> {code}
>  public static void main(String[] args) throws Exception{
>     Configuration conf = new Configuration();
>     FileSystem fs = FileSystem.get(conf);
>     Path path = new Path("/");
>     System.out.println("Path : \"" + path.toString() + "\"");
>     System.out.println(fs.isDirectory(path));
>     System.out.println(fs.getFileStatus(path).isDir()); 
>   }
> {code}
> for Local configuration the code prints : 
> {code}
> Path : "/"
> true
> true
> {code}
> For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
> {code}
> Path : "/"
> false
> Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>         at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>         at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         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:585)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>         at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
> {code}

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


[jira] Assigned: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

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

dhruba borthakur reassigned HADOOP-1647:
----------------------------------------

    Assignee: dhruba borthakur

> DistributedFileSystem.getFileStatus() fails for path "/"
> --------------------------------------------------------
>
>                 Key: HADOOP-1647
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.15.0
>            Reporter: Enis Soztutar
>            Assignee: dhruba borthakur
>             Fix For: 0.15.0
>
>
> DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is
> {code}
>  public static void main(String[] args) throws Exception{
>     Configuration conf = new Configuration();
>     FileSystem fs = FileSystem.get(conf);
>     Path path = new Path("/");
>     System.out.println("Path : \"" + path.toString() + "\"");
>     System.out.println(fs.isDirectory(path));
>     System.out.println(fs.getFileStatus(path).isDir()); 
>   }
> {code}
> for Local configuration the code prints : 
> {code}
> Path : "/"
> true
> true
> {code}
> For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
> {code}
> Path : "/"
> false
> Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>         at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>         at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         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:585)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>         at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
> {code}

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


[jira] Updated: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

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

dhruba borthakur updated HADOOP-1647:
-------------------------------------

    Attachment:     (was: fileStatus.patch)

> DistributedFileSystem.getFileStatus() fails for path "/"
> --------------------------------------------------------
>
>                 Key: HADOOP-1647
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.14.0, 0.15.0
>            Reporter: Enis Soztutar
>            Assignee: dhruba borthakur
>            Priority: Blocker
>             Fix For: 0.14.0, 0.15.0
>
>         Attachments: fileStatus2.patch, getFileStatusJavadoc.patch
>
>
> DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is
> {code}
>  public static void main(String[] args) throws Exception{
>     Configuration conf = new Configuration();
>     FileSystem fs = FileSystem.get(conf);
>     Path path = new Path("/");
>     System.out.println("Path : \"" + path.toString() + "\"");
>     System.out.println(fs.isDirectory(path));
>     System.out.println(fs.getFileStatus(path).isDir()); 
>   }
> {code}
> for Local configuration the code prints : 
> {code}
> Path : "/"
> true
> true
> {code}
> For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
> {code}
> Path : "/"
> false
> Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>         at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>         at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         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:585)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>         at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
> {code}

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


[jira] Commented: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12516750 ] 

Raghu Angadi commented on HADOOP-1647:
--------------------------------------


This jira is marked to be in 0.14. Are you going to have another patch for 14?


> DistributedFileSystem.getFileStatus() fails for path "/"
> --------------------------------------------------------
>
>                 Key: HADOOP-1647
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.14.0, 0.15.0
>            Reporter: Enis Soztutar
>            Assignee: dhruba borthakur
>            Priority: Blocker
>             Fix For: 0.14.0, 0.15.0
>
>         Attachments: fileStatus2.patch, getFileStatusJavadoc.patch
>
>
> DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is
> {code}
>  public static void main(String[] args) throws Exception{
>     Configuration conf = new Configuration();
>     FileSystem fs = FileSystem.get(conf);
>     Path path = new Path("/");
>     System.out.println("Path : \"" + path.toString() + "\"");
>     System.out.println(fs.isDirectory(path));
>     System.out.println(fs.getFileStatus(path).isDir()); 
>   }
> {code}
> for Local configuration the code prints : 
> {code}
> Path : "/"
> true
> true
> {code}
> For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
> {code}
> Path : "/"
> false
> Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>         at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>         at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         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:585)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>         at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
> {code}

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


[jira] Commented: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

Posted by "dhruba borthakur (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12516755 ] 

dhruba borthakur commented on HADOOP-1647:
------------------------------------------

This patch is needed for 0.14. This patch depends on HADOOP-1653. So, HADOOP-1653 also went into 0.14.

> DistributedFileSystem.getFileStatus() fails for path "/"
> --------------------------------------------------------
>
>                 Key: HADOOP-1647
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.14.0, 0.15.0
>            Reporter: Enis Soztutar
>            Assignee: dhruba borthakur
>            Priority: Blocker
>             Fix For: 0.14.0, 0.15.0
>
>         Attachments: fileStatus2.patch, getFileStatusJavadoc.patch
>
>
> DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is
> {code}
>  public static void main(String[] args) throws Exception{
>     Configuration conf = new Configuration();
>     FileSystem fs = FileSystem.get(conf);
>     Path path = new Path("/");
>     System.out.println("Path : \"" + path.toString() + "\"");
>     System.out.println(fs.isDirectory(path));
>     System.out.println(fs.getFileStatus(path).isDir()); 
>   }
> {code}
> for Local configuration the code prints : 
> {code}
> Path : "/"
> true
> true
> {code}
> For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
> {code}
> Path : "/"
> false
> Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>         at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>         at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         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:585)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>         at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
> {code}

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


[jira] Commented: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12516754 ] 

Raghu Angadi commented on HADOOP-1647:
--------------------------------------

oops! HADOOP-1653 also went into 0.14.


> DistributedFileSystem.getFileStatus() fails for path "/"
> --------------------------------------------------------
>
>                 Key: HADOOP-1647
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.14.0, 0.15.0
>            Reporter: Enis Soztutar
>            Assignee: dhruba borthakur
>            Priority: Blocker
>             Fix For: 0.14.0, 0.15.0
>
>         Attachments: fileStatus2.patch, getFileStatusJavadoc.patch
>
>
> DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is
> {code}
>  public static void main(String[] args) throws Exception{
>     Configuration conf = new Configuration();
>     FileSystem fs = FileSystem.get(conf);
>     Path path = new Path("/");
>     System.out.println("Path : \"" + path.toString() + "\"");
>     System.out.println(fs.isDirectory(path));
>     System.out.println(fs.getFileStatus(path).isDir()); 
>   }
> {code}
> for Local configuration the code prints : 
> {code}
> Path : "/"
> true
> true
> {code}
> For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
> {code}
> Path : "/"
> false
> Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>         at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>         at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         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:585)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>         at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
> {code}

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


RE: [jira] Commented: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

Posted by Dhruba Borthakur <dh...@yahoo-inc.com>.
Hi Enis,

I guess the reason your patch fails is because the name returned for all
inodes (except the root) will have two "/" in the beginning, e.g.
//user/dhruba.

Thanks,
dhruba

-----Original Message-----
From: Enis Soztutar [mailto:enis.soz.nutch@gmail.com] 
Sent: Friday, July 27, 2007 7:38 AM
To: hadoop-dev@lucene.apache.org
Subject: Re: [jira] Commented: (HADOOP-1647)
DistributedFileSystem.getFileStatus() fails for path "/"

Dhruba, your version fixes the problem and passes the unit tests, 
However I also wonder why my version does not pass the tests. Maybe 
there are some assumptions that are wrong. I think we may benefit by 
examining the cause.

My patch fails in
org.apache.hadoop.dfs.TestCheckpoint
org.apache.hadoop.dfs.TestDFSFinalize
org.apache.hadoop.dfs.TestDFSShell
org.apache.hadoop.dfs.TestFsck
org.apache.hadoop.dfs.TestRestartDFS
org.apache.hadoop.fs.TestCopyFiles
org.apache.hadoop.mapred.TestMiniMRClasspath
org.apache.hadoop.mapred.TestMiniMRDFSCaching
org.apache.hadoop.mapred.TestMiniMRWithDFS

quite an success for  a line liner *smile*.

Anyhow i will not be around for a while so i cannot pursue this further. 
Other than that +1 for Dhruba's patch to be applied both 0.14 and 0.15.

Raghu Angadi (JIRA) wrote:
>     [
https://issues.apache.org/jira/browse/HADOOP-1647?page=com.atlassian.jira.pl
ugin.system.issuetabpanels:comment-tabpanel#action_12515905 ] 
>
> Raghu Angadi commented on HADOOP-1647:
> --------------------------------------
>
> I am curious how Enis' patch above is functionally different? Is there any
case where rootDir has non null parent?
>
>   
>> DistributedFileSystem.getFileStatus() fails for path "/"
>> --------------------------------------------------------
>>
>>                 Key: HADOOP-1647
>>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>>             Project: Hadoop
>>          Issue Type: Bug
>>          Components: dfs
>>    Affects Versions: 0.14.0, 0.15.0
>>            Reporter: Enis Soztutar
>>            Assignee: dhruba borthakur
>>            Priority: Blocker
>>             Fix For: 0.14.0, 0.15.0
>>
>>         Attachments: fileStatus.patch, getFileStatusJavadoc.patch
>>
>>
>> DistributedFileSystem#getFileStatus throws the following exception when
invoked with new Path("/"). LocalFileSystem does not. The code to produce
this error is
>> {code}
>>  public static void main(String[] args) throws Exception{
>>     Configuration conf = new Configuration();
>>     FileSystem fs = FileSystem.get(conf);
>>     Path path = new Path("/");
>>     System.out.println("Path : \"" + path.toString() + "\"");
>>     System.out.println(fs.isDirectory(path));
>>     System.out.println(fs.getFileStatus(path).isDir()); 
>>   }
>> {code}
>> for Local configuration the code prints : 
>> {code}
>> Path : "/"
>> true
>> true
>> {code}
>> For a new formatted dfs with only one file /user/enis/file.txt, Path
could not be created. 
>> {code}
>> Path : "/"
>> false
>> Exception in thread "main" org.apache.hadoop.ipc.RemoteException:
java.io.IOException: java.lang.IllegalArgumentException: Can not create a
Path from an empty string
>>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>>         at
org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>>         at
org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>>         at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
>>         at java.lang.reflect.Method.invoke(Method.java:585)
>>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>>         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:585)
>>         at
org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocati
onHandler.java:82)
>>         at
org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHand
ler.java:59)
>>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>>         at
org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>>         at
org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSys
tem.java:319)
>>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
>> {code}
>>     
>
>   


Re: [jira] Commented: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

Posted by Enis Soztutar <en...@gmail.com>.
Dhruba, your version fixes the problem and passes the unit tests, 
However I also wonder why my version does not pass the tests. Maybe 
there are some assumptions that are wrong. I think we may benefit by 
examining the cause.

My patch fails in
org.apache.hadoop.dfs.TestCheckpoint
org.apache.hadoop.dfs.TestDFSFinalize
org.apache.hadoop.dfs.TestDFSShell
org.apache.hadoop.dfs.TestFsck
org.apache.hadoop.dfs.TestRestartDFS
org.apache.hadoop.fs.TestCopyFiles
org.apache.hadoop.mapred.TestMiniMRClasspath
org.apache.hadoop.mapred.TestMiniMRDFSCaching
org.apache.hadoop.mapred.TestMiniMRWithDFS

quite an success for  a line liner *smile*.

Anyhow i will not be around for a while so i cannot pursue this further. 
Other than that +1 for Dhruba's patch to be applied both 0.14 and 0.15.

Raghu Angadi (JIRA) wrote:
>     [ https://issues.apache.org/jira/browse/HADOOP-1647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515905 ] 
>
> Raghu Angadi commented on HADOOP-1647:
> --------------------------------------
>
> I am curious how Enis' patch above is functionally different? Is there any case where rootDir has non null parent?
>
>   
>> DistributedFileSystem.getFileStatus() fails for path "/"
>> --------------------------------------------------------
>>
>>                 Key: HADOOP-1647
>>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>>             Project: Hadoop
>>          Issue Type: Bug
>>          Components: dfs
>>    Affects Versions: 0.14.0, 0.15.0
>>            Reporter: Enis Soztutar
>>            Assignee: dhruba borthakur
>>            Priority: Blocker
>>             Fix For: 0.14.0, 0.15.0
>>
>>         Attachments: fileStatus.patch, getFileStatusJavadoc.patch
>>
>>
>> DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is
>> {code}
>>  public static void main(String[] args) throws Exception{
>>     Configuration conf = new Configuration();
>>     FileSystem fs = FileSystem.get(conf);
>>     Path path = new Path("/");
>>     System.out.println("Path : \"" + path.toString() + "\"");
>>     System.out.println(fs.isDirectory(path));
>>     System.out.println(fs.getFileStatus(path).isDir()); 
>>   }
>> {code}
>> for Local configuration the code prints : 
>> {code}
>> Path : "/"
>> true
>> true
>> {code}
>> For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
>> {code}
>> Path : "/"
>> false
>> Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
>>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>>         at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>>         at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>>         at java.lang.reflect.Method.invoke(Method.java:585)
>>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>>         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:585)
>>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>>         at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>>         at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
>>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
>> {code}
>>     
>
>   

[jira] Commented: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515905 ] 

Raghu Angadi commented on HADOOP-1647:
--------------------------------------

I am curious how Enis' patch above is functionally different? Is there any case where rootDir has non null parent?

> DistributedFileSystem.getFileStatus() fails for path "/"
> --------------------------------------------------------
>
>                 Key: HADOOP-1647
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.14.0, 0.15.0
>            Reporter: Enis Soztutar
>            Assignee: dhruba borthakur
>            Priority: Blocker
>             Fix For: 0.14.0, 0.15.0
>
>         Attachments: fileStatus.patch, getFileStatusJavadoc.patch
>
>
> DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is
> {code}
>  public static void main(String[] args) throws Exception{
>     Configuration conf = new Configuration();
>     FileSystem fs = FileSystem.get(conf);
>     Path path = new Path("/");
>     System.out.println("Path : \"" + path.toString() + "\"");
>     System.out.println(fs.isDirectory(path));
>     System.out.println(fs.getFileStatus(path).isDir()); 
>   }
> {code}
> for Local configuration the code prints : 
> {code}
> Path : "/"
> true
> true
> {code}
> For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
> {code}
> Path : "/"
> false
> Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>         at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>         at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         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:585)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>         at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
> {code}

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


[jira] Updated: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

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

dhruba borthakur updated HADOOP-1647:
-------------------------------------

    Priority: Blocker  (was: Major)

I am marking this as a blocker so that it gets into 0.14. 

> DistributedFileSystem.getFileStatus() fails for path "/"
> --------------------------------------------------------
>
>                 Key: HADOOP-1647
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.14.0, 0.15.0
>            Reporter: Enis Soztutar
>            Assignee: dhruba borthakur
>            Priority: Blocker
>             Fix For: 0.14.0, 0.15.0
>
>         Attachments: fileStatus.patch, getFileStatusJavadoc.patch
>
>
> DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is
> {code}
>  public static void main(String[] args) throws Exception{
>     Configuration conf = new Configuration();
>     FileSystem fs = FileSystem.get(conf);
>     Path path = new Path("/");
>     System.out.println("Path : \"" + path.toString() + "\"");
>     System.out.println(fs.isDirectory(path));
>     System.out.println(fs.getFileStatus(path).isDir()); 
>   }
> {code}
> for Local configuration the code prints : 
> {code}
> Path : "/"
> true
> true
> {code}
> For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
> {code}
> Path : "/"
> false
> Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>         at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>         at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         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:585)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>         at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
> {code}

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


[jira] Updated: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

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

Enis Soztutar updated HADOOP-1647:
----------------------------------

        Fix Version/s: 0.14.0
    Affects Version/s: 0.14.0

It will be good if this patch is applied to 0.14 also. 

> DistributedFileSystem.getFileStatus() fails for path "/"
> --------------------------------------------------------
>
>                 Key: HADOOP-1647
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.14.0, 0.15.0
>            Reporter: Enis Soztutar
>            Assignee: dhruba borthakur
>             Fix For: 0.14.0, 0.15.0
>
>         Attachments: fileStatus.patch
>
>
> DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is
> {code}
>  public static void main(String[] args) throws Exception{
>     Configuration conf = new Configuration();
>     FileSystem fs = FileSystem.get(conf);
>     Path path = new Path("/");
>     System.out.println("Path : \"" + path.toString() + "\"");
>     System.out.println(fs.isDirectory(path));
>     System.out.println(fs.getFileStatus(path).isDir()); 
>   }
> {code}
> for Local configuration the code prints : 
> {code}
> Path : "/"
> true
> true
> {code}
> For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
> {code}
> Path : "/"
> false
> Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>         at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>         at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         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:585)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>         at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
> {code}

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


[jira] Commented: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/"

Posted by "Enis Soztutar (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HADOOP-1647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515649 ] 

Enis Soztutar commented on HADOOP-1647:
---------------------------------------

It seems that my version of the patch {{INode#computeName()}} fails other unit tests. I guess the root node is not the only one with parent being null. 

> DistributedFileSystem.getFileStatus() fails for path "/"
> --------------------------------------------------------
>
>                 Key: HADOOP-1647
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1647
>             Project: Hadoop
>          Issue Type: Bug
>          Components: dfs
>    Affects Versions: 0.14.0, 0.15.0
>            Reporter: Enis Soztutar
>            Assignee: dhruba borthakur
>             Fix For: 0.14.0, 0.15.0
>
>         Attachments: fileStatus.patch, getFileStatusJavadoc.patch
>
>
> DistributedFileSystem#getFileStatus throws the following exception when invoked with new Path("/"). LocalFileSystem does not. The code to produce this error is
> {code}
>  public static void main(String[] args) throws Exception{
>     Configuration conf = new Configuration();
>     FileSystem fs = FileSystem.get(conf);
>     Path path = new Path("/");
>     System.out.println("Path : \"" + path.toString() + "\"");
>     System.out.println(fs.isDirectory(path));
>     System.out.println(fs.getFileStatus(path).isDir()); 
>   }
> {code}
> for Local configuration the code prints : 
> {code}
> Path : "/"
> true
> true
> {code}
> For a new formatted dfs with only one file /user/enis/file.txt, Path could not be created. 
> {code}
> Path : "/"
> false
> Exception in thread "main" org.apache.hadoop.ipc.RemoteException: java.io.IOException: java.lang.IllegalArgumentException: Can not create a Path from an empty string
>         at org.apache.hadoop.fs.Path.checkPathArg(Path.java:82)
>         at org.apache.hadoop.fs.Path.<init>(Path.java:90)
>         at org.apache.hadoop.dfs.DFSFileInfo.<init>(DFSFileInfo.java:59)
>         at org.apache.hadoop.dfs.FSDirectory.getFileInfo(FSDirectory.java:729)
>         at org.apache.hadoop.dfs.FSNamesystem.getFileInfo(FSNamesystem.java:1301)
>         at org.apache.hadoop.dfs.NameNode.getFileInfo(NameNode.java:488)
>         at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:340)
>         at org.apache.hadoop.ipc.Server$Handler.run(Server.java:566)
>         at org.apache.hadoop.ipc.Client.call(Client.java:470)
>         at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:165)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         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:585)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
>         at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
>         at org.apache.hadoop.dfs.$Proxy0.getFileInfo(Unknown Source)
>         at org.apache.hadoop.dfs.DFSClient.getFileInfo(DFSClient.java:430)
>         at org.apache.hadoop.dfs.DistributedFileSystem.getFileStatus(DistributedFileSystem.java:319)
>         at org.apache.hadoop.util.TestIsDir.main(TestIsDir.java:38)
> {code}

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