Return-Path: Delivered-To: apmail-lucene-hadoop-dev-archive@locus.apache.org Received: (qmail 76954 invoked from network); 31 Jul 2007 18:44:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 31 Jul 2007 18:44:16 -0000 Received: (qmail 8434 invoked by uid 500); 31 Jul 2007 18:44:15 -0000 Delivered-To: apmail-lucene-hadoop-dev-archive@lucene.apache.org Received: (qmail 8126 invoked by uid 500); 31 Jul 2007 18:44:14 -0000 Mailing-List: contact hadoop-dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hadoop-dev@lucene.apache.org Delivered-To: mailing list hadoop-dev@lucene.apache.org Received: (qmail 8117 invoked by uid 99); 31 Jul 2007 18:44:14 -0000 Received: from Unknown (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jul 2007 11:44:14 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jul 2007 18:44:13 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 3E8747141F1 for ; Tue, 31 Jul 2007 11:43:53 -0700 (PDT) Message-ID: <24027570.1185907433253.JavaMail.jira@brutus> Date: Tue, 31 Jul 2007 11:43:53 -0700 (PDT) From: "dhruba borthakur (JIRA)" To: hadoop-dev@lucene.apache.org Subject: [jira] Updated: (HADOOP-1647) DistributedFileSystem.getFileStatus() fails for path "/" In-Reply-To: <21040491.1185201511026.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on 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.(Path.java:90) > at org.apache.hadoop.dfs.DFSFileInfo.(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.