You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2020/04/27 07:25:38 UTC

[GitHub] [incubator-hudi] hddong opened a new pull request #1567: [HUDI-840]Clean blank file created by HoodieLogFormatWriter

hddong opened a new pull request #1567:
URL: https://github.com/apache/incubator-hudi/pull/1567


   ## *Tips*
   - *Thank you very much for contributing to Apache Hudi.*
   - *Please review https://hudi.apache.org/contributing.html before opening a pull request.*
   
   ## What is the purpose of the pull request
   
   *When roll over is true,  HoodieLogFormatWriter will create next version log file. But it always left a blank file when close.*
   
   ## Brief change log
   
   *(for example:)*
     - *Clean blank file created by HoodieLogFormatWriter*
   
   ## Verify this pull request
   
   This pull request is a trivial rework / code cleanup without any test coverage.
   
   ## Committer checklist
   
    - [ ] Has a corresponding JIRA in PR title & commit
    
    - [ ] Commit message is descriptive of the change
    
    - [ ] CI is green
   
    - [ ] Necessary doc changes done or have another open PR
          
    - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-hudi] bvaradar commented on a change in pull request #1567: [HUDI-840]Clean blank file created by HoodieLogFormatWriter

Posted by GitBox <gi...@apache.org>.
bvaradar commented on a change in pull request #1567:
URL: https://github.com/apache/incubator-hudi/pull/1567#discussion_r416923914



##########
File path: hudi-common/src/main/java/org/apache/hudi/common/table/log/HoodieLogFormatWriter.java
##########
@@ -210,6 +210,14 @@ public void close() throws IOException {
     flush();
     output.close();
     output = null;
+    Path path = logFile.getPath();

Review comment:
       @hddong : Any possible reasons why blank file is created in the first place ? 




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-hudi] vinothchandar commented on pull request #1567: [HUDI-840]Clean blank file created by HoodieLogFormatWriter

Posted by GitBox <gi...@apache.org>.
vinothchandar commented on pull request #1567:
URL: https://github.com/apache/incubator-hudi/pull/1567#issuecomment-620198845


   @n3nash could you also review this since it touches the common log format writer as well 


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-hudi] hddong commented on pull request #1567: [HUDI-840]Clean blank file created by HoodieLogFormatWriter

Posted by GitBox <gi...@apache.org>.
hddong commented on pull request #1567:
URL: https://github.com/apache/incubator-hudi/pull/1567#issuecomment-619786382


   @yanghua please have a review when free.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-hudi] hddong commented on a change in pull request #1567: [HUDI-840]Clean blank file created by HoodieLogFormatWriter

Posted by GitBox <gi...@apache.org>.
hddong commented on a change in pull request #1567:
URL: https://github.com/apache/incubator-hudi/pull/1567#discussion_r417047280



##########
File path: hudi-common/src/main/java/org/apache/hudi/common/table/log/HoodieLogFormatWriter.java
##########
@@ -210,6 +210,14 @@ public void close() throws IOException {
     flush();
     output.close();
     output = null;
+    Path path = logFile.getPath();

Review comment:
       > @hddong : Any possible reasons why blank file is created in the first place ?
   
   Create blank file for `appendBlock` when new `HoodieLogFormatWriter`
   https://github.com/apache/incubator-hudi/blob/f1592be629c3f9762f62d4e1dbf3be54f213d92d/hudi-common/src/main/java/org/apache/hudi/common/table/log/HoodieLogFormatWriter.java#L105-L108
   But there is a special case,  when roll over is true(block size is past the threshold), we will close the old writer and create a new writer . And if we close a new writer created by `rolloverIfNeeded` , there will left a blank file.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org