hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r921997 - in /hadoop/hbase/branches/0.20: ./ src/java/org/apache/hadoop/hbase/ src/java/org/apache/hadoop/hbase/master/ src/java/org/apache/hadoop/hbase/regionserver/
Date Thu, 11 Mar 2010 19:55:49 GMT
Author: stack
Date: Thu Mar 11 19:55:48 2010
New Revision: 921997

URL: http://svn.apache.org/viewvc?rev=921997&view=rev
Log:
HBASE-2174 Stop from resolving HRegionServer addresses to names using DNS on every heartbeat

Modified:
    hadoop/hbase/branches/0.20/CHANGES.txt
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/HServerInfo.java
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ProcessServerShutdown.java
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ServerManager.java
    hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HLog.java

Modified: hadoop/hbase/branches/0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/CHANGES.txt?rev=921997&r1=921996&r2=921997&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20/CHANGES.txt Thu Mar 11 19:55:48 2010
@@ -56,6 +56,8 @@ Release 0.20.4 - Unreleased
    HBASE-2277  Update branch to hadoop 0.20.2
    HBASE-2234  Roll Hlog if any datanode in the write pipeline dies
                (Nicolas Spiegelberg via Stack)
+   HBASE-2174  Stop from resolving HRegionServer addresses to names using DNS
+               on every heartbeat (Karthik Ranganathan via Stack)
 
   NEW FEATURES
    HBASE-2257  [stargate] multiuser mode

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/HServerInfo.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/HServerInfo.java?rev=921997&r1=921996&r2=921997&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/HServerInfo.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/HServerInfo.java Thu Mar 11
19:55:48 2010
@@ -137,8 +137,15 @@ public class HServerInfo implements Writ
    */
   public synchronized String getServerName() {
     if (this.serverName == null) {
+      // if we have the hostname of the RS, use it
+      if(this.name != null) {
+        this.serverName = getServerName(this.name, this.serverAddress.getPort(), this.startCode);
+      }
+      // go to DNS name resolution only if we dont have the name of the RS
+      else {
       this.serverName = getServerName(this.serverAddress, this.startCode);
     }
+    }
     return this.serverName;
   }
   
@@ -219,7 +226,7 @@ public class HServerInfo implements Writ
    * @param info
    * @return the server name in the form hostname_startcode_port
    */
-  public static String getServerName(HServerInfo info) {
+  private static String getServerName(HServerInfo info) {
     return getServerName(info.getServerAddress(), info.getStartCode());
   }
   

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java?rev=921997&r1=921996&r2=921997&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java
(original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java
Thu Mar 11 19:55:48 2010
@@ -53,7 +53,7 @@ class ProcessRegionOpen extends ProcessR
 
   @Override
   public String toString() {
-    return "PendingOpenOperation from " + HServerInfo.getServerName(serverInfo);
+    return "PendingOpenOperation from " + serverInfo.getServerName();
   }
 
   @Override

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ProcessServerShutdown.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ProcessServerShutdown.java?rev=921997&r1=921996&r2=921997&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ProcessServerShutdown.java
(original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ProcessServerShutdown.java
Thu Mar 11 19:55:48 2010
@@ -74,7 +74,7 @@ class ProcessServerShutdown extends Regi
    */
   public ProcessServerShutdown(HMaster master, HServerInfo serverInfo) {
     super(master);
-    this.deadServer = HServerInfo.getServerName(serverInfo);
+    this.deadServer = serverInfo.getServerName();
     this.deadServerAddress = serverInfo.getServerAddress();
     this.logSplit = false;
     this.rootRescanned = false;

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ServerManager.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ServerManager.java?rev=921997&r1=921996&r2=921997&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ServerManager.java
(original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/master/ServerManager.java
Thu Mar 11 19:55:48 2010
@@ -155,7 +155,7 @@ class ServerManager implements HConstant
   public void regionServerStartup(final HServerInfo serverInfo) 
   throws Leases.LeaseStillHeldException {
     HServerInfo info = new HServerInfo(serverInfo);
-    String serverName = HServerInfo.getServerName(info);
+    String serverName = info.getServerName();
     if (serversToServerInfo.containsKey(serverName) ||
         deadServers.contains(serverName)) {
       LOG.debug("Server start was rejected: " + serverInfo);
@@ -212,7 +212,7 @@ class ServerManager implements HConstant
    */
   public void recordNewServer(HServerInfo info, boolean useInfoLoad) {
     HServerLoad load = useInfoLoad ? info.getLoad() : new HServerLoad();
-    String serverName = HServerInfo.getServerName(info);
+    String serverName = info.getServerName();
     info.setLoad(load);
     // We must set this watcher here because it can be set on a fresh start
     // or on a failover
@@ -834,7 +834,7 @@ class ServerManager implements HConstant
         serverAddressToServerInfo.remove(serverAddress);
         HServerInfo info = serversToServerInfo.remove(server);
         if (info != null) {
-          String serverName = HServerInfo.getServerName(info);
+          String serverName = info.getServerName();
           HServerLoad load = serversToLoad.remove(serverName);
           if (load != null) {
             synchronized (loadToServers) {

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HLog.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HLog.java?rev=921997&r1=921996&r2=921997&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HLog.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HLog.java Thu
Mar 11 19:55:48 2010
@@ -1413,7 +1413,7 @@ public class HLog implements HConstants,
    * @return the HLog directory name
    */
   public static String getHLogDirectoryName(HServerInfo info) {
-    return getHLogDirectoryName(HServerInfo.getServerName(info));
+    return getHLogDirectoryName(info.getServerName());
   }
   
   /**



Mime
View raw message