From 4f82642185872709b68c5e46f796fe3194de4c4d Mon Sep 17 00:00:00 2001 From: Suresh Srinivas Date: Tue, 9 Apr 2013 19:09:01 +0000 Subject: [PATCH] HDFS-4669. Merge change 1466176 from trunk git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1466181 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../src/main/java/org/apache/hadoop/hdfs/DFSUtil.java | 2 +- .../hadoop/hdfs/server/datanode/BlockPoolManager.java | 6 +++--- .../hadoop/hdfs/server/datanode/TestBlockPoolManager.java | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 9e9ac30a8a1..500958dcb82 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -141,6 +141,9 @@ Release 2.0.5-beta - UNRELEASED HDFS-4676. TestHDFSFileSystemContract should set MiniDFSCluster variable to null to free up memory. (suresh) + HDFS-4669. TestBlockPoolManager fails using IBM java. (Tian Hong Wang via + suresh) + Release 2.0.4-alpha - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java index d5073df14a3..69297c46dbb 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSUtil.java @@ -458,7 +458,7 @@ public class DFSUtil { // Look for configurations of the form [.][.] // across all of the configured nameservices and namenodes. - Map> ret = Maps.newHashMap(); + Map> ret = Maps.newLinkedHashMap(); for (String nsId : emptyAsSingletonNull(nameserviceIds)) { Map isas = getAddressesForNameserviceId(conf, nsId, defaultAddress, keys); diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolManager.java index 54cbb184bf6..73cc3c48d1d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolManager.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockPoolManager.java @@ -160,8 +160,8 @@ class BlockPoolManager { Map> addrMap) throws IOException { assert Thread.holdsLock(refreshNamenodesLock); - Set toRefresh = Sets.newHashSet(); - Set toAdd = Sets.newHashSet(); + Set toRefresh = Sets.newLinkedHashSet(); + Set toAdd = Sets.newLinkedHashSet(); Set toRemove; synchronized (this) { @@ -239,4 +239,4 @@ class BlockPoolManager { protected BPOfferService createBPOS(List nnAddrs) { return new BPOfferService(nnAddrs, dn); } -} \ No newline at end of file +} diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockPoolManager.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockPoolManager.java index 3b07fe7978a..e1bbd9a4d26 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockPoolManager.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockPoolManager.java @@ -113,7 +113,7 @@ public class TestBlockPoolManager { // Remove the first NS conf.set(DFSConfigKeys.DFS_NAMESERVICES, - "ns1"); + "ns2"); bpm.refreshNamenodes(conf); assertEquals( "stop #1\n" +