From d9593621b5739a6c2a4f2ea7817d7783326a3886 Mon Sep 17 00:00:00 2001 From: Suresh Srinivas Date: Tue, 9 Apr 2013 19:04:28 +0000 Subject: [PATCH] HDFS-4669. TestBlockPoolManager fails using IBM java. Contributed by Tian Hong Wang. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1466176 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 c9d751b0b61..18362042b2d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -495,6 +495,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 44d1fda7919..fabb013b5f5 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 @@ -460,7 +460,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" +