hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1488834 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
Date Mon, 03 Jun 2013 03:47:39 GMT
Author: stack
Date: Mon Jun  3 03:47:38 2013
New Revision: 1488834

URL: http://svn.apache.org/r1488834
Log:
HBASE-8640 ServerName in master may not initialize with the configured ipc address of hbase.master.ipc.address

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java?rev=1488834&r1=1488833&r2=1488834&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java (original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java Mon
Jun  3 03:47:38 2013
@@ -380,23 +380,16 @@ MasterServices, Server {
     // Disable the block cache on the master
     this.conf.setFloat(HConstants.HFILE_BLOCK_CACHE_SIZE_KEY, 0.0f);
     // Server to handle client requests.
-    String hostname = Strings.domainNamePointerToHostName(DNS.getDefaultHost(
-      conf.get("hbase.master.dns.interface", "default"),
-      conf.get("hbase.master.dns.nameserver", "default")));
+    String hostname = conf.get("hbase.master.ipc.address",
+      Strings.domainNamePointerToHostName(DNS.getDefaultHost(
+        conf.get("hbase.master.dns.interface", "default"),
+        conf.get("hbase.master.dns.nameserver", "default"))));
     int port = conf.getInt(HConstants.MASTER_PORT, HConstants.DEFAULT_MASTER_PORT);
     // Test that the hostname is reachable
     InetSocketAddress initialIsa = new InetSocketAddress(hostname, port);
     if (initialIsa.getAddress() == null) {
       throw new IllegalArgumentException("Failed resolve of hostname " + initialIsa);
     }
-    // Verify that the bind address is reachable if set
-    String bindAddress = conf.get("hbase.master.ipc.address");
-    if (bindAddress != null) {
-      initialIsa = new InetSocketAddress(bindAddress, port);
-      if (initialIsa.getAddress() == null) {
-        throw new IllegalArgumentException("Failed resolve of bind address " + initialIsa);
-      }
-    }
     String name = "master/" + initialIsa.toString();
     // Set how many times to retry talking to another server over HConnection.
     HConnectionManager.setServerSideHConnectionRetries(this.conf, name, LOG);
@@ -410,7 +403,8 @@ MasterServices, Server {
       0); // this is a DNC w/o high priority handlers
     // Set our address.
     this.isa = this.rpcServer.getListenerAddress();
-    this.serverName = new ServerName(hostname, this.isa.getPort(), System.currentTimeMillis());
+    this.serverName =
+        new ServerName(this.isa.getHostName(), this.isa.getPort(), System.currentTimeMillis());
     this.rsFatals = new MemoryBoundedLogMessageBuffer(
       conf.getLong("hbase.master.buffer.for.rs.fatals", 1*1024*1024));
 



Mime
View raw message