HDFS-8034. Fix TestDFSClientRetries#testDFSClientConfigurationLocateFollowingBlockInitialDelay for Windows. Contributed by Xiaoyu Yao.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/310c997b Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/310c997b Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/310c997b Branch: refs/heads/YARN-2928 Commit: 310c997b56c53e660be31809cb4da74114824666 Parents: ff35b52 Author: cnauroth <cnaur...@apache.org> Authored: Fri Apr 3 10:10:11 2015 -0700 Committer: Zhijie Shen <zjs...@apache.org> Committed: Mon Apr 6 12:08:15 2015 -0700 ---------------------------------------------------------------------- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 4 +++ .../hadoop/hdfs/TestDFSClientRetries.java | 33 +++++++++++--------- 2 files changed, 22 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/310c997b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 04eac75..366d8fb 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1366,6 +1366,10 @@ Release 2.7.0 - UNRELEASED HDFS-7954. TestBalancer#testBalancerWithPinnedBlocks should not be executed on Windows. (Xiaoyu Yao via szetszwo) + HDFS-8034. Fix + TestDFSClientRetries#testDFSClientConfigurationLocateFollowingBlockInitialDelay + for Windows. (Xiaoyu Yao via cnauroth) + BREAKDOWN OF HDFS-7584 SUBTASKS AND RELATED JIRAS HDFS-7720. Quota by Storage Type API, tools and ClientNameNode http://git-wip-us.apache.org/repos/asf/hadoop/blob/310c997b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientRetries.java ---------------------------------------------------------------------- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientRetries.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientRetries.java index 3912774..c4258eb 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientRetries.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientRetries.java @@ -1136,20 +1136,23 @@ public class TestDFSClientRetries { throws Exception { // test if DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_INITIAL_DELAY_KEY // is not configured, verify DFSClient uses the default value 400. - Configuration dfsConf = new HdfsConfiguration(); - MiniDFSCluster cluster = new MiniDFSCluster.Builder(dfsConf).build(); - cluster.waitActive(); - NamenodeProtocols nn = cluster.getNameNodeRpc(); - DFSClient client = new DFSClient(null, nn, dfsConf, null); - assertEquals(client.getConf(). - getBlockWriteLocateFollowingInitialDelayMs(), 400); - - // change DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_INITIAL_DELAY_KEY, - // verify DFSClient uses the configured value 1000. - dfsConf.setInt(DFSConfigKeys. - DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_INITIAL_DELAY_KEY, 1000); - client = new DFSClient(null, nn, dfsConf, null); - assertEquals(client.getConf(). - getBlockWriteLocateFollowingInitialDelayMs(), 1000); + MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).build(); + try { + cluster.waitActive(); + NamenodeProtocols nn = cluster.getNameNodeRpc(); + DFSClient client = new DFSClient(null, nn, conf, null); + assertEquals(client.getConf(). + getBlockWriteLocateFollowingInitialDelayMs(), 400); + + // change DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_INITIAL_DELAY_KEY, + // verify DFSClient uses the configured value 1000. + conf.setInt(DFSConfigKeys. + DFS_CLIENT_BLOCK_WRITE_LOCATEFOLLOWINGBLOCK_INITIAL_DELAY_KEY, 1000); + client = new DFSClient(null, nn, conf, null); + assertEquals(client.getConf(). + getBlockWriteLocateFollowingInitialDelayMs(), 1000); + } finally { + cluster.shutdown(); + } } }