Index: src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java (revision 1067397) +++ src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java (working copy) @@ -50,7 +50,6 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.locks.ReentrantReadWriteLock; -import com.google.common.collect.Lists; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -76,7 +75,6 @@ import org.apache.hadoop.hbase.UnknownRowLockException; import org.apache.hadoop.hbase.UnknownScannerException; import org.apache.hadoop.hbase.YouAreDeadException; -import org.apache.hadoop.hbase.HConstants.OperationStatusCode; import org.apache.hadoop.hbase.catalog.CatalogTracker; import org.apache.hadoop.hbase.catalog.MetaEditor; import org.apache.hadoop.hbase.catalog.RootLocationEditor; @@ -136,6 +134,7 @@ import org.apache.zookeeper.KeeperException; import com.google.common.base.Function; +import com.google.common.collect.Lists; /** * HRegionServer makes a set of HRegions available to clients. It checks in with @@ -839,16 +838,7 @@ protected void handleReportForDutyResponse(final MapWritable c) throws IOException { try { for (Map.Entry e : c.entrySet()) { - String key = e.getKey().toString(); - // Use the address the master passed us - if (key.equals("hbase.regionserver.address")) { - HServerAddress hsa = (HServerAddress) e.getValue(); - LOG.info("Master passed us address to use. Was=" - + this.serverInfo.getServerAddress() + ", Now=" + hsa.toString()); - this.serverInfo.setServerAddress(hsa); - continue; - } String value = e.getValue().toString(); if (LOG.isDebugEnabled()) { LOG.debug("Config from master: " + key + "=" + value); Index: src/main/java/org/apache/hadoop/hbase/master/ServerManager.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/master/ServerManager.java (revision 1067397) +++ src/main/java/org/apache/hadoop/hbase/master/ServerManager.java (working copy) @@ -123,11 +123,10 @@ // is, reject the server and trigger its expiration. The next time it comes // in, it should have been removed from serverAddressToServerInfo and queued // for processing by ProcessServerShutdown. - HServerInfo info = new HServerInfo(serverInfo); - checkIsDead(info.getServerName(), "STARTUP"); - checkAlreadySameHostPort(info); - checkClockSkew(info, serverCurrentTime); - recordNewServer(info, false, null); + checkIsDead(serverInfo.getServerName(), "STARTUP"); + checkAlreadySameHostPort(serverInfo); + checkClockSkew(serverInfo, serverCurrentTime); + recordNewServer(serverInfo, false, null); } /** @@ -240,24 +239,21 @@ HMsg [] regionServerReport(final HServerInfo serverInfo, final HMsg [] msgs, final HRegionInfo[] mostLoadedRegions) throws IOException { - // Be careful. This method does returns in the middle. - HServerInfo info = new HServerInfo(serverInfo); - // Check if dead. If it is, it'll get a 'You Are Dead!' exception. - checkIsDead(info.getServerName(), "REPORT"); + checkIsDead(serverInfo.getServerName(), "REPORT"); // If we don't know this server, tell it shutdown. - HServerInfo storedInfo = this.onlineServers.get(info.getServerName()); + HServerInfo storedInfo = this.onlineServers.get(serverInfo.getServerName()); if (storedInfo == null) { // Maybe we already have this host+port combo and its just different // start code? - checkAlreadySameHostPort(info); + checkAlreadySameHostPort(serverInfo); // Just let the server in. Presume master joining a running cluster. // recordNewServer is what happens at the end of reportServerStartup. // The only thing we are skipping is passing back to the regionserver // the HServerInfo to use. Here we presume a master has already done // that so we'll press on with whatever it gave us for HSI. - recordNewServer(info, true, null); + recordNewServer(serverInfo, true, null); // If msgs, put off their processing but this is not enough because // its possible that the next time the server reports in, we'll still // not be up and serving. For example, if a split, we'll need the @@ -270,7 +266,7 @@ } // Check startcodes - if (raceThatShouldNotHappenAnymore(storedInfo, info)) { + if (raceThatShouldNotHappenAnymore(storedInfo, serverInfo)) { return HMsg.STOP_REGIONSERVER_ARRAY; } @@ -299,7 +295,7 @@ reply = HMsg.STOP_REGIONSERVER_ARRAY; } } - return processRegionServerAllsWell(info, mostLoadedRegions, reply); + return processRegionServerAllsWell(serverInfo, mostLoadedRegions, reply); } private boolean raceThatShouldNotHappenAnymore(final HServerInfo storedInfo, Index: src/main/java/org/apache/hadoop/hbase/master/HMaster.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/master/HMaster.java (revision 1067397) +++ src/main/java/org/apache/hadoop/hbase/master/HMaster.java (working copy) @@ -599,23 +599,10 @@ public MapWritable regionServerStartup(final HServerInfo serverInfo, final long serverCurrentTime) throws IOException { - // Set the ip into the passed in serverInfo. Its ip is more than likely - // not the ip that the master sees here. See at end of this method where - // we pass it back to the regionserver by setting "hbase.regionserver.address" - // Everafter, the HSI combination 'server name' is what uniquely identifies - // the incoming RegionServer. - InetSocketAddress address = new InetSocketAddress( - HBaseServer.getRemoteIp().getHostName(), - serverInfo.getServerAddress().getPort()); - serverInfo.setServerAddress(new HServerAddress(address)); - // Register with server manager this.serverManager.regionServerStartup(serverInfo, serverCurrentTime); // Send back some config info - MapWritable mw = createConfigurationSubset(); - mw.put(new Text("hbase.regionserver.address"), - serverInfo.getServerAddress()); - return mw; + return createConfigurationSubset(); } /**