This is an automated email from the ASF dual-hosted git repository. voonhous pushed a commit to branch release-1.2.1 in repository https://gitbox.apache.org/repos/asf/hudi.git
commit fd3823a42c3c5ad3f3f82dea883db87ed408bd6f Author: voonhous <[email protected]> AuthorDate: Sun Jul 5 02:55:56 2026 +0800 refactor(spark): use SLF4J parameterized logging instead of string concatenation (#19184) (cherry picked from commit 79543235ebdcf66ce36caa450ca335a2f2bb5688) --- .../org/apache/hudi/client/TestHoodieClientMultiWriter.java | 12 ++++++------ .../TestDataValidationCheckForLogCompactionActions.java | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hudi-spark-datasource/hudi-spark/src/test/java/org/apache/hudi/client/TestHoodieClientMultiWriter.java b/hudi-spark-datasource/hudi-spark/src/test/java/org/apache/hudi/client/TestHoodieClientMultiWriter.java index a53f167c2efd..1b00e1376e4b 100644 --- a/hudi-spark-datasource/hudi-spark/src/test/java/org/apache/hudi/client/TestHoodieClientMultiWriter.java +++ b/hudi-spark-datasource/hudi-spark/src/test/java/org/apache/hudi/client/TestHoodieClientMultiWriter.java @@ -1030,7 +1030,7 @@ public class TestHoodieClientMultiWriter extends HoodieClientTestBase { writer1Succeeded.set(true); } catch (Exception e) { // Expected - one writer may fail due to concurrent execution - LOG.info("Writer 1 failed with exception: " + e.getMessage()); + LOG.info("Writer 1 failed with exception: {}", e.getMessage()); writer1Succeeded.set(false); } }); @@ -1045,7 +1045,7 @@ public class TestHoodieClientMultiWriter extends HoodieClientTestBase { writer2Succeeded.set(true); } catch (Exception e) { // Expected - one writer may fail due to concurrent execution - LOG.info("Writer 2 failed with exception: " + e.getMessage()); + LOG.info("Writer 2 failed with exception: {}", e.getMessage()); writer2Succeeded.set(false); } }); @@ -1528,9 +1528,9 @@ public class TestHoodieClientMultiWriter extends HoodieClientTestBase { try { ingestBatch(writeFn, client1, newCommitTime1, writeRecords1, runCountDownLatch); } catch (IOException e) { - LOG.error("IOException thrown " + e.getMessage()); + LOG.error("IOException thrown {}", e.getMessage()); } catch (InterruptedException e) { - LOG.error("Interrupted Exception thrown " + e.getMessage()); + LOG.error("Interrupted Exception thrown {}", e.getMessage()); } catch (Exception e) { client1Succeeded.set(false); } @@ -1541,9 +1541,9 @@ public class TestHoodieClientMultiWriter extends HoodieClientTestBase { try { ingestBatch(writeFn, client2, newCommitTime2, writeRecords2, runCountDownLatch); } catch (IOException e) { - LOG.error("IOException thrown " + e.getMessage()); + LOG.error("IOException thrown {}", e.getMessage()); } catch (InterruptedException e) { - LOG.error("Interrupted Exception thrown " + e.getMessage()); + LOG.error("Interrupted Exception thrown {}", e.getMessage()); } catch (Exception e) { client2Succeeded.set(false); } diff --git a/hudi-spark-datasource/hudi-spark/src/test/java/org/apache/hudi/client/functional/TestDataValidationCheckForLogCompactionActions.java b/hudi-spark-datasource/hudi-spark/src/test/java/org/apache/hudi/client/functional/TestDataValidationCheckForLogCompactionActions.java index bb6c04a781f1..a0e5d6dce773 100644 --- a/hudi-spark-datasource/hudi-spark/src/test/java/org/apache/hudi/client/functional/TestDataValidationCheckForLogCompactionActions.java +++ b/hudi-spark-datasource/hudi-spark/src/test/java/org/apache/hudi/client/functional/TestDataValidationCheckForLogCompactionActions.java @@ -122,12 +122,12 @@ public class TestDataValidationCheckForLogCompactionActions extends HoodieClient // Total ingestion writes. int totalWrites = 15; - LOG.warn("Starting trial with seed " + seed); + LOG.warn("Starting trial with seed {}", seed); // Current ingestion commit. int curr = 1; while (curr < totalWrites) { - LOG.warn("Starting write No. " + curr); + LOG.warn("Starting write No. {}", curr); // Pick an action. It can be insert/update/delete and write data to main table. boolean status = writeOnMainTable(mainTable, curr); @@ -145,7 +145,7 @@ public class TestDataValidationCheckForLogCompactionActions extends HoodieClient // Verify the records in both the tables. verifyRecords(mainTable, experimentTable); - LOG.warn("For write No." + curr + ", verification passed. Last ingestion commit timestamp is " + mainTable.commitTimeOnMainTable); + LOG.warn("For write No.{}, verification passed. Last ingestion commit timestamp is {}", curr, mainTable.commitTimeOnMainTable); } curr++; } @@ -195,7 +195,7 @@ public class TestDataValidationCheckForLogCompactionActions extends HoodieClient result = deleteDataIntoMainTable(mainTable, commitTime); } } catch (IllegalArgumentException e) { - LOG.warn(e.getMessage() + " ignoring current command."); + LOG.warn("{} ignoring current command.", e.getMessage()); return false; } }
