alexr17 commented on code in PR #13836:
URL: https://github.com/apache/hudi/pull/13836#discussion_r2323641754
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/transaction/lock/StorageBasedLockProvider.java:
##########
@@ -590,4 +612,45 @@ private void logErrorLockState(LockState state, String
msg) {
long getCurrentEpochMs() {
return System.currentTimeMillis();
}
+
+ /**
+ * Helper method to start audit operation when lock is acquired.
+ */
+ private void startAuditOperation(long timestamp) {
+ storageLpAuditService.ifPresent(auditService -> {
+ try {
+ String sessionId = UUID.randomUUID().toString();
+ auditService.startOperation(sessionId, timestamp);
+ } catch (Exception e) {
+ // Log but don't fail the lock operation due to recording failures
+ logger.warn("Owner {}: Failed to start audit operation: {}", ownerId,
e.getMessage());
+ }
+ });
+ }
+
+ /**
+ * Helper method to update audit operation for renewals.
+ */
+ private void updateAuditOperation(long timestamp) {
+ storageLpAuditService.ifPresent(auditService -> {
+ try {
+ auditService.updateOperation(timestamp);
+ } catch (Exception e) {
+ logger.warn("Owner {}: Failed to update audit operation: {}", ownerId,
e.getMessage());
+ }
+ });
+ }
+
+ /**
+ * Helper method to end audit operation.
+ */
+ private void endAuditOperation(long timestamp, String finalState) {
Review Comment:
Sure that makes more sense. I will update it.
--
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]