You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ec...@apache.org on 2012/10/02 22:40:02 UTC
svn commit: r1393166 - in /hbase/branches/0.92: CHANGES.txt
src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
Author: eclark
Date: Tue Oct 2 20:40:01 2012
New Revision: 1393166
URL: http://svn.apache.org/viewvc?rev=1393166&view=rev
Log:
HBASE-6914 Scans/Gets/Mutations don't give a good error if the table is disabled.
Modified:
hbase/branches/0.92/CHANGES.txt
hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
Modified: hbase/branches/0.92/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/CHANGES.txt?rev=1393166&r1=1393165&r2=1393166&view=diff
==============================================================================
--- hbase/branches/0.92/CHANGES.txt (original)
+++ hbase/branches/0.92/CHANGES.txt Tue Oct 2 20:40:01 2012
@@ -7,6 +7,7 @@ Release 0.92.3 - Unreleased
HBASE-6906 TestHBaseFsck#testQuarantine* tests are flakey due to TableNotEnabledException
IMPROVEMENTS
+ HBASE-6914 Scans/Gets/Mutations don't give a good error if the table is disabled.
NEW FEATURE
Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java?rev=1393166&r1=1393165&r2=1393166&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java (original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/client/HConnectionManager.java Tue Oct 2 20:40:01 2012
@@ -786,6 +786,14 @@ public class HConnectionManager {
public HRegionLocation relocateRegion(final byte [] tableName,
final byte [] row)
throws IOException{
+
+ // Since this is an explicit request not to use any caching, finding
+ // disabled tables should not be desirable. This will ensure that an exception is thrown when
+ // the first time a disabled table is interacted with.
+ if (isTableDisabled(tableName)) {
+ throw new DoNotRetryIOException(Bytes.toString(tableName) + " is disabled.");
+ }
+
return locateRegion(tableName, row, false);
}
Modified: hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java?rev=1393166&r1=1393165&r2=1393166&view=diff
==============================================================================
--- hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java (original)
+++ hbase/branches/0.92/src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java Tue Oct 2 20:40:01 2012
@@ -245,9 +245,7 @@ public class TestAdmin {
boolean ok = false;
try {
ht.get(get);
- } catch (NotServingRegionException e) {
- ok = true;
- } catch (RetriesExhaustedException e) {
+ } catch (DoNotRetryIOException e) {
ok = true;
}
assertTrue(ok);
@@ -290,23 +288,22 @@ public class TestAdmin {
try {
ht1.get(get);
ht2.get(get);
- } catch (NotServingRegionException e) {
- ok = true;
- } catch (RetriesExhaustedException e) {
+ } catch (DoNotRetryIOException e) {
ok = true;
}
+
assertTrue(ok);
this.admin.enableTables("testDisableAndEnableTable.*");
// Test that tables are enabled
try {
ht1.get(get);
- } catch (RetriesExhaustedException e) {
+ } catch (IOException e) {
ok = false;
}
try {
ht2.get(get);
- } catch (RetriesExhaustedException e) {
+ } catch (IOException e) {
ok = false;
}
assertTrue(ok);
@@ -920,9 +917,10 @@ public class TestAdmin {
this.admin.disableTable(tableName);
try {
new HTable(TEST_UTIL.getConfiguration(), tableName);
- } catch (org.apache.hadoop.hbase.client.RegionOfflineException e) {
- // Expected
+ } catch (DoNotRetryIOException e) {
+ //expected
}
+
this.admin.addColumn(tableName, new HColumnDescriptor("col2"));
this.admin.enableTable(tableName);
try {