hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r922000 - in /hadoop/hbase/trunk: ./ core/src/main/java/org/apache/hadoop/hbase/ core/src/main/java/org/apache/hadoop/hbase/master/ core/src/main/java/org/apache/hadoop/hbase/regionserver/wal/
Date Thu, 11 Mar 2010 20:07:06 GMT
Author: stack
Date: Thu Mar 11 20:07:06 2010
New Revision: 922000

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

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/HServerInfo.java
    hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java
    hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/ProcessServerShutdown.java
    hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
    hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=922000&r1=921999&r2=922000&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Thu Mar 11 20:07:06 2010
@@ -416,7 +416,9 @@ Release 0.21.0 - Unreleased
                (Benoit Sigoure via JD)
    HBASE-2282  More directories should be ignored when using git for development
                (Alexey Kovyrin via Stack)
-    HBASE-2267 More improvements to the Maven build (Lars Francke via Stack)
+   HBASE-2267  More improvements to the Maven build (Lars Francke via Stack)
+   HBASE-2174  Stop from resolving HRegionServer addresses to names using DNS on
+               every heartbeat (Karthik Ranganathan via Stack)
 
   NEW FEATURES
    HBASE-1961  HBase EC2 scripts

Modified: hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/HServerInfo.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/HServerInfo.java?rev=922000&r1=921999&r2=922000&view=diff
==============================================================================
--- hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/HServerInfo.java (original)
+++ hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/HServerInfo.java Thu Mar
11 20:07:06 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/trunk/core/src/main/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java?rev=922000&r1=921999&r2=922000&view=diff
==============================================================================
--- hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java
(original)
+++ hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/ProcessRegionOpen.java
Thu Mar 11 20:07:06 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/trunk/core/src/main/java/org/apache/hadoop/hbase/master/ProcessServerShutdown.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/ProcessServerShutdown.java?rev=922000&r1=921999&r2=922000&view=diff
==============================================================================
--- hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/ProcessServerShutdown.java
(original)
+++ hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/ProcessServerShutdown.java
Thu Mar 11 20:07:06 2010
@@ -69,7 +69,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/trunk/core/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java?rev=922000&r1=921999&r2=922000&view=diff
==============================================================================
--- hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
(original)
+++ hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/master/ServerManager.java
Thu Mar 11 20:07:06 2010
@@ -163,7 +163,7 @@ public class ServerManager implements HC
   void regionServerStartup(final HServerInfo serverInfo) 
   throws Leases.LeaseStillHeldException {
     HServerInfo info = new HServerInfo(serverInfo);
-    String serverName = HServerInfo.getServerName(info);
+    String serverName = info.getServerName();
     if (this.serversToServerInfo.containsKey(serverName) ||
         this.deadServers.contains(serverName)) {
       LOG.debug("Server start was rejected: " + serverInfo);
@@ -217,7 +217,7 @@ public class ServerManager implements HC
    */
   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
@@ -809,7 +809,7 @@ public class ServerManager implements HC
         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/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java?rev=922000&r1=921999&r2=922000&view=diff
==============================================================================
--- hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java
(original)
+++ hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLog.java
Thu Mar 11 20:07:06 2010
@@ -1336,7 +1336,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