Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BBF737738 for ; Mon, 7 Nov 2011 10:18:15 +0000 (UTC) Received: (qmail 47806 invoked by uid 500); 7 Nov 2011 10:18:15 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 47771 invoked by uid 500); 7 Nov 2011 10:18:15 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 47763 invoked by uid 99); 7 Nov 2011 10:18:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Nov 2011 10:18:15 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 07 Nov 2011 10:18:13 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 9E93D38465 for ; Mon, 7 Nov 2011 10:17:51 +0000 (UTC) Date: Mon, 7 Nov 2011 10:17:51 +0000 (UTC) From: "Ted Yu (Commented) (JIRA)" To: issues@hbase.apache.org Message-ID: <1153721556.6248.1320661071651.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <77601179.5735.1320642531640.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HBASE-4754) FSTableDescriptors.getTableInfoPath() should be able to handle FileNotFoundException MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HBASE-4754?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13145318#comment-13145318 ] Ted Yu commented on HBASE-4754: ------------------------------- I checked calls to fs.listStatus() in the codebase. FSUtils.java contains the most calls. All the calls in FSUtils.java don't expect the return value to be null. This means letting FileNotFoundException bubble up wouldn't change the semantics of the calling methods. In some other files, such as HLogSplitter.java, fs.listStatus() is preceded with fs.exists() check. > FSTableDescriptors.getTableInfoPath() should be able to handle FileNotFoundException > ------------------------------------------------------------------------------------ > > Key: HBASE-4754 > URL: https://issues.apache.org/jira/browse/HBASE-4754 > Project: HBase > Issue Type: Bug > Affects Versions: 0.92.0 > Reporter: Ted Yu > Assignee: Ted Yu > Priority: Blocker > Fix For: 0.92.0 > > Attachments: 4754.txt > > > As reported by Roman in the thread entitled 'HBase 0.92/Hadoop 0.22 test results', table creation would result in the following if hadoop 0.22 is the underlying platform: > {code} > 11/11/05 19:08:48 INFO handler.CreateTableHandler: Attemping to create > the table b > 11/11/05 19:08:48 ERROR handler.CreateTableHandler: Error trying to > create the table b > java.io.FileNotFoundException: File > hdfs://ip-10-110-254-200.ec2.internal:17020/hbase/b does not exist. > at org.apache.hadoop.hdfs.DistributedFileSystem.listStatus(DistributedFileSystem.java:387) > at org.apache.hadoop.fs.FileSystem.listStatus(FileSystem.java:1085) > at org.apache.hadoop.fs.FileSystem.listStatus(FileSystem.java:1110) > at org.apache.hadoop.hbase.util.FSTableDescriptors.getTableInfoPath(FSTableDescriptors.java:257) > at org.apache.hadoop.hbase.util.FSTableDescriptors.getTableInfoPath(FSTableDescriptors.java:243) > at org.apache.hadoop.hbase.util.FSTableDescriptors.createTableDescriptor(FSTableDescriptors.java:566) > at org.apache.hadoop.hbase.util.FSTableDescriptors.createTableDescriptor(FSTableDescriptors.java:535) > at org.apache.hadoop.hbase.util.FSTableDescriptors.createTableDescriptor(FSTableDescriptors.java:519) > at org.apache.hadoop.hbase.master.handler.CreateTableHandler.handleCreateTable(CreateTableHandler.java:140) > at org.apache.hadoop.hbase.master.handler.CreateTableHandler.process(CreateTableHandler.java:126) > at org.apache.hadoop.hbase.executor.EventHandler.run(EventHandler.java:168) > at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:619) > {code} > This was due to how DistributedFileSystem.listStatus() in 0.22 handles non-existent directory: > {code} > @Override > public FileStatus[] listStatus(Path p) throws IOException { > String src = getPathName(p); > // fetch the first batch of entries in the directory > DirectoryListing thisListing = dfs.listPaths( > src, HdfsFileStatus.EMPTY_NAME); > if (thisListing == null) { // the directory does not exist > throw new FileNotFoundException("File " + p + " does not exist."); > } > {code} > So in FSTableDescriptors.getTableInfoPath(), we should catch FileNotFoundException and treat it the same way as status being null. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira