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

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


The following commit(s) were added to refs/heads/master by this push:
     new 650d1c7d8 [#2425][FOLLOWUP] fix: Fix spotless errors
650d1c7d8 is described below

commit 650d1c7d88afab0d8e63a037f9aa657ae970ba8e
Author: Guoyuan <[email protected]>
AuthorDate: Sat Apr 5 19:27:37 2025 +0800

    [#2425][FOLLOWUP] fix: Fix spotless errors
    
    ### What changes were proposed in this pull request?
    
    Fix spotless errors.
    
    ### Why are the changes needed?
    
    A followup PR for https://github.com/apache/uniffle/pull/2425.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Existing UTs.
---
 .../apache/uniffle/common/KerberizedHadoop.java    | 40 ++++++++++++----------
 1 file changed, 21 insertions(+), 19 deletions(-)

diff --git 
a/common/src/test/java/org/apache/uniffle/common/KerberizedHadoop.java 
b/common/src/test/java/org/apache/uniffle/common/KerberizedHadoop.java
index 4da690825..4b57248c1 100644
--- a/common/src/test/java/org/apache/uniffle/common/KerberizedHadoop.java
+++ b/common/src/test/java/org/apache/uniffle/common/KerberizedHadoop.java
@@ -203,14 +203,16 @@ public class KerberizedHadoop implements Serializable {
               hdfsConf.set("dfs.datanode.address", "0.0.0.0:0");
               hdfsConf.set("dfs.datanode.http.address", "0.0.0.0:0");
 
-              MiniDFSCluster cluster = 
ugi.doAs((PrivilegedExceptionAction<MiniDFSCluster>) () ->
-                      new MiniDFSCluster.Builder(hdfsConf)
-                              .numDataNodes(1)
-                              .clusterId("kerberized-cluster-1")
-                              .checkDataNodeAddrConfig(true)
-                              .format(true)
-                              .build()
-              );
+              MiniDFSCluster cluster =
+                  ugi.doAs(
+                      (PrivilegedExceptionAction<MiniDFSCluster>)
+                          () ->
+                              new MiniDFSCluster.Builder(hdfsConf)
+                                  .numDataNodes(1)
+                                  .clusterId("kerberized-cluster-1")
+                                  .checkDataNodeAddrConfig(true)
+                                  .format(true)
+                                  .build());
 
               LOGGER.info("NameNode: {}", 
cluster.getNameNode().getHttpAddress());
               LOGGER.info("DataNode: {}", 
cluster.getDataNodes().get(0).getXferAddress());
@@ -262,22 +264,22 @@ public class KerberizedHadoop implements Serializable {
 
   private void registerShutdownCleanup(Path dir) {
     if (dir != null) {
-      Runtime.getRuntime().addShutdownHook(new Thread(() -> {
-        try {
-          deleteDirectory(dir);
-        } catch (IOException e) {
-          LOGGER.warn("Failed to delete temp dir on shutdown: {}", dir, e);
-        }
-      }));
+      Runtime.getRuntime()
+          .addShutdownHook(
+              new Thread(
+                  () -> {
+                    try {
+                      deleteDirectory(dir);
+                    } catch (IOException e) {
+                      LOGGER.warn("Failed to delete temp dir on shutdown: {}", 
dir, e);
+                    }
+                  }));
     }
   }
 
   private void deleteDirectory(Path dir) throws IOException {
     if (dir != null && Files.exists(dir)) {
-      Files.walk(dir)
-              .sorted(Comparator.reverseOrder())
-              .map(Path::toFile)
-              .forEach(File::delete);
+      
Files.walk(dir).sorted(Comparator.reverseOrder()).map(Path::toFile).forEach(File::delete);
     }
   }
 

Reply via email to