From f05a2e5b699eda077de6044a6beb18b3e6c98016 Mon Sep 17 00:00:00 2001 From: Suresh Srinivas Date: Fri, 24 May 2013 19:16:58 +0000 Subject: [PATCH] HDFS-4722. Merge r1476597 from trunk git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1486176 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../org/apache/hadoop/hdfs/tools/TestGetConf.java | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index d546c4e5644..5d31b5cbd7c 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -394,6 +394,9 @@ Release 2.0.5-beta - UNRELEASED HDFS-4740. Fixes for a few test failures on Windows. (Arpit Agarwal via suresh) + HDFS-4722. TestGetConf#testFederation times out on Windows. + (Ivan Mitic via suresh) + Release 2.0.4-alpha - 2013-04-25 INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestGetConf.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestGetConf.java index f6730c1d4c1..7a17cea2d65 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestGetConf.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestGetConf.java @@ -87,6 +87,16 @@ public class TestGetConf { return values; } + /** + * Add namenodes to the static resolution list to avoid going + * through DNS which can be really slow in some configurations. + */ + private void setupStaticHostResolution(int nameServiceIdCount) { + for (int i = 0; i < nameServiceIdCount; i++) { + NetUtils.addStaticResolution("nn" + i, "localhost"); + } + } + /* * Convert the map returned from DFSUtil functions to an array of * addresses represented as "host:port" @@ -306,6 +316,7 @@ public class TestGetConf { String[] nnAddresses = setupAddress(conf, DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, nsCount, 1000); setupAddress(conf, DFS_NAMENODE_RPC_ADDRESS_KEY, nsCount, 1500); + setupStaticHostResolution(nsCount); String[] backupAddresses = setupAddress(conf, DFS_NAMENODE_BACKUP_ADDRESS_KEY, nsCount, 2000); String[] secondaryAddresses = setupAddress(conf,