hadoop git commit: Revert "HDFS-10990. TestPendingInvalidateBlock should wait for IBRs. Contributed by Yiqun Lin."
Repository: hadoop Updated Branches: refs/heads/branch-2.8 ded91992a -> 3892fd810 Revert "HDFS-10990. TestPendingInvalidateBlock should wait for IBRs. Contributed by Yiqun Lin." This reverts commit 7a5aaa789d9160ac55f022aae64a0b437ddccf06. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/3892fd81 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/3892fd81 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/3892fd81 Branch: refs/heads/branch-2.8 Commit: 3892fd810b637128095b51ff90521171bf9a3fd3 Parents: ded9199 Author: Andrew Wang Authored: Thu Oct 13 13:23:01 2016 -0700 Committer: Andrew Wang Committed: Thu Oct 13 13:23:01 2016 -0700 -- .../blockmanagement/TestPendingInvalidateBlock.java| 13 - 1 file changed, 4 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/3892fd81/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java index 19f3178..696b2aa 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java @@ -86,8 +86,6 @@ public class TestPendingInvalidateBlock { public void testPendingDeletion() throws Exception { final Path foo = new Path("/foo"); DFSTestUtil.createFile(dfs, foo, BLOCKSIZE, REPLICATION, 0); -DFSTestUtil.waitForReplication(dfs, foo, REPLICATION, 1); - // restart NN cluster.restartNameNode(true); InvalidateBlocks invalidateBlocks = @@ -100,7 +98,6 @@ public class TestPendingInvalidateBlock { "invalidateBlocks", mockIb); dfs.delete(foo, true); -waitForNumPendingDeletionBlocks(REPLICATION); Assert.assertEquals(0, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(REPLICATION, cluster.getNamesystem() .getPendingDeletionBlocks()); @@ -108,7 +105,7 @@ public class TestPendingInvalidateBlock { dfs.getPendingDeletionBlocksCount()); Mockito.doReturn(0L).when(mockIb).getInvalidationDelay(); -waitForNumPendingDeletionBlocks(0); +waitForBlocksToDelete(); Assert.assertEquals(0, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(0, cluster.getNamesystem().getPendingDeletionBlocks()); Assert.assertEquals(0, dfs.getPendingDeletionBlocksCount()); @@ -185,7 +182,7 @@ public class TestPendingInvalidateBlock { Assert.assertEquals(4, cluster.getNamesystem().getPendingDeletionBlocks()); cluster.restartNameNode(true); -waitForNumPendingDeletionBlocks(0); +waitForBlocksToDelete(); Assert.assertEquals(3, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(0, cluster.getNamesystem().getPendingDeletionBlocks()); } @@ -202,8 +199,7 @@ public class TestPendingInvalidateBlock { return cluster.getNamesystem().getUnderReplicatedBlocks(); } - private void waitForNumPendingDeletionBlocks(int numBlocks) - throws Exception { + private void waitForBlocksToDelete() throws Exception { GenericTestUtils.waitFor(new Supplier() { @Override @@ -211,8 +207,7 @@ public class TestPendingInvalidateBlock { try { cluster.triggerBlockReports(); - if (cluster.getNamesystem().getPendingDeletionBlocks() - == numBlocks) { + if (cluster.getNamesystem().getPendingDeletionBlocks() == 0) { return true; } } catch (Exception e) { - To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org
hadoop git commit: Revert "HDFS-10990. TestPendingInvalidateBlock should wait for IBRs. Contributed by Yiqun Lin."
Repository: hadoop Updated Branches: refs/heads/branch-2 c5a130370 -> dc78e0e7f Revert "HDFS-10990. TestPendingInvalidateBlock should wait for IBRs. Contributed by Yiqun Lin." This reverts commit 2e153bc8abc3fe2f50660136af32711c50e7e7e7. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/dc78e0e7 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/dc78e0e7 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/dc78e0e7 Branch: refs/heads/branch-2 Commit: dc78e0e7fc11d21de47f5ddb81a259988c2113fc Parents: c5a1303 Author: Andrew Wang Authored: Thu Oct 13 13:23:04 2016 -0700 Committer: Andrew Wang Committed: Thu Oct 13 13:23:04 2016 -0700 -- .../blockmanagement/TestPendingInvalidateBlock.java| 13 - 1 file changed, 4 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/dc78e0e7/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java index 19f3178..696b2aa 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java @@ -86,8 +86,6 @@ public class TestPendingInvalidateBlock { public void testPendingDeletion() throws Exception { final Path foo = new Path("/foo"); DFSTestUtil.createFile(dfs, foo, BLOCKSIZE, REPLICATION, 0); -DFSTestUtil.waitForReplication(dfs, foo, REPLICATION, 1); - // restart NN cluster.restartNameNode(true); InvalidateBlocks invalidateBlocks = @@ -100,7 +98,6 @@ public class TestPendingInvalidateBlock { "invalidateBlocks", mockIb); dfs.delete(foo, true); -waitForNumPendingDeletionBlocks(REPLICATION); Assert.assertEquals(0, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(REPLICATION, cluster.getNamesystem() .getPendingDeletionBlocks()); @@ -108,7 +105,7 @@ public class TestPendingInvalidateBlock { dfs.getPendingDeletionBlocksCount()); Mockito.doReturn(0L).when(mockIb).getInvalidationDelay(); -waitForNumPendingDeletionBlocks(0); +waitForBlocksToDelete(); Assert.assertEquals(0, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(0, cluster.getNamesystem().getPendingDeletionBlocks()); Assert.assertEquals(0, dfs.getPendingDeletionBlocksCount()); @@ -185,7 +182,7 @@ public class TestPendingInvalidateBlock { Assert.assertEquals(4, cluster.getNamesystem().getPendingDeletionBlocks()); cluster.restartNameNode(true); -waitForNumPendingDeletionBlocks(0); +waitForBlocksToDelete(); Assert.assertEquals(3, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(0, cluster.getNamesystem().getPendingDeletionBlocks()); } @@ -202,8 +199,7 @@ public class TestPendingInvalidateBlock { return cluster.getNamesystem().getUnderReplicatedBlocks(); } - private void waitForNumPendingDeletionBlocks(int numBlocks) - throws Exception { + private void waitForBlocksToDelete() throws Exception { GenericTestUtils.waitFor(new Supplier() { @Override @@ -211,8 +207,7 @@ public class TestPendingInvalidateBlock { try { cluster.triggerBlockReports(); - if (cluster.getNamesystem().getPendingDeletionBlocks() - == numBlocks) { + if (cluster.getNamesystem().getPendingDeletionBlocks() == 0) { return true; } } catch (Exception e) { - To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org
hadoop git commit: Revert "HDFS-10990. TestPendingInvalidateBlock should wait for IBRs. Contributed by Yiqun Lin."
Repository: hadoop Updated Branches: refs/heads/trunk 332a61fd7 -> 8c721aa00 Revert "HDFS-10990. TestPendingInvalidateBlock should wait for IBRs. Contributed by Yiqun Lin." This reverts commit fdce515091f0a61ffd6c9ae464a68447dedf1124. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/8c721aa0 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/8c721aa0 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/8c721aa0 Branch: refs/heads/trunk Commit: 8c721aa00a47a976959e3861ddd742f09db432fc Parents: 332a61f Author: Andrew Wang Authored: Thu Oct 13 13:23:12 2016 -0700 Committer: Andrew Wang Committed: Thu Oct 13 13:23:28 2016 -0700 -- .../blockmanagement/TestPendingInvalidateBlock.java| 13 - 1 file changed, 4 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/8c721aa0/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java index 19f3178..696b2aa 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java @@ -86,8 +86,6 @@ public class TestPendingInvalidateBlock { public void testPendingDeletion() throws Exception { final Path foo = new Path("/foo"); DFSTestUtil.createFile(dfs, foo, BLOCKSIZE, REPLICATION, 0); -DFSTestUtil.waitForReplication(dfs, foo, REPLICATION, 1); - // restart NN cluster.restartNameNode(true); InvalidateBlocks invalidateBlocks = @@ -100,7 +98,6 @@ public class TestPendingInvalidateBlock { "invalidateBlocks", mockIb); dfs.delete(foo, true); -waitForNumPendingDeletionBlocks(REPLICATION); Assert.assertEquals(0, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(REPLICATION, cluster.getNamesystem() .getPendingDeletionBlocks()); @@ -108,7 +105,7 @@ public class TestPendingInvalidateBlock { dfs.getPendingDeletionBlocksCount()); Mockito.doReturn(0L).when(mockIb).getInvalidationDelay(); -waitForNumPendingDeletionBlocks(0); +waitForBlocksToDelete(); Assert.assertEquals(0, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(0, cluster.getNamesystem().getPendingDeletionBlocks()); Assert.assertEquals(0, dfs.getPendingDeletionBlocksCount()); @@ -185,7 +182,7 @@ public class TestPendingInvalidateBlock { Assert.assertEquals(4, cluster.getNamesystem().getPendingDeletionBlocks()); cluster.restartNameNode(true); -waitForNumPendingDeletionBlocks(0); +waitForBlocksToDelete(); Assert.assertEquals(3, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(0, cluster.getNamesystem().getPendingDeletionBlocks()); } @@ -202,8 +199,7 @@ public class TestPendingInvalidateBlock { return cluster.getNamesystem().getUnderReplicatedBlocks(); } - private void waitForNumPendingDeletionBlocks(int numBlocks) - throws Exception { + private void waitForBlocksToDelete() throws Exception { GenericTestUtils.waitFor(new Supplier() { @Override @@ -211,8 +207,7 @@ public class TestPendingInvalidateBlock { try { cluster.triggerBlockReports(); - if (cluster.getNamesystem().getPendingDeletionBlocks() - == numBlocks) { + if (cluster.getNamesystem().getPendingDeletionBlocks() == 0) { return true; } } catch (Exception e) { - To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org
[22/50] hadoop git commit: Revert "HDFS-10990. TestPendingInvalidateBlock should wait for IBRs. Contributed by Yiqun Lin."
Revert "HDFS-10990. TestPendingInvalidateBlock should wait for IBRs. Contributed by Yiqun Lin." This reverts commit fdce515091f0a61ffd6c9ae464a68447dedf1124. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/8c721aa0 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/8c721aa0 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/8c721aa0 Branch: refs/heads/HDFS-10285 Commit: 8c721aa00a47a976959e3861ddd742f09db432fc Parents: 332a61f Author: Andrew Wang Authored: Thu Oct 13 13:23:12 2016 -0700 Committer: Andrew Wang Committed: Thu Oct 13 13:23:28 2016 -0700 -- .../blockmanagement/TestPendingInvalidateBlock.java| 13 - 1 file changed, 4 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/8c721aa0/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java index 19f3178..696b2aa 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java @@ -86,8 +86,6 @@ public class TestPendingInvalidateBlock { public void testPendingDeletion() throws Exception { final Path foo = new Path("/foo"); DFSTestUtil.createFile(dfs, foo, BLOCKSIZE, REPLICATION, 0); -DFSTestUtil.waitForReplication(dfs, foo, REPLICATION, 1); - // restart NN cluster.restartNameNode(true); InvalidateBlocks invalidateBlocks = @@ -100,7 +98,6 @@ public class TestPendingInvalidateBlock { "invalidateBlocks", mockIb); dfs.delete(foo, true); -waitForNumPendingDeletionBlocks(REPLICATION); Assert.assertEquals(0, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(REPLICATION, cluster.getNamesystem() .getPendingDeletionBlocks()); @@ -108,7 +105,7 @@ public class TestPendingInvalidateBlock { dfs.getPendingDeletionBlocksCount()); Mockito.doReturn(0L).when(mockIb).getInvalidationDelay(); -waitForNumPendingDeletionBlocks(0); +waitForBlocksToDelete(); Assert.assertEquals(0, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(0, cluster.getNamesystem().getPendingDeletionBlocks()); Assert.assertEquals(0, dfs.getPendingDeletionBlocksCount()); @@ -185,7 +182,7 @@ public class TestPendingInvalidateBlock { Assert.assertEquals(4, cluster.getNamesystem().getPendingDeletionBlocks()); cluster.restartNameNode(true); -waitForNumPendingDeletionBlocks(0); +waitForBlocksToDelete(); Assert.assertEquals(3, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(0, cluster.getNamesystem().getPendingDeletionBlocks()); } @@ -202,8 +199,7 @@ public class TestPendingInvalidateBlock { return cluster.getNamesystem().getUnderReplicatedBlocks(); } - private void waitForNumPendingDeletionBlocks(int numBlocks) - throws Exception { + private void waitForBlocksToDelete() throws Exception { GenericTestUtils.waitFor(new Supplier() { @Override @@ -211,8 +207,7 @@ public class TestPendingInvalidateBlock { try { cluster.triggerBlockReports(); - if (cluster.getNamesystem().getPendingDeletionBlocks() - == numBlocks) { + if (cluster.getNamesystem().getPendingDeletionBlocks() == 0) { return true; } } catch (Exception e) { - To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org
[10/50] [abbrv] hadoop git commit: Revert "HDFS-10990. TestPendingInvalidateBlock should wait for IBRs. Contributed by Yiqun Lin."
Revert "HDFS-10990. TestPendingInvalidateBlock should wait for IBRs. Contributed by Yiqun Lin." This reverts commit fdce515091f0a61ffd6c9ae464a68447dedf1124. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/8c721aa0 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/8c721aa0 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/8c721aa0 Branch: refs/heads/HADOOP-13070 Commit: 8c721aa00a47a976959e3861ddd742f09db432fc Parents: 332a61f Author: Andrew Wang Authored: Thu Oct 13 13:23:12 2016 -0700 Committer: Andrew Wang Committed: Thu Oct 13 13:23:28 2016 -0700 -- .../blockmanagement/TestPendingInvalidateBlock.java| 13 - 1 file changed, 4 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/8c721aa0/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java index 19f3178..696b2aa 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java @@ -86,8 +86,6 @@ public class TestPendingInvalidateBlock { public void testPendingDeletion() throws Exception { final Path foo = new Path("/foo"); DFSTestUtil.createFile(dfs, foo, BLOCKSIZE, REPLICATION, 0); -DFSTestUtil.waitForReplication(dfs, foo, REPLICATION, 1); - // restart NN cluster.restartNameNode(true); InvalidateBlocks invalidateBlocks = @@ -100,7 +98,6 @@ public class TestPendingInvalidateBlock { "invalidateBlocks", mockIb); dfs.delete(foo, true); -waitForNumPendingDeletionBlocks(REPLICATION); Assert.assertEquals(0, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(REPLICATION, cluster.getNamesystem() .getPendingDeletionBlocks()); @@ -108,7 +105,7 @@ public class TestPendingInvalidateBlock { dfs.getPendingDeletionBlocksCount()); Mockito.doReturn(0L).when(mockIb).getInvalidationDelay(); -waitForNumPendingDeletionBlocks(0); +waitForBlocksToDelete(); Assert.assertEquals(0, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(0, cluster.getNamesystem().getPendingDeletionBlocks()); Assert.assertEquals(0, dfs.getPendingDeletionBlocksCount()); @@ -185,7 +182,7 @@ public class TestPendingInvalidateBlock { Assert.assertEquals(4, cluster.getNamesystem().getPendingDeletionBlocks()); cluster.restartNameNode(true); -waitForNumPendingDeletionBlocks(0); +waitForBlocksToDelete(); Assert.assertEquals(3, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(0, cluster.getNamesystem().getPendingDeletionBlocks()); } @@ -202,8 +199,7 @@ public class TestPendingInvalidateBlock { return cluster.getNamesystem().getUnderReplicatedBlocks(); } - private void waitForNumPendingDeletionBlocks(int numBlocks) - throws Exception { + private void waitForBlocksToDelete() throws Exception { GenericTestUtils.waitFor(new Supplier() { @Override @@ -211,8 +207,7 @@ public class TestPendingInvalidateBlock { try { cluster.triggerBlockReports(); - if (cluster.getNamesystem().getPendingDeletionBlocks() - == numBlocks) { + if (cluster.getNamesystem().getPendingDeletionBlocks() == 0) { return true; } } catch (Exception e) { - To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org
[48/51] [abbrv] hadoop git commit: Revert "HDFS-10990. TestPendingInvalidateBlock should wait for IBRs. Contributed by Yiqun Lin."
Revert "HDFS-10990. TestPendingInvalidateBlock should wait for IBRs. Contributed by Yiqun Lin." This reverts commit fdce515091f0a61ffd6c9ae464a68447dedf1124. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/8c721aa0 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/8c721aa0 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/8c721aa0 Branch: refs/heads/HDFS-7240 Commit: 8c721aa00a47a976959e3861ddd742f09db432fc Parents: 332a61f Author: Andrew Wang Authored: Thu Oct 13 13:23:12 2016 -0700 Committer: Andrew Wang Committed: Thu Oct 13 13:23:28 2016 -0700 -- .../blockmanagement/TestPendingInvalidateBlock.java| 13 - 1 file changed, 4 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/hadoop/blob/8c721aa0/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java -- diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java index 19f3178..696b2aa 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/blockmanagement/TestPendingInvalidateBlock.java @@ -86,8 +86,6 @@ public class TestPendingInvalidateBlock { public void testPendingDeletion() throws Exception { final Path foo = new Path("/foo"); DFSTestUtil.createFile(dfs, foo, BLOCKSIZE, REPLICATION, 0); -DFSTestUtil.waitForReplication(dfs, foo, REPLICATION, 1); - // restart NN cluster.restartNameNode(true); InvalidateBlocks invalidateBlocks = @@ -100,7 +98,6 @@ public class TestPendingInvalidateBlock { "invalidateBlocks", mockIb); dfs.delete(foo, true); -waitForNumPendingDeletionBlocks(REPLICATION); Assert.assertEquals(0, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(REPLICATION, cluster.getNamesystem() .getPendingDeletionBlocks()); @@ -108,7 +105,7 @@ public class TestPendingInvalidateBlock { dfs.getPendingDeletionBlocksCount()); Mockito.doReturn(0L).when(mockIb).getInvalidationDelay(); -waitForNumPendingDeletionBlocks(0); +waitForBlocksToDelete(); Assert.assertEquals(0, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(0, cluster.getNamesystem().getPendingDeletionBlocks()); Assert.assertEquals(0, dfs.getPendingDeletionBlocksCount()); @@ -185,7 +182,7 @@ public class TestPendingInvalidateBlock { Assert.assertEquals(4, cluster.getNamesystem().getPendingDeletionBlocks()); cluster.restartNameNode(true); -waitForNumPendingDeletionBlocks(0); +waitForBlocksToDelete(); Assert.assertEquals(3, cluster.getNamesystem().getBlocksTotal()); Assert.assertEquals(0, cluster.getNamesystem().getPendingDeletionBlocks()); } @@ -202,8 +199,7 @@ public class TestPendingInvalidateBlock { return cluster.getNamesystem().getUnderReplicatedBlocks(); } - private void waitForNumPendingDeletionBlocks(int numBlocks) - throws Exception { + private void waitForBlocksToDelete() throws Exception { GenericTestUtils.waitFor(new Supplier() { @Override @@ -211,8 +207,7 @@ public class TestPendingInvalidateBlock { try { cluster.triggerBlockReports(); - if (cluster.getNamesystem().getPendingDeletionBlocks() - == numBlocks) { + if (cluster.getNamesystem().getPendingDeletionBlocks() == 0) { return true; } } catch (Exception e) { - To unsubscribe, e-mail: common-commits-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-commits-h...@hadoop.apache.org