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

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@644854 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bryan Duxbury 2008-04-04 19:44:46 +00:00
parent bb8dce00f2
commit 9ea7aec67d
3 changed files with 37 additions and 10 deletions

View File

@ -19,6 +19,7 @@ Hbase Change Log
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

View File

@ -417,7 +417,7 @@ public class HConnectionManager implements HConstants {
}
if (regionInfo.isOffline()) {
throw new IllegalStateException("region offline: " +
throw new RegionOfflineException("region offline: " +
regionInfo.getRegionName());
}
@ -437,15 +437,6 @@ public class HConnectionManager implements HConstants {
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

View File

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