Zouxxyy commented on code in PR #10994:
URL: https://github.com/apache/hudi/pull/10994#discussion_r1560482072


##########
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/transaction/lock/HiveMetastoreBasedLockProvider.java:
##########
@@ -187,6 +194,12 @@ private void acquireLockInternal(long time, TimeUnit unit, 
LockComponent lockCom
       final LockRequest lockRequestFinal = lockRequest;
       this.lock = executor.submit(() -> hiveClient.lock(lockRequestFinal))
           .get(time, unit);
+
+      // refresh lock in case that certain commit takes a long time.
+      Heartbeat heartbeat = new Heartbeat(hiveClient, lock.getLockid());
+      long heartbeatIntervalMs = lockConfiguration.getConfig()
+          .getLong(LOCK_HEARTBEAT_INTERVAL_MS_KEY, 
DEFAULT_LOCK_HEARTBEAT_INTERVAL_MS);
+      future = executor.scheduleAtFixedRate(heartbeat, heartbeatIntervalMs / 
2, heartbeatIntervalMs, TimeUnit.MICROSECONDS);

Review Comment:
   TimeUnit.MILLISECONDS



-- 
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: commits-unsubscr...@hudi.apache.org

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

Reply via email to