From 7e2c971fedd1195a51203ff12fdfdeb4642f2082 Mon Sep 17 00:00:00 2001 From: Haohui Mai Date: Sat, 10 Oct 2015 03:24:59 -0700 Subject: [PATCH] Revert "HADOOP-12469. distcp shout not ignore the ignoreFailures option. Contributed by Mingliang Liu." This reverts commit fa5a54cac7e0f70ef28ebfe94aee95ffbbaf20e8. --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 --- .../java/org/apache/hadoop/tools/mapred/CopyMapper.java | 2 +- .../org/apache/hadoop/tools/mapred/TestCopyMapper.java | 8 +++----- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 13f8d5d3b1..9d954d046c 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -1277,9 +1277,6 @@ Release 2.8.0 - UNRELEASED HADOOP-12441. Fixed shell-kill command behaviour to work correctly on some Linux distributions after HADOOP-12317. (Wangda Tan via vinodkv) - HADOOP-12469. distcp shout not ignore the ignoreFailures option. - (Mingliang Liu via wheat9) - Release 2.7.2 - UNRELEASED INCOMPATIBLE CHANGES 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 c0b3d77612..f75fe76178 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 @@ -288,7 +288,7 @@ private void copyFileWithRetry(String description, } catch (Exception e) { context.setStatus("Copy Failure: " + sourceFileStatus.getPath()); throw new IOException("File copy failed: " + sourceFileStatus.getPath() + - " --> " + target, e.getCause()); + " --> " + target, e); } incrementCounter(context, Counter.BYTESEXPECTED, sourceFileStatus.getLen()); incrementCounter(context, Counter.BYTESCOPIED, bytesCopied); diff --git a/hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/mapred/TestCopyMapper.java b/hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/mapred/TestCopyMapper.java index 080b1f40be..ec60fa800f 100644 --- a/hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/mapred/TestCopyMapper.java +++ b/hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/mapred/TestCopyMapper.java @@ -713,7 +713,7 @@ public Integer run() { // wrapped twice - once in RetriableCommand and again in CopyMapper // itself. if (e.getCause() == null || e.getCause().getCause() == null || - !(e.getCause() instanceof AccessControlException)) { + !(e.getCause().getCause() instanceof AccessControlException)) { throw new RuntimeException(e); } } @@ -841,10 +841,8 @@ public void testCopyFailOnBlockSizeDifference() { } catch (Exception exception) { // Check that the exception suggests the use of -pb/-skipCrc. - Assert.assertTrue("Exception should have suggested the use of -pb.", - exception.getCause().getMessage().contains("pb")); - Assert.assertTrue("Exception should have suggested the use of -skipCrc.", - exception.getCause().getMessage().contains("skipCrc")); + Assert.assertTrue("Failure exception should have suggested the use of -pb.", exception.getCause().getCause().getMessage().contains("pb")); + Assert.assertTrue("Failure exception should have suggested the use of -skipCrc.", exception.getCause().getCause().getMessage().contains("skipCrc")); } }