hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From inigo...@apache.org
Subject [33/50] [abbrv] hadoop git commit: HADOOP-8143. Change distcp to have -pb on by default. Contributed by Mithun Radhakrishnan
Date Wed, 21 Jun 2017 23:24:20 GMT
HADOOP-8143. Change distcp to have -pb on by default. Contributed by Mithun Radhakrishnan


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

Branch: refs/heads/HDFS-10467
Commit: dd65eea74b1f9dde858ff34df8111e5340115511
Parents: 8c0769d
Author: Jason Lowe <jlowe@yahoo-inc.com>
Authored: Tue Jun 20 09:53:47 2017 -0500
Committer: Jason Lowe <jlowe@yahoo-inc.com>
Committed: Tue Jun 20 09:53:47 2017 -0500

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/tools/OptionsParser.java      | 3 +++
 .../src/test/java/org/apache/hadoop/tools/TestOptionsParser.java  | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/dd65eea7/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/OptionsParser.java
----------------------------------------------------------------------
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 96fb1d9..2bfaccf 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
@@ -187,6 +187,9 @@ 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())) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/dd65eea7/hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/TestOptionsParser.java
----------------------------------------------------------------------
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 e7fdc51..6928cdf 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:9820/source/first",
         "hdfs://localhost:9820/target/"});
-    Assert.assertFalse(options.shouldPreserve(FileAttribute.BLOCKSIZE));
+    Assert.assertTrue(options.shouldPreserve(FileAttribute.BLOCKSIZE));
     Assert.assertFalse(options.shouldPreserve(FileAttribute.REPLICATION));
     Assert.assertFalse(options.shouldPreserve(FileAttribute.PERMISSION));
     Assert.assertFalse(options.shouldPreserve(FileAttribute.USER));


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