vinothchandar commented on a change in pull request #1009:  [HUDI-308] Avoid 
Renames for tracking state transitions of all actions on dataset
URL: https://github.com/apache/incubator-hudi/pull/1009#discussion_r348086994
 
 

 ##########
 File path: 
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieActiveTimeline.java
 ##########
 @@ -404,12 +461,16 @@ public void saveToCleanRequested(HoodieInstant instant, 
Option<byte[]> content)
     // Write workload to auxiliary folder
     createFileInAuxiliaryFolder(instant, content);
     // Plan is only stored in auxiliary folder
-    createFileInMetaPath(instant.getFileName(), Option.empty());
+    createFileInMetaPath(instant.getFileName(), Option.empty(), false);
   }
 
-  private void createFileInMetaPath(String filename, Option<byte[]> content) {
+  private void createFileInMetaPath(String filename, Option<byte[]> content, 
boolean allowOverwrite) {
     Path fullPath = new Path(metaClient.getMetaPath(), filename);
-    createFileInPath(fullPath, content);
+    if (allowOverwrite || metaClient.getMetadataVersion().isNullVersion()) {
+      createFileInPath(fullPath, content);
+    } else {
+      writeFileOnceInPath(fullPath, content);
 
 Review comment:
   why do we have to support the two modes of creating? seems the difference is 
just that one creates and then opens, while one open a new file , writes, 
closes? 

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to