hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aajis...@apache.org
Subject hadoop git commit: YARN-5728. TestMiniYarnClusterNodeUtilization.testUpdateNodeUtilization timeout.
Date Mon, 31 Jul 2017 03:43:44 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8.2 db0bc8faf -> 222771c6a


YARN-5728. TestMiniYarnClusterNodeUtilization.testUpdateNodeUtilization timeout.

(cherry picked from commit f8bed5e9a7d1ece127fb3da123bbfc26ada0016f)
(cherry picked from commit 98c3544e9407e3e1dfae9806d4a8181508952bed)
(cherry picked from commit d57784cbda491f591e1ebd5d7a60e2b5fd23f087)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/222771c6
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/222771c6
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/222771c6

Branch: refs/heads/branch-2.8.2
Commit: 222771c6ad4d04d1661be09f8050b4eee71f0902
Parents: db0bc8f
Author: Akira Ajisaka <aajisaka@apache.org>
Authored: Mon Jul 31 11:09:13 2017 +0900
Committer: Akira Ajisaka <aajisaka@apache.org>
Committed: Mon Jul 31 12:43:38 2017 +0900

----------------------------------------------------------------------
 .../org/apache/hadoop/yarn/server/MiniYARNCluster.java | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/222771c6/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/MiniYARNCluster.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/MiniYARNCluster.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/MiniYARNCluster.java
index 0dd0aa1..b9afdbe 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/MiniYARNCluster.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/MiniYARNCluster.java
@@ -21,6 +21,7 @@ package org.apache.hadoop.yarn.server;
 import java.io.File;
 import java.io.IOException;
 import java.net.InetAddress;
+import java.net.InetSocketAddress;
 import java.net.UnknownHostException;
 import java.util.Collection;
 import java.util.concurrent.ConcurrentHashMap;
@@ -35,6 +36,7 @@ import org.apache.hadoop.fs.FileContext;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.ha.HAServiceProtocol;
 import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
+import org.apache.hadoop.net.NetUtils;
 import org.apache.hadoop.security.token.Token;
 import org.apache.hadoop.service.AbstractService;
 import org.apache.hadoop.service.CompositeService;
@@ -440,7 +442,16 @@ public class MiniYARNCluster extends CompositeService {
 
   public static String getHostname() {
     try {
-      return InetAddress.getLocalHost().getHostName();
+      String hostname = InetAddress.getLocalHost().getHostName();
+      // Create InetSocketAddress to see whether it is resolved or not.
+      // If not, just return "localhost".
+      InetSocketAddress addr =
+          NetUtils.createSocketAddrForHost(hostname, 1);
+      if (addr.isUnresolved()) {
+        return "localhost";
+      } else {
+        return hostname;
+      }
     }
     catch (UnknownHostException ex) {
       throw new RuntimeException(ex);


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message