hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject hadoop git commit: HADOOP-13163 Reuse pre-computed filestatus in Distcp-CopyMapper (Rajesh Balamohan via stevel)
Date Tue, 17 May 2016 12:04:12 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 19db965c2 -> dfc062a09


HADOOP-13163 Reuse pre-computed filestatus in Distcp-CopyMapper (Rajesh Balamohan via stevel)


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

Branch: refs/heads/branch-2
Commit: dfc062a0927a5f5c6db9957cd738a978d97b9705
Parents: 19db965
Author: Steve Loughran <stevel@apache.org>
Authored: Tue May 17 12:59:59 2016 +0100
Committer: Steve Loughran <stevel@apache.org>
Committed: Tue May 17 13:01:50 2016 +0100

----------------------------------------------------------------------
 .../java/org/apache/hadoop/tools/mapred/CopyMapper.java   | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/dfc062a0/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/mapred/CopyMapper.java
----------------------------------------------------------------------
diff --git a/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/mapred/CopyMapper.java
b/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/mapred/CopyMapper.java
index 6f88660..a979a29 100644
--- a/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/mapred/CopyMapper.java
+++ b/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/mapred/CopyMapper.java
@@ -245,7 +245,7 @@ public class CopyMapper extends Mapper<Text, CopyListingFileStatus,
Text, Text>
         return;
       }
 
-      FileAction action = checkUpdate(sourceFS, sourceCurrStatus, target);
+      FileAction action = checkUpdate(sourceFS, sourceCurrStatus, target, targetStatus);
       if (action == FileAction.SKIP) {
         LOG.info("Skipping copy of " + sourceCurrStatus.getPath()
                  + " to " + target);
@@ -332,13 +332,7 @@ public class CopyMapper extends Mapper<Text, CopyListingFileStatus,
Text, Text>
   }
 
   private FileAction checkUpdate(FileSystem sourceFS, FileStatus source,
-      Path target) throws IOException {
-    final FileStatus targetFileStatus;
-    try {
-      targetFileStatus = targetFS.getFileStatus(target);
-    } catch (FileNotFoundException e) {
-      return FileAction.OVERWRITE;
-    }
+      Path target, FileStatus targetFileStatus) throws IOException {
     if (targetFileStatus != null && !overWrite) {
       if (canSkip(sourceFS, source, targetFileStatus)) {
         return FileAction.SKIP;


---------------------------------------------------------------------
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