HBASE-958 IllegalArgumentException: server cannot be null

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@709087 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2008-10-30 04:49:20 +00:00
parent a191bfb60a
commit aeda522393
3 changed files with 13 additions and 2 deletions

View File

@ -49,6 +49,10 @@ class ProcessRegionOpen extends ProcessRegionStatusChange {
throws IOException { throws IOException {
super(master, regionInfo); super(master, regionInfo);
this.serverAddress = info.getServerAddress(); this.serverAddress = info.getServerAddress();
if (this.serverAddress == null) {
throw new NullPointerException("Server address cannot be null; " +
"hbase-958 debugging");
}
this.startCode = Bytes.toBytes(info.getStartCode()); this.startCode = Bytes.toBytes(info.getStartCode());
} }
@ -92,7 +96,7 @@ class ProcessRegionOpen extends ProcessRegionStatusChange {
this.historian.addRegionOpen(regionInfo, serverAddress); this.historian.addRegionOpen(regionInfo, serverAddress);
if (isMetaTable) { if (isMetaTable) {
// It's a meta region. // It's a meta region.
MetaRegion m = new MetaRegion(serverAddress, MetaRegion m = new MetaRegion(new HServerAddress(serverAddress),
regionInfo.getRegionName(), regionInfo.getStartKey()); regionInfo.getRegionName(), regionInfo.getStartKey());
if (!master.regionManager.isInitialMetaScanComplete()) { if (!master.regionManager.isInitialMetaScanComplete()) {
// Put it on the queue to be scanned for the first time. // Put it on the queue to be scanned for the first time.

View File

@ -334,7 +334,10 @@ class ServerManager implements HConstants {
ArrayList<HMsg> returnMsgs = new ArrayList<HMsg>(); ArrayList<HMsg> returnMsgs = new ArrayList<HMsg>();
Map<byte [], HRegionInfo> regionsToKill = Map<byte [], HRegionInfo> regionsToKill =
master.regionManager.removeMarkedToClose(serverName); master.regionManager.removeMarkedToClose(serverName);
if (serverInfo.getServerAddress() == null) {
throw new NullPointerException("Server address cannot be null; " +
"hbase-958 debugging");
}
// Get reports on what the RegionServer did. // Get reports on what the RegionServer did.
for (int i = 0; i < incomingMsgs.length; i++) { for (int i = 0; i < incomingMsgs.length; i++) {
HRegionInfo region = incomingMsgs[i].getRegionInfo(); HRegionInfo region = incomingMsgs[i].getRegionInfo();

View File

@ -274,6 +274,10 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable {
new InetSocketAddress(DEFAULT_HOST, new InetSocketAddress(DEFAULT_HOST,
this.server.getListenerAddress().getPort())), System.currentTimeMillis(), this.server.getListenerAddress().getPort())), System.currentTimeMillis(),
this.conf.getInt("hbase.regionserver.info.port", 60030)); this.conf.getInt("hbase.regionserver.info.port", 60030));
if (this.serverInfo.getServerAddress() == null) {
throw new NullPointerException("Server address cannot be null; " +
"hbase-958 debugging");
}
this.numRegionsToReport = this.numRegionsToReport =
conf.getInt("hbase.regionserver.numregionstoreport", 10); conf.getInt("hbase.regionserver.numregionstoreport", 10);