bogthe commented on a change in pull request #3101:
URL: https://github.com/apache/hadoop/pull/3101#discussion_r673818683
##########
File path:
hadoop-tools/hadoop-aws/src/main/java/org/apache/hadoop/fs/s3a/impl/CopyFromLocalOperation.java
##########
@@ -161,6 +164,21 @@ public Void execute()
return null;
}
+ /**
+ * Does a {@link CopyFromLocalOperationCallbacks#getFileStatus(Path)}
+ * operation on the provided destination and updates the internal status of
+ * destPath property
+ *
+ * @throws IOException if getFileStatus fails
+ */
+ private void updateDestStatus(Path dest) throws IOException {
+ try {
+ destStatus = callbacks.getFileStatus(dest);
+ } catch (FileNotFoundException e) {
+ destStatus = null;
Review comment:
I actually went with `Optional.none` first but having a field be
`Optional<T>` looked like a discouraged choice inside the Java world (Some IDE
highlighting + searching pointed to only using Optional as return types of
methods and taking it from there). So, this is why destStatus isn't used and
`getDestStatus` is. I'm not totally happy with this pattern but what I do like
is that `Optional.ofNullable(v)` will return `None` if `v` is `null`.
Let me know if you think removing the `Optional` is preferred and would be
happy to change.
--
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]