chamikaramj commented on a change in pull request #15301:
URL: https://github.com/apache/beam/pull/15301#discussion_r686380688



##########
File path: 
sdks/java/core/src/main/java/org/apache/beam/sdk/io/FileBasedSink.java
##########
@@ -770,12 +770,10 @@ final void moveToOutputFiles(
       }
       // During a failure case, files may have been deleted in an earlier 
step. Thus
       // we ignore missing files here.
-      FileSystems.rename(
-          srcFiles,
-          dstFiles,
-          StandardMoveOptions.IGNORE_MISSING_FILES,
-          StandardMoveOptions.SKIP_IF_DESTINATION_EXISTS);
-      removeTemporaryFiles(srcFiles);

Review comment:
       Might make sense to update the semantics of  
"StandardMoveOptions.SKIP_IF_DESTINATION_EXISTS" to delete the source during 
rename. That will allow us to prevent the double delete for the case where the 
source existed.
   
   Also probably removeTemporaryFiles() should be updated to just cleanup the 
temporary directory (where appropriate) instead of trying to delete already 
renamed files. 




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


Reply via email to