You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by br...@apache.org on 2008/04/04 21:44:49 UTC
svn commit: r644854 - in /hadoop/hbase/trunk: CHANGES.txt
src/java/org/apache/hadoop/hbase/client/HConnectionManager.java
src/java/org/apache/hadoop/hbase/client/RegionOfflineException.java
Author: bryanduxbury
Date: Fri Apr 4 12:44:46 2008
New Revision: 644854
URL: http://svn.apache.org/viewvc?rev=644854&view=rev
Log:
HBASE-452 "region offline" should throw IOException, not IllegalStateException
-HConnectionManager#locateRegionInMeta no longer throws ISE, instead throws new RegionOfflineException
-Removed duplicated code for catching exceptions for retries
Added:
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/RegionOfflineException.java
Modified:
hadoop/hbase/trunk/CHANGES.txt
hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java
Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=644854&r1=644853&r2=644854&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Fri Apr 4 12:44:46 2008
@@ -19,6 +19,7 @@
HBASE-469 Streamline HStore startup and compactions
HBASE-544 Purge startUpdate from internal code and test cases
HBASE-557 HTable.getRow() should receive RowResult objects
+ HBASE-452 "region offline" should throw IOException, not IllegalStateException
Release 0.1.0
Modified: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java?rev=644854&r1=644853&r2=644854&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java (original)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java Fri Apr 4 12:44:46 2008
@@ -417,7 +417,7 @@
}
if (regionInfo.isOffline()) {
- throw new IllegalStateException("region offline: " +
+ throw new RegionOfflineException("region offline: " +
regionInfo.getRegionName());
}
@@ -437,15 +437,6 @@
cacheLocation(tableName, location);
return location;
- } catch (IllegalStateException e) {
- if (tries < numRetries - 1) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("reloading table servers because: " + e.getMessage());
- }
- relocateRegion(parentTable, metaKey);
- } else {
- throw e;
- }
} catch (TableNotFoundException e) {
// if we got this error, probably means the table just plain doesn't
// exist. rethrow the error immediately. this should always be coming
Added: hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/RegionOfflineException.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/RegionOfflineException.java?rev=644854&view=auto
==============================================================================
--- hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/RegionOfflineException.java (added)
+++ hadoop/hbase/trunk/src/java/org/apache/hadoop/hbase/client/RegionOfflineException.java Fri Apr 4 12:44:46 2008
@@ -0,0 +1,35 @@
+/**
+ * Copyright 2008 The Apache Software Foundation
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.client;
+
+import java.io.IOException;
+
+/** Thrown when a table can not be located */
+public class RegionOfflineException extends IOException {
+ /** default constructor */
+ public RegionOfflineException() {
+ super();
+ }
+
+ /** @param s message */
+ public RegionOfflineException(String s) {
+ super(s);
+ }
+}