HBASE-872 Getting exceptions in shell when creating/disabling tables

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@692585 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2008-09-05 23:57:40 +00:00
parent 1bc2142c54
commit fe19bdd5b2
7 changed files with 14 additions and 14 deletions

View File

@ -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

View File

@ -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

View File

@ -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 */

View File

@ -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));
}

View File

@ -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 */

View File

@ -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() {

View File

@ -446,4 +446,4 @@ public class HColumnDescriptor implements WritableComparable {
}
return result;
}
}
}