codope commented on code in PR #13077:
URL: https://github.com/apache/hudi/pull/13077#discussion_r2026465874
##########
hudi-common/src/main/java/org/apache/hudi/common/table/timeline/TimeGeneratorBase.java:
##########
@@ -85,20 +85,26 @@ public TimeGeneratorBase(HoodieTimeGeneratorConfig config,
StorageConfiguration<
protected LockProvider<?> getLockProvider() {
// Perform lazy initialization of lock provider only if needed
- if (lockProvider == null) {
+ String lockProviderClass =
lockConfiguration.getConfig().getString("hoodie.write.lock.provider");
+ LOG.info("LockProvider for TimeGenerator: {}", lockProviderClass);
+ if (!LockProvider.isThreadSafe(lockProviderClass)) {
+ return createLockProvider(lockProviderClass);
Review Comment:
1. Please add an inline comment to explain the rationale behind returning a
new instance for non-thread safe providers.
2. Creating a new instance for non-thread safe providers on every call might
have performance and heap usage implications. Given that time generation has to
happen on every start/end of operation, could this lead to poor driver memory
utilization especially if multiple streams are multiplexed on the same driver?
--
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]