steveloughran commented on a change in pull request #974: HDFS-9913.DispCp
doesn't use Trash with -delete option
URL: https://github.com/apache/hadoop/pull/974#discussion_r302510159
##########
File path:
hadoop-tools/hadoop-distcp/src/test/java/org/apache/hadoop/tools/contract/AbstractContractDistCpTest.java
##########
@@ -322,6 +335,75 @@ private Job distCpUpdate(final Path srcDir, final Path
destDir)
.withOverwrite(false)));
}
+ /**
+ * Do a distcp -update -delete -useTrash.
+ * @param destDir output directory used by the initial distcp
+ * @return the distcp job
+ */
+
+ protected Job distCpUpdateUseTrashDeepDirectoryStructure(final Path destDir)
+ throws Exception {
+ describe("Incremental update with deletion-use-trash of missing files");
+ Path srcDir = inputDir;
+ LOG.info("Source directory = {}, dest={}", srcDir, destDir);
+
+ ContractTestUtils.assertPathsExist(localFS,
+ "Paths for test are wrong",
+ inputFile1, inputFile2, inputFile3, inputFile4, inputFile5);
+
+ modifySourceDirectories();
+ ContractTestUtils.assertPathsDoNotExist(localFS, "deleted right now",
+ inputFile1, inputFile3, inputSubDir4);
+
+ Path trashRootDir = remoteFS.getTrashRoot(null);
+ if (remoteFS.exists(trashRootDir)) {
+ remoteFS.delete(trashRootDir, true);
Review comment:
Use `ContractTestUtils.assertDeleted()`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]