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

ASF GitHub Bot logged work on BEAM-5036:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 30/Sep/18 15:25
            Start Date: 30/Sep/18 15:25
    Worklog Time Spent: 10m 
      Work Description: timrobertson100 commented on a change in pull request 
#6289: [BEAM-5036] Optimize the FileBasedSink WriteOperation.moveToOutput()
URL: https://github.com/apache/beam/pull/6289#discussion_r221462968
 
 

 ##########
 File path: 
sdks/java/core/src/test/java/org/apache/beam/sdk/io/FileSystemsTest.java
 ##########
 @@ -186,6 +189,56 @@ public void testRenameIgnoreMissingFiles() throws 
Exception {
         containsInAnyOrder("content3"));
   }
 
+  @Test
+  public void testRenameOverwriteExistingFilesThrows() throws Exception {
+    // Simulate a filesystem which will not overwrite existing files
+    FileSystem<LocalResourceId> fs = new LocalFileSystem(new CopyOption[0]);
+    thrown.expect(FileAlreadyExistsException.class);
+    executeRename(fs, false);
+  }
+
+  @Test
+  public void testRenameOverwriteExistingFiles() throws Exception {
+    // Simulate a filesystem which will not overwrite existing files
 
 Review comment:
   No, this will not overwrite.
   We are creating a LocalFileSystem in a mode that will not overwrite by 
default, nor do an atomic move. Instead the FS will throw 
FileAlreadyExistsException and we pass in a flag saying that we do want to test 
that FileSystems drops into the loop where it deletes existing and retries.
   
   Perhaps I just need to document the test better?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

    Worklog Id:     (was: 149800)
    Time Spent: 7h 20m  (was: 7h 10m)

> Optimize FileBasedSink's WriteOperation.moveToOutput()
> ------------------------------------------------------
>
>                 Key: BEAM-5036
>                 URL: https://issues.apache.org/jira/browse/BEAM-5036
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-java-files
>    Affects Versions: 2.5.0
>            Reporter: Jozef Vilcek
>            Assignee: Tim Robertson
>            Priority: Major
>          Time Spent: 7h 20m
>  Remaining Estimate: 0h
>
> moveToOutput() methods in FileBasedSink.WriteOperation implements move by 
> copy+delete. It would be better to use a rename() which can be much more 
> effective for some filesystems.
> Filesystem must support cross-directory rename. BEAM-4861 is related to this 
> for the case of HDFS filesystem.
> Feature was discussed here:
> http://mail-archives.apache.org/mod_mbox/beam-dev/201807.mbox/%3CCAF9t7_4Mp54pQ+vRrJrBh9Vx0=uaknupzd_qdh_qdm9vxll...@mail.gmail.com%3E



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to