hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From viraj...@apache.org
Subject [19/50] [abbrv] hadoop git commit: HADOOP-14942. DistCp#cleanup() should check whether jobFS is null. Contributed by Andras Bokor.
Date Tue, 24 Oct 2017 18:31:53 GMT
HADOOP-14942. DistCp#cleanup() should check whether jobFS is null.
Contributed by Andras Bokor.


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

Branch: refs/heads/HDFS-9806
Commit: f36cbc847560d53e7955ced9ce7ce2773c805793
Parents: 480187a
Author: Steve Loughran <stevel@apache.org>
Authored: Fri Oct 20 22:27:04 2017 +0100
Committer: Steve Loughran <stevel@apache.org>
Committed: Fri Oct 20 22:27:04 2017 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/tools/DistCp.java     | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/f36cbc84/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java
b/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java
index df9c328..909494b 100644
--- a/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java
+++ b/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/DistCp.java
@@ -453,10 +453,12 @@ public class DistCp extends Configured implements Tool {
 
   private synchronized void cleanup() {
     try {
-      if (metaFolder == null) return;
-
-      jobFS.delete(metaFolder, true);
-      metaFolder = null;
+      if (metaFolder != null) {
+        if (jobFS != null) {
+          jobFS.delete(metaFolder, true);
+        }
+        metaFolder = null;
+      }
     } catch (IOException e) {
       LOG.error("Unable to cleanup meta folder: " + metaFolder, e);
     }


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


Mime
View raw message