peterxcli commented on code in PR #8628:
URL: https://github.com/apache/ozone/pull/8628#discussion_r2147034588


##########
hadoop-ozone/tools/src/main/java/org/apache/hadoop/ozone/debug/CheckNative.java:
##########
@@ -39,77 +42,45 @@
 @MetaInfServices(DebugSubcommand.class)
 public class CheckNative extends AbstractSubcommand implements Callable<Void>, 
DebugSubcommand {
 
-  private static class LibraryCheckResult {
-    private final boolean loaded;
-    private final String detail;
-
-    LibraryCheckResult(boolean loaded, String detail) {
-      this.loaded = loaded;
-      this.detail = detail;
-    }
-
-    public boolean isLoaded() {
-      return loaded;
-    }
-
-    public String getDetail() {
-      return detail;
-    }
-  }
-
-  private LibraryCheckResult getLibraryStatus(
-      Supplier<String> failureReasonSupplier,
-      Supplier<String> libraryNameSupplier) {
-    String failureReason = failureReasonSupplier.get();
-    if (failureReason != null) {
-      return new LibraryCheckResult(false, failureReason);
-    } else {
-      return new LibraryCheckResult(true, libraryNameSupplier.get());
-    }
-  }
-
   @Override
   public Void call() throws Exception {
-    boolean nativeHadoopLoaded = 
org.apache.hadoop.util.NativeCodeLoader.isNativeCodeLoaded();
-    String hadoopLibraryName = "";
-    String isalDetail = "";
-    boolean isalLoaded = false;
-    String opensslDetail = "";
-    boolean opensslLoaded = false;
+    Map<String, Object> results = new LinkedHashMap<>();

Review Comment:
   Was there a specific reason for using `Object` instead of `String`? Are you 
planning to return different types in future iterations?
   ```java
       ...
       Map<String, String> results = new LinkedHashMap<>();
       ...
   
     private static String checkLibrary(boolean loaded, Supplier<String> 
libraryName) {
       return checkLibrary(loaded ? null : "", libraryName);
     }
     
     private static String checkLibrary(String failureReason, Supplier<String> 
libraryName) {
       boolean loaded = failureReason == null;
       String detail = loaded ? libraryName.get() : failureReason;
       return String.format("%-5b  %s", loaded, detail);
     }
   ```



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to