diff --git a/CHANGES.txt b/CHANGES.txt index 29a47672be0..04fa3d04548 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -57,6 +57,7 @@ Release 0.18.0 - Unreleased the region location cache HBASE-864 Deadlock in regionserver HBASE-865 Fix javadoc warnings (Rong-En Fan via Jim Kellerman) + HBASE-872 Getting exceptions in shell when creating/disabling tables IMPROVEMENTS HBASE-801 When a table haven't disable, shell could response in a "user diff --git a/bin/hirb.rb b/bin/hirb.rb index 7a49f391636..81f42f5431f 100644 --- a/bin/hirb.rb +++ b/bin/hirb.rb @@ -70,7 +70,7 @@ end # Turn off retries in hbase and ipc. Human doesn't want to wait on N retries. @configuration = org.apache.hadoop.hbase.HBaseConfiguration.new() @configuration.set("hbase.master", master) if master -@configuration.setInt("hbase.client.retries.number", 3) +@configuration.setInt("hbase.client.retries.number", 5) @configuration.setInt("ipc.client.connect.max.retries", 3) # Do lazy create of admin because if we are pointed at bad master, it will hang diff --git a/src/java/org/apache/hadoop/hbase/TableNotFoundException.java b/src/java/org/apache/hadoop/hbase/TableNotFoundException.java index 4191b4e4490..dc6da43e470 100644 --- a/src/java/org/apache/hadoop/hbase/TableNotFoundException.java +++ b/src/java/org/apache/hadoop/hbase/TableNotFoundException.java @@ -19,10 +19,8 @@ */ package org.apache.hadoop.hbase; -import java.io.IOException; - /** Thrown when a table can not be located */ -public class TableNotFoundException extends IOException { +public class TableNotFoundException extends RegionException { private static final long serialVersionUID = 993179627856392526L; /** default constructor */ diff --git a/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java b/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java index 7b7992a9e2b..f98f23d2ecf 100644 --- a/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java +++ b/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java @@ -31,9 +31,9 @@ import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.HRegionLocation; import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.MasterNotRunningException; +import org.apache.hadoop.hbase.RegionException; import org.apache.hadoop.hbase.RemoteExceptionHandler; import org.apache.hadoop.hbase.TableExistsException; -import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.io.Cell; import org.apache.hadoop.hbase.io.RowResult; import org.apache.hadoop.hbase.ipc.HMasterInterface; @@ -145,7 +145,7 @@ public class HBaseAdmin { connection.locateRegion(desc.getName(), HConstants.EMPTY_START_ROW); break; - } catch (TableNotFoundException e) { + } catch (RegionException e) { if (tries == numRetries - 1) { // Ran out of tries throw e; @@ -368,9 +368,10 @@ public class HBaseAdmin { Bytes.toString(tableName)); } } - if (isTableEnabled(tableName)) - throw new IOException("unable to disable table " + - Bytes.toString(tableName)); + if (isTableEnabled(tableName)) { + throw new RegionException("Retries exhausted, it took too long to wait"+ + " for the table " + Bytes.toString(tableName) + " to be disabled."); + } LOG.info("Disabled " + Bytes.toString(tableName)); } diff --git a/src/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java b/src/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java index 3187ab1a3e5..592061b8382 100644 --- a/src/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java +++ b/src/java/org/apache/hadoop/hbase/client/NoServerForRegionException.java @@ -19,12 +19,12 @@ */ package org.apache.hadoop.hbase.client; -import java.io.IOException; +import org.apache.hadoop.hbase.RegionException; /** * Thrown when no region server can be found for a region */ -public class NoServerForRegionException extends IOException { +public class NoServerForRegionException extends RegionException { private static final long serialVersionUID = 1L << 11 - 1L; /** default constructor */ diff --git a/src/java/org/apache/hadoop/hbase/client/RegionOfflineException.java b/src/java/org/apache/hadoop/hbase/client/RegionOfflineException.java index f60afc21735..ccbd5929823 100644 --- a/src/java/org/apache/hadoop/hbase/client/RegionOfflineException.java +++ b/src/java/org/apache/hadoop/hbase/client/RegionOfflineException.java @@ -19,10 +19,10 @@ */ package org.apache.hadoop.hbase.client; -import java.io.IOException; +import org.apache.hadoop.hbase.RegionException; /** Thrown when a table can not be located */ -public class RegionOfflineException extends IOException { +public class RegionOfflineException extends RegionException { private static final long serialVersionUID = 466008402L; /** default constructor */ public RegionOfflineException() { diff --git a/src/java/org/apache/hadoop/hbase/util/migration/v5/HColumnDescriptor.java b/src/java/org/apache/hadoop/hbase/util/migration/v5/HColumnDescriptor.java index 60390d8f60d..3bdbaba80c4 100644 --- a/src/java/org/apache/hadoop/hbase/util/migration/v5/HColumnDescriptor.java +++ b/src/java/org/apache/hadoop/hbase/util/migration/v5/HColumnDescriptor.java @@ -446,4 +446,4 @@ public class HColumnDescriptor implements WritableComparable { } return result; } -} \ No newline at end of file +}