File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
hadoop-tools/hadoop-distcp/src
main/java/org/apache/hadoop/tools
test/java/org/apache/hadoop/tools Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,9 @@ public static DistCpOptions parse(String[] args)
187187 if (command .hasOption (DistCpOptionSwitch .PRESERVE_STATUS .getSwitch ())) {
188188 builder .preserve (
189189 getVal (command , DistCpOptionSwitch .PRESERVE_STATUS .getSwitch ()));
190+ } else {
191+ // No "preserve" settings specified. Preserve block-size.
192+ builder .preserve (DistCpOptions .FileAttribute .BLOCKSIZE );
190193 }
191194
192195 if (command .hasOption (DistCpOptionSwitch .FILE_LIMIT .getSwitch ())) {
Original file line number Diff line number Diff line change @@ -413,7 +413,7 @@ public void testPreserve() {
413413 "-f" ,
414414 "hdfs://localhost:9820/source/first" ,
415415 "hdfs://localhost:9820/target/" });
416- Assert .assertFalse (options .shouldPreserve (FileAttribute .BLOCKSIZE ));
416+ Assert .assertTrue (options .shouldPreserve (FileAttribute .BLOCKSIZE ));
417417 Assert .assertFalse (options .shouldPreserve (FileAttribute .REPLICATION ));
418418 Assert .assertFalse (options .shouldPreserve (FileAttribute .PERMISSION ));
419419 Assert .assertFalse (options .shouldPreserve (FileAttribute .USER ));
You can’t perform that action at this time.
0 commit comments