This is an automated email from the ASF dual-hosted git repository.

wombatukun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hudi.git


The following commit(s) were added to refs/heads/master by this push:
     new 30474ab5904 minor type and code changes (#12740)
30474ab5904 is described below

commit 30474ab5904f4a47a1ae6edfdce0c3409439d401
Author: Sagar Sumit <[email protected]>
AuthorDate: Fri Jan 31 08:12:30 2025 +0530

    minor type and code changes (#12740)
---
 .../org/apache/hudi/table/upgrade/UpgradeDowngradeUtils.java  | 11 ++++++-----
 .../apache/hudi/client/transaction/lock/NoopLockProvider.java |  6 +++---
 .../org/apache/hudi/functional/TestSevenToEightUpgrade.scala  |  3 +--
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git 
a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/upgrade/UpgradeDowngradeUtils.java
 
b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/upgrade/UpgradeDowngradeUtils.java
index 08a0ce4b1d2..ebe407a0a52 100644
--- 
a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/upgrade/UpgradeDowngradeUtils.java
+++ 
b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/upgrade/UpgradeDowngradeUtils.java
@@ -19,6 +19,7 @@
 package org.apache.hudi.table.upgrade;
 
 import org.apache.hudi.client.BaseHoodieWriteClient;
+import org.apache.hudi.client.transaction.lock.NoopLockProvider;
 import org.apache.hudi.common.config.HoodieMetadataConfig;
 import org.apache.hudi.common.config.HoodieTimeGeneratorConfig;
 import org.apache.hudi.common.config.TypedProperties;
@@ -169,15 +170,15 @@ public class UpgradeDowngradeUtils {
       // NOTE: at this stage rollback should use the current writer version 
and disable auto upgrade/downgrade
       TypedProperties properties = new TypedProperties();
       properties.putAll(config.getProps());
-      // TimeGeneratos are cached and re-used based on table base path. Since 
here we are changing the lock configurations, avoiding the cache use
+      // TimeGenerators are cached and re-used based on table base path. Since 
here we are changing the lock configurations, avoiding the cache use
       // for upgrade code block.
       
properties.put(HoodieTimeGeneratorConfig.TIME_GENERATOR_REUSE_ENABLE.key(),"false");
       // override w/ NoopLock Provider to avoid re-entrant locking. already 
upgrade is happening within the table level lock.
-      // Belew we do trigger rollback and compaction which might again try to 
acquire the lock. So, here we are explicitly overriding to
+      // Below we do trigger rollback and compaction which might again try to 
acquire the lock. So, here we are explicitly overriding to
       // NoopLockProvider for just the upgrade code block.
-      
properties.put(HoodieLockConfig.LOCK_PROVIDER_CLASS_NAME.key(),"org.apache.hudi.client.transaction.lock.NoopLockProvider");
-      // if auto adjust it not disabled, chances that InProcessLockProvider 
will get overriden for single writer use-cases.
-      properties.put("hoodie.auto.adjust.lock.configs","false");
+      properties.put(HoodieLockConfig.LOCK_PROVIDER_CLASS_NAME.key(), 
NoopLockProvider.class.getName());
+      // if auto adjust it not disabled, chances that InProcessLockProvider 
will get overridden for single writer use-cases.
+      properties.put(HoodieWriteConfig.AUTO_ADJUST_LOCK_CONFIGS.key(),"false");
       HoodieWriteConfig rollbackWriteConfig = HoodieWriteConfig.newBuilder()
           .withProps(properties)
           .withWriteTableVersion(tableVersion.versionCode())
diff --git 
a/hudi-common/src/main/java/org/apache/hudi/client/transaction/lock/NoopLockProvider.java
 
b/hudi-common/src/main/java/org/apache/hudi/client/transaction/lock/NoopLockProvider.java
index 65c6aa32b32..f77c466271b 100644
--- 
a/hudi-common/src/main/java/org/apache/hudi/client/transaction/lock/NoopLockProvider.java
+++ 
b/hudi-common/src/main/java/org/apache/hudi/client/transaction/lock/NoopLockProvider.java
@@ -31,9 +31,9 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 /**
  * NoopLockProvider as the name suggests, is a no op lock provider. Any caller 
asking for a lock will be able to get hold of the lock.
- * This is not meant to be used a producation grade lock providers. This is 
meant to be used for Hudi's internal operations.
- * For eg: During upgrade, we have nested lock situations and we leverage this 
{@code NoopLockProvider} for any operations we
- * might want to do within the upgradeHandler blocks to avoid re-entrant 
situations. Not all lock providers might support re-entrancy and during upgrade,
+ * This is not meant to be used a production grade lock providers. This is 
meant to be used for Hudi's internal operations.
+ * For eg: During upgrade, we have nested lock situations, and we leverage 
this {@code NoopLockProvider} for any operations we
+ * might want to do within the upgradeHandler blocks to avoid re-entrant 
situations. Not all lock providers support re-entrance and during upgrade,
  * it is expected to have a single writer to the Hudi table of interest.
  */
 public class NoopLockProvider implements LockProvider<ReentrantReadWriteLock>, 
Serializable {
diff --git 
a/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestSevenToEightUpgrade.scala
 
b/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestSevenToEightUpgrade.scala
index 5779bdeb93f..59c0a4141f8 100644
--- 
a/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestSevenToEightUpgrade.scala
+++ 
b/hudi-spark-datasource/hudi-spark/src/test/scala/org/apache/hudi/functional/TestSevenToEightUpgrade.scala
@@ -27,9 +27,8 @@ import org.apache.hudi.keygen.constant.KeyGeneratorType
 import org.apache.hudi.table.upgrade.{SparkUpgradeDowngradeHelper, 
UpgradeDowngrade}
 import org.apache.spark.sql.SaveMode
 import org.junit.jupiter.api.Assertions.assertEquals
-import org.junit.jupiter.api.Test
 import org.junit.jupiter.params.ParameterizedTest
-import org.junit.jupiter.params.provider.{CsvSource, EnumSource}
+import org.junit.jupiter.params.provider.CsvSource
 
 class TestSevenToEightUpgrade extends RecordLevelIndexTestBase {
 

Reply via email to