LuciferYang commented on code in PR #8928:
URL: https://github.com/apache/hadoop/pull/8928#discussion_r4572866585
##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileUtil.java:
##########
@@ -472,11 +474,17 @@ public static boolean copy(FileSystem srcFS, FileStatus
srcStatus,
return false;
}
RemoteIterator<FileStatus> contents = srcFS.listStatusIterator(src);
+ boolean copiedAll = true;
while (contents.hasNext()) {
FileStatus next = contents.next();
- copy(srcFS, next, dstFS,
+ if (!copy(srcFS, next, dstFS,
new Path(dst, next.getPath().getName()),
- deleteSource, overwrite, conf);
+ deleteSource, overwrite, conf)) {
+ copiedAll = false;
+ }
+ }
+ if (!copiedAll) {
Review Comment:
Done. `copyToLocalFile()` now throws an `IOException` when `FileUtil.copy()`
returns false, in `FileSystem` and in the `ChecksumFileSystem`,
`LocalFileSystem` and `HarFileSystem` overrides. Two tests in
`TestLocalFileSystem` call `moveToLocalFile()` through the base method and
through the `LocalFileSystem` override, with one child's mkdirs failing.
`copyFromLocalFile()` has the same gap; I'd leave it for a follow-up.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]