Return-Path: X-Original-To: apmail-hbase-commits-archive@www.apache.org Delivered-To: apmail-hbase-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0690A10A31 for ; Thu, 5 Sep 2013 21:06:12 +0000 (UTC) Received: (qmail 40788 invoked by uid 500); 5 Sep 2013 21:06:11 -0000 Delivered-To: apmail-hbase-commits-archive@hbase.apache.org Received: (qmail 40733 invoked by uid 500); 5 Sep 2013 21:06:11 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 40726 invoked by uid 99); 5 Sep 2013 21:06:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Sep 2013 21:06:11 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Sep 2013 21:06:09 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 0EC3723888E7; Thu, 5 Sep 2013 21:05:48 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1520425 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java Date: Thu, 05 Sep 2013 21:05:47 -0000 To: commits@hbase.apache.org From: apurtell@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130905210548.0EC3723888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: apurtell Date: Thu Sep 5 21:05:47 2013 New Revision: 1520425 URL: http://svn.apache.org/r1520425 Log: HBASE-9314. Dropping a table always prints a TableInfoMissingException in the master log Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java?rev=1520425&r1=1520424&r2=1520425&view=diff ============================================================================== --- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java (original) +++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/util/FSTableDescriptors.java Thu Sep 5 21:05:47 2013 @@ -176,11 +176,7 @@ public class FSTableDescriptors implemen + tablename, ioe); } - if (tdmt == null) { - LOG.warn("The following folder is in HBase's root directory and " + - "doesn't contain a table descriptor, " + - "do consider deleting it: " + tablename); - } else { + if (tdmt != null) { this.cache.put(tablename, tdmt); } return tdmt == null ? null : tdmt.getTableDescriptor(); @@ -487,6 +483,11 @@ public class FSTableDescriptors implemen return readTableDescriptor(fs, status, false); } + /** + * @param tableName table name + * @return TableDescriptorAndModtime or null if no table descriptor was found + * @throws IOException + */ private TableDescriptorAndModtime getTableDescriptorAndModtime(TableName tableName) throws IOException { // ignore both -ROOT- and .META. tables @@ -496,11 +497,17 @@ public class FSTableDescriptors implemen return getTableDescriptorAndModtime(getTableDir(tableName)); } + /** + * @param tableDir path to table directory + * @return TableDescriptorAndModtime or null if no table descriptor was found + * at the specified path + * @throws IOException + */ private TableDescriptorAndModtime getTableDescriptorAndModtime(Path tableDir) throws IOException { FileStatus status = getTableInfoPath(tableDir); if (status == null) { - throw new TableInfoMissingException("No table descriptor file under " + tableDir); + return null; } HTableDescriptor htd = readTableDescriptor(fs, status, !fsreadonly); return new TableDescriptorAndModtime(status.getModificationTime(), htd);