hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r1084843 - in /hbase/trunk: CHANGES.txt src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
Date Thu, 24 Mar 2011 04:33:54 GMT
Author: apurtell
Date: Thu Mar 24 04:33:54 2011
New Revision: 1084843

URL: http://svn.apache.org/viewvc?rev=1084843&view=rev
Log:
HBASE-3697  Admin actions that use MetaReader to iterate regions need to skip offline ones

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

Modified: hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/trunk/CHANGES.txt?rev=1084843&r1=1084842&r2=1084843&view=diff
==============================================================================
--- hbase/trunk/CHANGES.txt (original)
+++ hbase/trunk/CHANGES.txt Thu Mar 24 04:33:54 2011
@@ -44,6 +44,8 @@ Release 0.91.0 - Unreleased
    HBASE-3641  LruBlockCache.CacheStats.getHitCount() is not using the
                correct variable
    HBASE-3532  HRegion#equals is broken (Ted Yu via Stack)
+   HBASE-3697  Admin actions that use MetaReader to iterate regions need to
+               skip offline ones
 
   IMPROVEMENTS
    HBASE-3290  Max Compaction Size (Nicolas Spiegelberg via Stack)  

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java?rev=1084843&r1=1084842&r2=1084843&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/client/HBaseAdmin.java Thu Mar 24 04:33:54
2011
@@ -36,6 +36,7 @@ import org.apache.hadoop.hbase.HRegionLo
 import org.apache.hadoop.hbase.HServerAddress;
 import org.apache.hadoop.hbase.HTableDescriptor;
 import org.apache.hadoop.hbase.MasterNotRunningException;
+import org.apache.hadoop.hbase.NotServingRegionException;
 import org.apache.hadoop.hbase.RegionException;
 import org.apache.hadoop.hbase.RemoteExceptionHandler;
 import org.apache.hadoop.hbase.TableExistsException;
@@ -48,6 +49,7 @@ import org.apache.hadoop.hbase.ipc.HRegi
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Pair;
 import org.apache.hadoop.ipc.RemoteException;
+import org.apache.hadoop.util.StringUtils;
 
 /**
  * Provides an interface to manage HBase database table metadata + general
@@ -832,8 +834,16 @@ public class HBaseAdmin implements Abort
           MetaReader.getTableRegionsAndLocations(getCatalogTracker(),
               Bytes.toString(tableNameOrRegionName));
         for (Pair<HRegionInfo, HServerAddress> pair: pairs) {
+          if (pair.getFirst().isOffline()) continue;
           if (pair.getSecond() == null) continue;
-          flush(pair.getSecond(), pair.getFirst());
+          try {
+            flush(pair.getSecond(), pair.getFirst());
+          } catch (NotServingRegionException e) {
+            if (LOG.isDebugEnabled()) {
+              LOG.debug("Trying to flush " + pair.getFirst() + ": " +
+                StringUtils.stringifyException(e));
+            }
+          }
         }
       }
     } finally {
@@ -926,8 +936,17 @@ public class HBaseAdmin implements Abort
           MetaReader.getTableRegionsAndLocations(ct,
               Bytes.toString(tableNameOrRegionName));
         for (Pair<HRegionInfo, HServerAddress> pair: pairs) {
+          if (pair.getFirst().isOffline()) continue;
           if (pair.getSecond() == null) continue;
-          compact(pair.getSecond(), pair.getFirst(), major);
+          try {
+            compact(pair.getSecond(), pair.getFirst(), major);
+          } catch (NotServingRegionException e) {
+            if (LOG.isDebugEnabled()) {
+              LOG.debug("Trying to" + (major ? " major" : "") + " compact " +
+                pair.getFirst() + ": " +
+                StringUtils.stringifyException(e));
+            }
+          }
         }
       }
     } finally {



Mime
View raw message