danny0405 commented on code in PR #9003:
URL: https://github.com/apache/hudi/pull/9003#discussion_r1233169249


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/marker/WriteMarkers.java:
##########
@@ -107,6 +107,34 @@ public Option<Path> createIfNotExists(String 
partitionPath, String fileName, IOT
     return create(partitionPath, fileName, type, true);
   }
 
+  /**
+   * Creates a marker if the marker does not exist.
+   * This can invoke marker-based early conflict detection when enabled for 
multi-writers.
+   *
+   * @param partitionPath  partition path in the table
+   * @param fileName       file name
+   * @param type           write IO type
+   * @param writeConfig    Hudi write configs.
+   * @param fileId         File ID.
+   * @param activeTimeline Active timeline for the write operation.
+   * @return the marker path.
+   */
+  public Option<Path> createIfNotExists(String partitionPath, String fileName, 
IOType type, HoodieWriteConfig writeConfig,
+                             String fileId, HoodieActiveTimeline 
activeTimeline) {
+    if 
(writeConfig.getWriteConcurrencyMode().supportsOptimisticConcurrencyControl()
+        && writeConfig.isEarlyConflictDetectionEnable()) {

Review Comment:
   can we change it to
   
   ```writeConfig.isEarlyConflictDetectionEnable() 
        && 
writeConfig.getWriteConcurrencyMode().supportsOptimisticConcurrencyControl()
   ```
   
   which is more efficient.



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