You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by br...@apache.org on 2017/06/07 16:39:26 UTC

hadoop git commit: MAPREDUCE-6676. NNBench should Throw IOException when rename and delete fails. Contributed by Brahma Reddy Battula.

Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8 8a16846f5 -> c60516aee


MAPREDUCE-6676. NNBench should Throw IOException when rename and delete fails. Contributed by Brahma Reddy Battula.

(cherry picked from commit 24181f559f008fc7945702c0fad7d1028f75bfc6)


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

Branch: refs/heads/branch-2.8
Commit: c60516aee56380759c59b54a605e96d709af06d1
Parents: 8a16846
Author: Brahma Reddy Battula <br...@apache.org>
Authored: Wed Jun 7 16:34:47 2017 +0800
Committer: Brahma Reddy Battula <br...@apache.org>
Committed: Wed Jun 7 16:38:05 2017 +0800

----------------------------------------------------------------------
 .../src/test/java/org/apache/hadoop/hdfs/NNBench.java     | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/c60516ae/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/hdfs/NNBench.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/hdfs/NNBench.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/hdfs/NNBench.java
index ee3cc00..29eac43 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/hdfs/NNBench.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/hdfs/NNBench.java
@@ -868,7 +868,10 @@ public class NNBench extends Configured implements Tool {
           try {
             // Set up timer for measuring AL
             startTimeAL = System.currentTimeMillis();
-            filesystem.rename(filePath, filePathR);
+            boolean result = filesystem.rename(filePath, filePathR);
+            if (!result) {
+              throw new IOException("rename failed for " + filePath);
+            }
             totalTimeAL1 += (System.currentTimeMillis() - startTimeAL);
             
             successfulOp = true;
@@ -901,7 +904,10 @@ public class NNBench extends Configured implements Tool {
           try {
             // Set up timer for measuring AL
             startTimeAL = System.currentTimeMillis();
-            filesystem.delete(filePath, true);
+            boolean result = filesystem.delete(filePath, true);
+            if (!result) {
+              throw new IOException("delete failed for " + filePath);
+            }
             totalTimeAL1 += (System.currentTimeMillis() - startTimeAL);
             
             successfulOp = true;


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org