HBASE-3113 Don't reassign regions if cluster is being shutdown; part 2 -- fix wrongly named exception and let out IOEs when opening regions on RS

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1023115 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2010-10-15 21:22:38 +00:00
parent 349b7a74c8
commit 509beae1e2
4 changed files with 15 additions and 7 deletions

View File

@ -299,14 +299,18 @@ public interface HRegionInterface extends HBaseRPCProtocolVersion, Stoppable, Ab
/**
* Opens the specified region.
* @param region region to open
* @param RegionServerStoppedException
* @param IOException
*/
public void openRegion(final HRegionInfo region);
public void openRegion(final HRegionInfo region) throws IOException;
/**
* Opens the specified regions.
* @param regions regions to open
* @param RegionServerStoppedException
* @param IOException
*/
public void openRegions(final List<HRegionInfo> regions);
public void openRegions(final List<HRegionInfo> regions) throws IOException;
/**
* Closes the specified region.

View File

@ -506,7 +506,8 @@ public class ServerManager {
* @param server server to open a region
* @param region region to open
*/
public void sendRegionOpen(HServerInfo server, HRegionInfo region) {
public void sendRegionOpen(HServerInfo server, HRegionInfo region)
throws IOException {
HRegionInterface hri = getServerConnection(server);
if (hri == null) {
LOG.warn("Attempting to send OPEN RPC to server " + server.getServerName()
@ -524,7 +525,8 @@ public class ServerManager {
* @param server server to open a region
* @param regions regions to open
*/
public void sendRegionOpen(HServerInfo server, List<HRegionInfo> regions) {
public void sendRegionOpen(HServerInfo server, List<HRegionInfo> regions)
throws IOException {
HRegionInterface hri = getServerConnection(server);
if (hri == null) {
LOG.warn("Attempting to send OPEN RPC to server " + server.getServerName()

View File

@ -1929,7 +1929,8 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler,
// Region open/close direct RPCs
@Override
public void openRegion(HRegionInfo region) {
public void openRegion(HRegionInfo region)
throws RegionServerStoppedException {
LOG.info("Received request to open region: " +
region.getRegionNameAsString());
if (this.stopped) throw new RegionServerStoppedException();
@ -1943,7 +1944,8 @@ public class HRegionServer implements HRegionInterface, HBaseRPCErrorHandler,
}
@Override
public void openRegions(List<HRegionInfo> regions) {
public void openRegions(List<HRegionInfo> regions)
throws RegionServerStoppedException {
LOG.info("Received request to open " + regions.size() + " region(s)");
for (HRegionInfo region: regions) openRegion(region);
}

View File

@ -25,5 +25,5 @@ import org.apache.hadoop.hbase.DoNotRetryIOException;
* Thrown by the region server when it is shutting down state.
*/
@SuppressWarnings("serial")
public class RegionServerClosedException extends DoNotRetryIOException {
public class RegionServerStoppedException extends DoNotRetryIOException {
}