From 31755c91ff4b51598dc7dee32c7f1ecb9241ef5b Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Thu, 14 May 2020 16:06:24 +0100 Subject: [PATCH] Revert "HADOOP-8143. Change distcp to have -pb on by default." This reverts commit dd65eea74b1f9dde858ff34df8111e5340115511. Change-Id: I74180cf59d5bbad8c9f66cb331535addcbea863e --- .../src/main/java/org/apache/hadoop/tools/OptionsParser.java | 3 --- .../test/java/org/apache/hadoop/tools/TestOptionsParser.java | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/OptionsParser.java b/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/OptionsParser.java index ef0017b9a7b..fe14165f4d1 100644 --- a/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/OptionsParser.java +++ b/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/OptionsParser.java @@ -197,9 +197,6 @@ public class OptionsParser { if (command.hasOption(DistCpOptionSwitch.PRESERVE_STATUS.getSwitch())) { builder.preserve( getVal(command, DistCpOptionSwitch.PRESERVE_STATUS.getSwitch())); - } else { - // No "preserve" settings specified. Preserve block-size. - builder.preserve(DistCpOptions.FileAttribute.BLOCKSIZE); } if (command.hasOption(DistCpOptionSwitch.FILE_LIMIT.getSwitch())) { diff --git a/hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/TestOptionsParser.java b/hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/TestOptionsParser.java index 9361fc18f3c..0a19e0c72f4 100644 --- a/hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/TestOptionsParser.java +++ b/hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/TestOptionsParser.java @@ -413,7 +413,7 @@ public class TestOptionsParser { "-f", "hdfs://localhost:8020/source/first", "hdfs://localhost:8020/target/"}); - Assert.assertTrue(options.shouldPreserve(FileAttribute.BLOCKSIZE)); + Assert.assertFalse(options.shouldPreserve(FileAttribute.BLOCKSIZE)); Assert.assertFalse(options.shouldPreserve(FileAttribute.REPLICATION)); Assert.assertFalse(options.shouldPreserve(FileAttribute.PERMISSION)); Assert.assertFalse(options.shouldPreserve(FileAttribute.USER));