yihua commented on code in PR #14319:
URL: https://github.com/apache/hudi/pull/14319#discussion_r2553272406


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/transaction/TransactionManager.java:
##########
@@ -42,15 +42,20 @@ public class TransactionManager implements Serializable {
   protected Option<HoodieInstant> currentTxnOwnerInstant = Option.empty();
   private Option<HoodieInstant> lastCompletedTxnOwnerInstant = Option.empty();
 
-  public TransactionManager(HoodieWriteConfig config, HoodieStorage storage) {
-    this(new LockManager(config, (FileSystem) storage.getFileSystem()), 
config.isLockRequired());
+  public TransactionManager(HoodieWriteConfig config, FileSystem fs) {
+    this(createLockManager(config, fs), config.isLockRequired());
   }
 
   protected TransactionManager(LockManager lockManager, boolean 
isLockRequired) {
     this.lockManager = lockManager;
     this.isLockRequired = isLockRequired;
   }
 
+  private static LockManager createLockManager(HoodieWriteConfig config, 
FileSystem fs) {
+    fs.getConf().addResource(fs.getConf());

Review Comment:
   Possible to add a unit test on the new logic?



##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/transaction/TransactionManager.java:
##########
@@ -42,15 +42,20 @@ public class TransactionManager implements Serializable {
   protected Option<HoodieInstant> currentTxnOwnerInstant = Option.empty();
   private Option<HoodieInstant> lastCompletedTxnOwnerInstant = Option.empty();
 
-  public TransactionManager(HoodieWriteConfig config, HoodieStorage storage) {
-    this(new LockManager(config, (FileSystem) storage.getFileSystem()), 
config.isLockRequired());
+  public TransactionManager(HoodieWriteConfig config, FileSystem fs) {
+    this(createLockManager(config, fs), config.isLockRequired());

Review Comment:
   Keep the usage of `HoodieStorage` in the constructor and extract the conf in 
`createLockManager`?



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