HBASE-1368 HBASE-1279 broke the build

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@771406 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jean-Daniel Cryans 2009-05-04 19:11:51 +00:00
parent 7a66721ea6
commit 8abe303d1f
4 changed files with 11 additions and 8 deletions

View File

@ -103,6 +103,7 @@ Release 0.20.0 - Unreleased
(Evgeny Ryabitskiy via Stack) (Evgeny Ryabitskiy via Stack)
HBASE-1365 Typo in TableInputFormatBase.setInputColums (Jon Gray via Stack) HBASE-1365 Typo in TableInputFormatBase.setInputColums (Jon Gray via Stack)
HBASE-1279 Fix the way hostnames and IPs are handled HBASE-1279 Fix the way hostnames and IPs are handled
HBASE-1368 HBASE-1279 broke the build
IMPROVEMENTS IMPROVEMENTS
HBASE-1089 Add count of regions on filesystem to master UI; add percentage HBASE-1089 Add count of regions on filesystem to master UI; add percentage

View File

@ -43,7 +43,8 @@ public class HServerInfo implements WritableComparable<HServerInfo> {
/** default constructor - used by Writable */ /** default constructor - used by Writable */
public HServerInfo() { public HServerInfo() {
this(new HServerAddress(), 0, HConstants.DEFAULT_REGIONSERVER_INFOPORT); this(new HServerAddress(), 0,
HConstants.DEFAULT_REGIONSERVER_INFOPORT, "default name");
} }
/** /**
@ -53,11 +54,12 @@ public class HServerInfo implements WritableComparable<HServerInfo> {
* @param infoPort Port the info server is listening on. * @param infoPort Port the info server is listening on.
*/ */
public HServerInfo(HServerAddress serverAddress, long startCode, public HServerInfo(HServerAddress serverAddress, long startCode,
final int infoPort) { final int infoPort, String name) {
this.serverAddress = serverAddress; this.serverAddress = serverAddress;
this.startCode = startCode; this.startCode = startCode;
this.load = new HServerLoad(); this.load = new HServerLoad();
this.infoPort = infoPort; this.infoPort = infoPort;
this.name = name;
} }
/** /**

View File

@ -287,16 +287,16 @@ public class HRegionServer implements HConstants, HRegionInterface,
address.getPort(), conf.getInt("hbase.regionserver.handler.count", 10), address.getPort(), conf.getInt("hbase.regionserver.handler.count", 10),
false, conf); false, conf);
this.server.setErrorHandler(this); this.server.setErrorHandler(this);
String machineName = DNS.getDefaultHost(
conf.get("hbase.regionserver.dns.interface","default"),
conf.get("hbase.regionserver.dns.nameserver","default"));
// Address is givin a default IP for the moment. Will be changed after // Address is givin a default IP for the moment. Will be changed after
// calling the master. // calling the master.
this.serverInfo = new HServerInfo(new HServerAddress( this.serverInfo = new HServerInfo(new HServerAddress(
new InetSocketAddress(address.getBindAddress(), new InetSocketAddress(address.getBindAddress(),
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), machineName);
String machineName = DNS.getDefaultHost(
conf.get("hbase.regionserver.dns.interface","default"),
conf.get("hbase.regionserver.dns.nameserver","default"));
this.serverInfo.setName(machineName);
if (this.serverInfo.getServerAddress() == null) { if (this.serverInfo.getServerAddress() == null) {
throw new NullPointerException("Server address cannot be null; " + throw new NullPointerException("Server address cannot be null; " +
"hbase-958 debugging"); "hbase-958 debugging");

View File

@ -125,7 +125,7 @@ public class TestSerialization extends HBaseTestCase {
*/ */
public void testServerInfo() throws Exception { public void testServerInfo() throws Exception {
HServerInfo hsi = new HServerInfo(new HServerAddress("0.0.0.0:123"), -1, HServerInfo hsi = new HServerInfo(new HServerAddress("0.0.0.0:123"), -1,
1245); 1245, "default name");
byte [] b = Writables.getBytes(hsi); byte [] b = Writables.getBytes(hsi);
HServerInfo deserializedHsi = HServerInfo deserializedHsi =
(HServerInfo)Writables.getWritable(b, new HServerInfo()); (HServerInfo)Writables.getWritable(b, new HServerInfo());