Skip to content

Commit 6e0e4d9

Browse files
committed
HADOOP-17628 change directWriteAlways() method to shouldUseDirectWrite()
Change-Id: Ie64af6e109935243cd4c65454cf8ee66ec6fbf58
1 parent de1cfdb commit 6e0e4d9

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/contract/s3a/ITestS3AContractDistCp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected Configuration createConfiguration() {
5555
}
5656

5757
@Override
58-
protected boolean directWriteAlways() {
58+
protected boolean shouldUseDirectWrite() {
5959
return true;
6060
}
6161

hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/contract/AbstractContractDistCpTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ private Job distCpUpdate(final Path srcDir, final Path destDir)
350350
.withDeleteMissing(true)
351351
.withSyncFolder(true)
352352
.withCRC(true)
353-
.withDirectWrite(directWriteAlways())
353+
.withDirectWrite(shouldUseDirectWrite())
354354
.withOverwrite(false)));
355355
}
356356

@@ -404,7 +404,7 @@ public void testTrackDeepDirectoryStructureToRemote() throws Exception {
404404
inputDirUnderOutputDir)
405405
.withTrackMissing(trackDir)
406406
.withSyncFolder(true)
407-
.withDirectWrite(directWriteAlways())
407+
.withDirectWrite(shouldUseDirectWrite())
408408
.withOverwrite(false)));
409409

410410
lsR("tracked udpate", remoteFS, destDir);
@@ -598,13 +598,13 @@ protected int getDefaultDistCPSizeKb() {
598598
/**
599599
* Executes DistCp and asserts that the job finished successfully.
600600
* The choice of direct/indirect is based on the value of
601-
* {@link #directWriteAlways()}.
601+
* {@link #shouldUseDirectWrite()}.
602602
* @param src source path
603603
* @param dst destination path
604604
* @throws Exception if there is a failure
605605
*/
606606
private void runDistCp(Path src, Path dst) throws Exception {
607-
if (directWriteAlways()) {
607+
if (shouldUseDirectWrite()) {
608608
runDistCpDirectWrite(src, dst);
609609
} else {
610610
runDistCpWithRename(src, dst);
@@ -651,7 +651,7 @@ private static void mkdirs(FileSystem fs, Path dir) throws Exception {
651651
@Test
652652
public void testDirectWrite() throws Exception {
653653
describe("copy file from local to remote using direct write option");
654-
if (directWriteAlways()) {
654+
if (shouldUseDirectWrite()) {
655655
skip("not needed as all other tests use the -direct option.");
656656
}
657657
directWrite(localFS, localDir, remoteFS, remoteDir, true);
@@ -710,32 +710,32 @@ private int getTotalFiles() {
710710
* false by default; enable for stores where rename is slow.
711711
* @return true if direct write should be used in all tests.
712712
*/
713-
protected boolean directWriteAlways() {
713+
protected boolean shouldUseDirectWrite() {
714714
return false;
715715
}
716716

717717
/**
718718
* Return the default options for distcp, including,
719-
* if {@link #directWriteAlways()} is true,
719+
* if {@link #shouldUseDirectWrite()} is true,
720720
* the -direct option.
721721
* Append or prepend this to string CLIs.
722722
* @return default options.
723723
*/
724724
protected String getDefaultCLIOptions() {
725-
return directWriteAlways()
725+
return shouldUseDirectWrite()
726726
? " -direct "
727727
: "";
728728
}
729729

730730
/**
731731
* Return the default options for distcp, including,
732-
* if {@link #directWriteAlways()} is true,
732+
* if {@link #shouldUseDirectWrite()} is true,
733733
* the -direct option, null if there are no
734734
* defaults.
735735
* @return default options.
736736
*/
737737
protected String getDefaultCLIOptionsOrNull() {
738-
return directWriteAlways()
738+
return shouldUseDirectWrite()
739739
? " -direct "
740740
: null;
741741
}

0 commit comments

Comments
 (0)