[
https://issues.apache.org/jira/browse/HADOOP-18582?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17688093#comment-17688093
]
ASF GitHub Bot commented on HADOOP-18582:
-----------------------------------------
ayushtkn commented on code in PR #5251:
URL: https://github.com/apache/hadoop/pull/5251#discussion_r1104904672
##########
hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/mapred/CopyCommitter.java:
##########
@@ -152,9 +152,18 @@ public void abortJob(JobContext jobContext,
}
private void cleanupTempFiles(JobContext context) {
- try {
- Configuration conf = context.getConfiguration();
+ Configuration conf = context.getConfiguration();
+
+ final boolean directWrite = conf.getBoolean(
+ DistCpOptionSwitch.DIRECT_WRITE.getConfigLabel(), false);
+ final boolean append = conf.getBoolean(
+ DistCpOptionSwitch.APPEND.getConfigLabel(), false);
+ final boolean useTempTarget = !append && !directWrite;
+ if (!useTempTarget) {
Review Comment:
Isn't that same check as here in RetriableFileCopyCommand
```
final boolean toAppend = action == FileAction.APPEND;
final boolean useTempTarget = !toAppend && !directWrite;
Path targetPath = useTempTarget ? getTempFile(target, context) : target;
```
https://github.com/apache/hadoop/blob/trunk/hadoop-tools/hadoop-distcp/src/main/java/org/apache/hadoop/tools/mapred/RetriableFileCopyCommand.java#L135-L137
> No need to clean tmp files in distcp direct mode
> ------------------------------------------------
>
> Key: HADOOP-18582
> URL: https://issues.apache.org/jira/browse/HADOOP-18582
> Project: Hadoop Common
> Issue Type: Bug
> Components: tools/distcp
> Affects Versions: 3.3.4
> Reporter: 10000kang
> Assignee: 10000kang
> Priority: Major
> Labels: pull-request-available
> Fix For: 3.4.0, 3.3.9
>
>
> it not necessary to do `cleanupTempFiles` while ditcp commit job in direct
> mode, because it there is no temp files in direct mode.
> This clean operation will increase the task execution time, because it will
> get the list of files in the target path. When the number of files in the
> target path is very large, this operation will be very slow.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]