hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r1080397 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
Date Thu, 10 Mar 2011 23:41:28 GMT
Author: apurtell
Date: Thu Mar 10 23:41:28 2011
New Revision: 1080397

URL: http://svn.apache.org/viewvc?rev=1080397&view=rev
Log:
HBASE-3612  HBaseAdmin::isTableAvailable returns true when the table does not exit

Modified:
    hbase/trunk/CHANGES.txt
    hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1080397&r1=1080396&r2=1080397&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Thu Mar 10 23:41:28 2011
@@ -62,6 +62,8 @@ Release 0.91.0 - Unreleased
                on OOME
    HBASE-1960  Master should wait for DFS to come up when creating
                hbase.version; use alternate strategy for waiting for DNs
+   HBASE-3612  HBaseAdmin::isTableAvailable returns true when the table does
+               not exit
 
   IMPROVEMENTS
    HBASE-3290  Max Compaction Size (Nicolas Spiegelberg via Stack)  

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java?rev=1080397&r1=1080396&r2=1080397&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java Thu Mar
10 23:41:28 2011
@@ -31,6 +31,7 @@ import java.util.concurrent.ExecutionExc
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Future;
 import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -443,6 +444,7 @@ public class HConnectionManager {
 
     public boolean isTableAvailable(final byte[] tableName) throws IOException {
       final AtomicBoolean available = new AtomicBoolean(true);
+      final AtomicInteger regionCount = new AtomicInteger(0);
       MetaScannerVisitor visitor = new MetaScannerVisitor() {
         @Override
         public boolean processRow(Result row) throws IOException {
@@ -457,13 +459,14 @@ public class HConnectionManager {
                 available.set(false);
                 return false;
               }
+              regionCount.incrementAndGet();
             }
           }
           return true;
         }
       };
       MetaScanner.metaScan(conf, visitor);
-      return available.get();
+      return available.get() && (regionCount.get() > 0);
     }
 
     /*



Mime
View raw message