Steve Loughran created HADOOP-15281:

             Summary: Distcp to add no-rename copy option
                 Key: HADOOP-15281
             Project: Hadoop Common
          Issue Type: Improvement
          Components: tools/distcp
    Affects Versions: 3.0.0
            Reporter: Steve Loughran
            Assignee: Steve Loughran

Currently Distcp uploads a file by two strategies

# append parts
# copy to temp then rename

option 2 executes the following swquence in {{promoteTmpToTarget}}
    if ((fs.exists(target) && !fs.delete(target, false))
        || (!fs.exists(target.getParent()) && !fs.mkdirs(target.getParent()))
        || !fs.rename(tmpTarget, target)) {
      throw new IOException("Failed to promote tmp-file:" + tmpTarget
                              + " to: " + target);

For any object store, that's a lot of HTTP requests; for S3A you are looking at 
12+ requests and an O(data) copy call. 

This is not a good upload strategy for any store which manifests its output 
atomically at the end of the write().

Proposed: add a switch to write direct to the dest path. either a conf option 
or a CLI option

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to