[ 
https://issues.apache.org/jira/browse/HADOOP-17139?focusedWorklogId=626030&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-626030
 ]

ASF GitHub Bot logged work on HADOOP-17139:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 21/Jul/21 10:00
            Start Date: 21/Jul/21 10:00
    Worklog Time Spent: 10m 
      Work Description: bogthe commented on a change in pull request #3101:
URL: https://github.com/apache/hadoop/pull/3101#discussion_r673835551



##########
File path: 
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/CopyFromLocalOperation.java
##########
@@ -144,10 +144,13 @@ public Void execute()
             throws IOException, PathExistsException {
         LOG.debug("Copying local file from {} to {}", source, destination);
         File sourceFile = callbacks.pathToFile(source);
-        try {
-            dstStatus = callbacks.getFileStatus(destination);
-        } catch (FileNotFoundException e) {
-            dstStatus = null;
+        updateDestStatus(destination);
+
+        // Handles bar/ -> foo/ => foo/bar and bar/ -> foo/bar/ => foo/bar/bar
+        if (getDestStatus().isPresent() && getDestStatus().get().isDirectory()

Review comment:
       Hopefully not because of the 
[`Optional.ofNullable`](https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html#ofNullable-T-).




-- 
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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 626030)
    Time Spent: 7h 40m  (was: 7.5h)

> Re-enable optimized copyFromLocal implementation in S3AFileSystem
> -----------------------------------------------------------------
>
>                 Key: HADOOP-17139
>                 URL: https://issues.apache.org/jira/browse/HADOOP-17139
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: fs/s3
>    Affects Versions: 3.3.0, 3.2.1
>            Reporter: Sahil Takiar
>            Assignee: Bogdan Stolojan
>            Priority: Minor
>              Labels: pull-request-available
>          Time Spent: 7h 40m
>  Remaining Estimate: 0h
>
> It looks like HADOOP-15932 disabled the optimized copyFromLocal 
> implementation in S3A for correctness reasons.  innerCopyFromLocalFile should 
> be fixed and re-enabled. The current implementation uses 
> FileSystem.copyFromLocal which will open an input stream from the local fs 
> and an output stream to the destination fs, and then call IOUtils.copyBytes. 
> With default configs, this will cause S3A to read the file into memory, write 
> it back to a file on the local fs, and then when the file is closed, upload 
> it to S3.
> The optimized version of copyFromLocal in innerCopyFromLocalFile, directly 
> creates a PutObjectRequest request with the local file as the input.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to