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)
187
187
if (command .hasOption (DistCpOptionSwitch .PRESERVE_STATUS .getSwitch ())) {
188
188
builder .preserve (
189
189
getVal (command , DistCpOptionSwitch .PRESERVE_STATUS .getSwitch ()));
190
+ } else {
191
+ // No "preserve" settings specified. Preserve block-size.
192
+ builder .preserve (DistCpOptions .FileAttribute .BLOCKSIZE );
190
193
}
191
194
192
195
if (command .hasOption (DistCpOptionSwitch .FILE_LIMIT .getSwitch ())) {
Original file line number Diff line number Diff line change @@ -413,7 +413,7 @@ public void testPreserve() {
413
413
"-f" ,
414
414
"hdfs://localhost:9820/source/first" ,
415
415
"hdfs://localhost:9820/target/" });
416
- Assert .assertFalse (options .shouldPreserve (FileAttribute .BLOCKSIZE ));
416
+ Assert .assertTrue (options .shouldPreserve (FileAttribute .BLOCKSIZE ));
417
417
Assert .assertFalse (options .shouldPreserve (FileAttribute .REPLICATION ));
418
418
Assert .assertFalse (options .shouldPreserve (FileAttribute .PERMISSION ));
419
419
Assert .assertFalse (options .shouldPreserve (FileAttribute .USER ));
You can’t perform that action at this time.
0 commit comments