n3nash commented on a change in pull request #2374:
URL: https://github.com/apache/hudi/pull/2374#discussion_r550972066



##########
File path: 
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/AbstractHoodieWriteClient.java
##########
@@ -203,6 +208,45 @@ public boolean commitStats(String instantTime, 
List<HoodieWriteStat> stats, Opti
     return true;
   }
 
+  public boolean commitStats(String instantTime, List<HoodieWriteStat> stats, 
Option<Map<String, String>> extraMetadata,
+                             String commitActionType, Map<String, 
List<String>> partitionToReplaceFileIds) {
+
+    HoodieCommitMetadata metadata = CommitUtils.buildMetadata(stats, 
partitionToReplaceFileIds, extraMetadata,
+        operationType, config.getSchema(), commitActionType);
+    if (config.isMultiWriterEnabled()) {
+      // get strategy and lock type
+      LockConfiguration lockConfiguration = new 
LockConfiguration(config.getProps());
+      LockProvider lockProvider = (LockProvider) 
ReflectionUtils.loadClass(config.getLockProviderClass(),
+          lockConfiguration, fs.getConf());
+      try {
+        // TODO : Get timeout and set the timeout
+        boolean acquired = lockProvider.tryLock();
+        if (!acquired) {
+          throw new HoodieException("Unable to acquire lock");
+        }
+        LOG.info("Acquired lock for instant time " + instantTime);
+        // TODO : Move the following to a "critical section"

Review comment:
       Not anymore




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


Reply via email to