Repository: hadoop
Updated Branches:
  refs/heads/trunk 15eb84b37 -> 5679e46b7


HDFS-9297. Update TestBlockMissingException to use 
corruptBlockOnDataNodesByDeletingBlockFile(). (Tony Wu via lei)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/5679e46b
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/5679e46b
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/5679e46b

Branch: refs/heads/trunk
Commit: 5679e46b7f867f8f7f8195c86c37e3db7b23d7d7
Parents: 15eb84b
Author: Lei Xu <l...@apache.org>
Authored: Fri Oct 23 17:42:23 2015 -0700
Committer: Lei Xu <l...@apache.org>
Committed: Fri Oct 23 17:42:23 2015 -0700

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt          |  3 +++
 .../hadoop/hdfs/TestBlockMissingException.java       | 15 ++-------------
 2 files changed, 5 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/5679e46b/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 1641884..f5f13cf 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -1602,6 +1602,9 @@ Release 2.8.0 - UNRELEASED
 
     HDFS-9280. Document NFS gateway export point parameter. (Xiao Chen via zhz)
 
+    HDFS-9297. Update TestBlockMissingException to use 
corruptBlockOnDataNodesByDeletingBlockFile().
+    (Tony Wu via lei)
+
   BUG FIXES
 
     HDFS-7501. TransactionsSinceLastCheckpoint can be negative on SBNs.

http://git-wip-us.apache.org/repos/asf/hadoop/blob/5679e46b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestBlockMissingException.java
----------------------------------------------------------------------
diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestBlockMissingException.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestBlockMissingException.java
index a3104a0..7287b5c 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestBlockMissingException.java
+++ 
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestBlockMissingException.java
@@ -67,7 +67,8 @@ public class TestBlockMissingException {
           0, numBlocks * blockSize);
       // remove block of file
       LOG.info("Remove first block of file");
-      corruptBlock(file1, locations.get(0).getBlock());
+      dfs.corruptBlockOnDataNodesByDeletingBlockFile(
+          locations.get(0).getBlock());
 
       // validate that the system throws BlockMissingException
       validateFile(fileSys, file1);
@@ -118,16 +119,4 @@ public class TestBlockMissingException {
     stm.close();
     assertTrue("Expected BlockMissingException ", gotException);
   }
-
-  //
-  // Corrupt specified block of file
-  //
-  void corruptBlock(Path file, ExtendedBlock blk) {
-    // Now deliberately remove/truncate data blocks from the file.
-    File[] blockFiles = dfs.getAllBlockFiles(blk);
-    for (File f : blockFiles) {
-      f.delete();
-      LOG.info("Deleted block " + f);
-    }
-  }
 }

Reply via email to