HBASE-10614 Master could not be stopped (Jingcheng Du)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1571915 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2014-02-26 04:32:12 +00:00
parent d77ef9a8b5
commit 29a526ab73
2 changed files with 7 additions and 4 deletions

View File

@ -163,11 +163,11 @@ public class MetaReader {
private static HTable getHTable(final CatalogTracker catalogTracker,
final TableName tableName)
throws IOException {
// Passing the CatalogTracker's connection configuration ensures this
// Passing the CatalogTracker's connection ensures this
// HTable instance uses the CatalogTracker's connection.
org.apache.hadoop.hbase.client.HConnection c = catalogTracker.getConnection();
if (c == null) throw new NullPointerException("No connection");
return new HTable(catalogTracker.getConnection().getConfiguration(), tableName);
return new HTable(tableName, c);
}
/**

View File

@ -168,8 +168,11 @@ public class ServerShutdownHandler extends EventHandler {
while (!this.server.isStopped()) {
try {
this.server.getCatalogTracker().waitForMeta();
hris = MetaReader.getServerUserRegions(this.server.getCatalogTracker(),
this.serverName);
// Skip getting user regions if the server is stopped.
if (!this.server.isStopped()) {
hris = MetaReader.getServerUserRegions(this.server.getCatalogTracker(),
this.serverName);
}
break;
} catch (InterruptedException e) {
Thread.currentThread().interrupt();