From acbcf65fc7b106a21192df88dea55a53ac4c9742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E6=99=A8=E9=98=B3?= Date: Thu, 21 Aug 2025 19:20:13 +0800 Subject: [PATCH 1/5] Confirm the value of dfs.domain.socket.path by checking the glibc version --- .../bigtop/v3_3_0/hadoop/HadoopParams.java | 304 ++++++++++++++++++ 1 file changed, 304 insertions(+) diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java index b3110a7a4..09d26781e 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java @@ -31,6 +31,8 @@ import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; +import java.io.BufferedReader; +import java.io.InputStreamReader; import java.text.MessageFormat; import java.util.ArrayList; import java.util.Arrays; @@ -125,6 +127,9 @@ public Map hdfsSite() { ((String) hdfsSite.get("dfs.namenode.https-address")).replace("0.0.0.0", namenodeList.get(0))); } + // Configure native library dependent settings + configureNativeLibraryDependentSettings(hdfsSite); + dfsDataDir = (String) hdfsSite.get("dfs.datanode.data.dir"); dfsNameNodeDir = (String) hdfsSite.get("dfs.namenode.name.dir"); nameNodeFormattedDirs = Arrays.stream(dfsNameNodeDir.split(",")) @@ -193,4 +198,303 @@ public String binDir() { public String getServiceName() { return "hadoop"; } + + /** + * Configure native library dependent settings for HDFS. + * This method intelligently detects libhadoop native library availability + * and automatically configures short-circuit reads and UNIX domain socket settings. + *

+ * Short-circuit read optimization explanation: + * - When client and DataNode are on the same node, network layer can be bypassed + * to read local data blocks directly + * - Requires glibc version >= 2.34 to ensure native library compatibility + * - Uses UNIX domain sockets for inter-process communication to improve performance + * + * @param hdfsSite The HDFS site configuration map to be modified + */ + private void configureNativeLibraryDependentSettings(Map hdfsSite) { + try { + // Detect system glibc version to determine native library support + boolean enableShortCircuit = isGlibcVersionCompatible(); + String domainSocketPath = null; + + if (enableShortCircuit) { + log.info("Detected glibc version >= 2.34, enabling short-circuit read optimization"); + + // Get recommended domain socket path and append port placeholder + domainSocketPath = findOptimalDomainSocketPath(); + if (domainSocketPath != null) { + // _PORT placeholder will be replaced with actual port number by DataNode at runtime + domainSocketPath = domainSocketPath + "/dn._PORT"; + log.info("Enabling short-circuit reads with domain socket path: {}", domainSocketPath); + } + } else { + log.info("glibc version < 2.34 or detection failed, disabling short-circuit reads for compatibility"); + } + + // Apply short-circuit read configuration + applyShortCircuitConfiguration(hdfsSite, enableShortCircuit, domainSocketPath); + + // Record configuration results to global parameter map for monitoring and debugging + recordNativeLibraryDetectionResult(enableShortCircuit, "glibc_version_check"); + + } catch (Exception e) { + log.error("Error occurred during glibc version detection, disabling short-circuit reads for safety", e); + applyShortCircuitConfiguration(hdfsSite, false, null); + recordNativeLibraryDetectionResult(false, "detection_error"); + } + } + + /** + * Check if glibc version is >= 2.34 to determine native library support. + *

+ * Detection logic: + * 1. First attempt to use 'ldd --version' command to get glibc version + * 2. If failed, try 'getconf GNU_LIBC_VERSION' as fallback method + * 3. Parse version number and compare with minimum required version (2.34) + * + * @return true if glibc version >= 2.34, false otherwise + */ + private boolean isGlibcVersionCompatible() { + try { + // Method 1: Use ldd command to detect glibc version + ProcessBuilder pb = new ProcessBuilder("ldd", "--version"); + pb.redirectErrorStream(true); + Process process = pb.start(); + + try (BufferedReader reader = + new BufferedReader(new InputStreamReader(process.getInputStream()))) { + String line; + while ((line = reader.readLine()) != null) { + // Look for lines containing glibc version information + if (line.contains("GNU libc") || line.contains("GLIBC")) { + String version = extractGlibcVersionFromLine(line); + if (version != null) { + boolean supported = compareVersionStrings(version, "2.34") >= 0; + log.debug("Detected glibc version via ldd: {}, supported: {}", version, supported); + return supported; + } + } + } + } + + int exitCode = process.waitFor(); + if (exitCode != 0) { + log.debug("ldd --version command failed with exit code: {}", exitCode); + } + + // Method 2: Try getconf as fallback detection method + return detectGlibcVersionViaGetconf(); + + } catch (Exception e) { + log.debug("Exception during glibc version detection: {}", e.getMessage()); + return detectGlibcVersionViaGetconf(); + } + } + + /** + * Alternative method using getconf command to detect glibc version. + * + * @return true if detected version >= 2.34, false otherwise + */ + private boolean detectGlibcVersionViaGetconf() { + try { + ProcessBuilder pb = new ProcessBuilder("getconf", "GNU_LIBC_VERSION"); + pb.redirectErrorStream(true); + Process process = pb.start(); + + try (java.io.BufferedReader reader = + new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream()))) { + String line = reader.readLine(); + if (line != null && line.startsWith("glibc ")) { + String version = line.substring(6).trim(); + boolean supported = compareVersionStrings(version, "2.34") >= 0; + log.debug("Detected glibc version via getconf: {}, supported: {}", version, supported); + return supported; + } + } + + process.waitFor(); + } catch (Exception e) { + log.debug("getconf method detection failed: {}", e.getMessage()); + } + + // Default to false for safety + log.warn("Could not determine glibc version, defaulting to disable short-circuit reads"); + return false; + } + + /** + * Extract glibc version number from ldd output line. + *

+ * Supported format examples: + * - "ldd (GNU libc) 2.35" + * - "ldd (Ubuntu GLIBC 2.35-0ubuntu3.1) 2.35" + * - "ldd (GNU libc) 2.34" + * + * @param line Single line of text from ldd command output + * @return Extracted version string like "2.35", or null if extraction failed + */ + private String extractGlibcVersionFromLine(String line) { + // Split line by whitespace and look for version pattern + String[] parts = line.split("\\s+"); + for (String part : parts) { + // Match version pattern like "2.35" + if (part.matches("\\d+\\.\\d+.*")) { + // Extract major.minor version numbers + String cleanVersion = part.replaceAll("[^\\d.]", ""); + // Ensure only major and minor versions are kept + String[] versionParts = cleanVersion.split("\\."); + if (versionParts.length >= 2) { + return versionParts[0] + "." + versionParts[1]; + } + return cleanVersion; + } + } + return null; + } + + /** + * Compare two version strings (major.minor format). + * + * @param v1 First version string + * @param v2 Second version string + * @return negative if v1 < v2, zero if equal, positive if v1 > v2 + */ + private int compareVersionStrings(String v1, String v2) { + String[] parts1 = v1.split("\\."); + String[] parts2 = v2.split("\\."); + + int major1 = Integer.parseInt(parts1[0]); + int minor1 = parts1.length > 1 ? Integer.parseInt(parts1[1]) : 0; + + int major2 = Integer.parseInt(parts2[0]); + int minor2 = parts2.length > 1 ? Integer.parseInt(parts2[1]) : 0; + + // Compare major version first + if (major1 != major2) { + return major1 - major2; + } + // Compare minor version when major versions are equal + return minor1 - minor2; + } + + /** + * Find the optimal domain socket path. + *

+ * Path selection strategy: + * 1. Check candidate paths in priority order for existence and writability + * 2. If none are available, attempt to create default directory + * 3. Finally fall back to /tmp directory + * + * @return Recommended domain socket base path + */ + private String findOptimalDomainSocketPath() { + // Candidate paths in priority order + String[] candidatePaths = { + "/var/run/hadoop", + "/tmp/hadoop", + "/tmp" + }; + + // Check availability of existing paths + for (String path : candidatePaths) { + java.io.File dir = new java.io.File(path); + if (dir.exists() && dir.canWrite()) { + log.debug("Selected domain socket path: {}", path); + return path; + } + } + + // Try to create default hadoop directory + java.io.File defaultDir = new java.io.File("/tmp/hadoop"); + if (!defaultDir.exists()) { + try { + if (defaultDir.mkdirs()) { + log.debug("Created and using domain socket path: /tmp/hadoop"); + return "/tmp/hadoop"; + } + } catch (Exception e) { + log.warn("Cannot create directory /tmp/hadoop, using /tmp as fallback", e); + } + } + + log.debug("Using fallback domain socket path: /tmp"); + return "/tmp"; + } + + /** + * Apply short-circuit read settings in HDFS site configuration. + *

+ * Configuration properties explanation: + * - dfs.client.read.shortcircuit: Whether to enable short-circuit reads + * - dfs.domain.socket.path: UNIX domain socket path + * - dfs.client.read.shortcircuit.streams.cache.size: Short-circuit read stream cache size + * + * @param hdfsSite HDFS site configuration map + * @param enableShortCircuit Whether to enable short-circuit reads + * @param domainSocketPath Domain socket path (null to disable domain socket) + */ + private void applyShortCircuitConfiguration( + Map hdfsSite, boolean enableShortCircuit, String domainSocketPath) { + + // Configure short-circuit read main switch + hdfsSite.put("dfs.client.read.shortcircuit", String.valueOf(enableShortCircuit)); + + if (enableShortCircuit && domainSocketPath != null) { + // Enable UNIX domain socket for high-performance short-circuit reads + hdfsSite.put("dfs.domain.socket.path", domainSocketPath); + log.info("Short-circuit reads enabled with domain socket path: {}", domainSocketPath); + } else { + // Remove domain socket path configuration to prevent DataNode startup failures + // This avoids startup errors due to libhadoop loading issues + hdfsSite.remove("dfs.domain.socket.path"); + if (enableShortCircuit) { + log.info("Short-circuit reads enabled (fallback mode, without domain socket)"); + } else { + log.info("Short-circuit reads disabled"); + } + } + + // Configure stream cache based on short-circuit read status + configureShortCircuitStreamCache(hdfsSite, enableShortCircuit); + } + + /** + * Configure short-circuit read stream cache settings. + * + * @param hdfsSite HDFS site configuration map + * @param enableShortCircuit Whether short-circuit reads are enabled + */ + private void configureShortCircuitStreamCache(Map hdfsSite, boolean enableShortCircuit) { + if (enableShortCircuit) { + // Optimize cache size when short-circuit reads are enabled for better performance + Object currentCacheSize = hdfsSite.get("dfs.client.read.shortcircuit.streams.cache.size"); + if (currentCacheSize == null || "0".equals(currentCacheSize.toString())) { + hdfsSite.put("dfs.client.read.shortcircuit.streams.cache.size", "4096"); + log.debug("Configured short-circuit read stream cache size to 4096"); + } + } else { + // Set cache to 0 when short-circuit reads are disabled to save memory + hdfsSite.put("dfs.client.read.shortcircuit.streams.cache.size", "0"); + log.debug("Short-circuit read stream cache disabled"); + } + } + + /** + * Record native library detection results to global parameter map. + * Used for system monitoring, debugging and operational analysis. + * + * @param nativeLibAvailable Whether native library is available + * @param detectionMethod Detection method identifier + */ + private void recordNativeLibraryDetectionResult(boolean nativeLibAvailable, String detectionMethod) { + globalParamsMap.put("native_lib_available", nativeLibAvailable); + globalParamsMap.put("native_lib_detection_method", detectionMethod); + globalParamsMap.put("auto_configured_shortcircuit", nativeLibAvailable); + + log.debug("Native library detection result recorded - available: {}, method: {}", + nativeLibAvailable, detectionMethod); + } + } From 9880a9d75afbbf62af69c298fa393f58b507e110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E6=99=A8=E9=98=B3?= Date: Thu, 21 Aug 2025 19:26:47 +0800 Subject: [PATCH 2/5] code checkstyle --- .../bigtop/v3_3_0/hadoop/HadoopParams.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java index 09d26781e..8606829c0 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java @@ -262,8 +262,7 @@ private boolean isGlibcVersionCompatible() { pb.redirectErrorStream(true); Process process = pb.start(); - try (BufferedReader reader = - new BufferedReader(new InputStreamReader(process.getInputStream()))) { + try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()))) { String line; while ((line = reader.readLine()) != null) { // Look for lines containing glibc version information @@ -304,7 +303,7 @@ private boolean detectGlibcVersionViaGetconf() { Process process = pb.start(); try (java.io.BufferedReader reader = - new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream()))) { + new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream()))) { String line = reader.readLine(); if (line != null && line.startsWith("glibc ")) { String version = line.substring(6).trim(); @@ -391,11 +390,7 @@ private int compareVersionStrings(String v1, String v2) { */ private String findOptimalDomainSocketPath() { // Candidate paths in priority order - String[] candidatePaths = { - "/var/run/hadoop", - "/tmp/hadoop", - "/tmp" - }; + String[] candidatePaths = {"/var/run/hadoop", "/tmp/hadoop", "/tmp"}; // Check availability of existing paths for (String path : candidatePaths) { @@ -493,8 +488,9 @@ private void recordNativeLibraryDetectionResult(boolean nativeLibAvailable, Stri globalParamsMap.put("native_lib_detection_method", detectionMethod); globalParamsMap.put("auto_configured_shortcircuit", nativeLibAvailable); - log.debug("Native library detection result recorded - available: {}, method: {}", - nativeLibAvailable, detectionMethod); + log.debug( + "Native library detection result recorded - available: {}, method: {}", + nativeLibAvailable, + detectionMethod); } - } From bdcf371f5acc76d13c0d1f726d20af6958123822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E6=99=A8=E9=98=B3?= Date: Mon, 25 Aug 2025 22:21:49 +0800 Subject: [PATCH 3/5] Change the Linux command to execute linuxOSUtils. --- .../bigtop/v3_3_0/hadoop/HadoopParams.java | 39 +++++++------------ 1 file changed, 14 insertions(+), 25 deletions(-) diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java index 8606829c0..457339617 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java @@ -23,6 +23,8 @@ import org.apache.bigtop.manager.stack.core.annotations.GlobalParams; import org.apache.bigtop.manager.stack.core.spi.param.Params; import org.apache.bigtop.manager.stack.core.utils.LocalSettings; +import org.apache.bigtop.manager.stack.core.utils.linux.LinuxOSUtils; +import org.apache.bigtop.manager.common.shell.ShellResult; import org.apache.commons.lang3.StringUtils; @@ -31,8 +33,6 @@ import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; -import java.io.BufferedReader; -import java.io.InputStreamReader; import java.text.MessageFormat; import java.util.ArrayList; import java.util.Arrays; @@ -258,13 +258,11 @@ private void configureNativeLibraryDependentSettings(Map hdfsSit private boolean isGlibcVersionCompatible() { try { // Method 1: Use ldd command to detect glibc version - ProcessBuilder pb = new ProcessBuilder("ldd", "--version"); - pb.redirectErrorStream(true); - Process process = pb.start(); - - try (BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()))) { - String line; - while ((line = reader.readLine()) != null) { + ShellResult result = LinuxOSUtils.execCmd("ldd --version"); + if (result.getExitCode() == 0) { + String output = result.getOutput(); + String[] lines = output.split("\n"); + for (String line : lines) { // Look for lines containing glibc version information if (line.contains("GNU libc") || line.contains("GLIBC")) { String version = extractGlibcVersionFromLine(line); @@ -275,11 +273,8 @@ private boolean isGlibcVersionCompatible() { } } } - } - - int exitCode = process.waitFor(); - if (exitCode != 0) { - log.debug("ldd --version command failed with exit code: {}", exitCode); + } else { + log.debug("ldd --version command failed with exit code: {}", result.getExitCode()); } // Method 2: Try getconf as fallback detection method @@ -298,22 +293,16 @@ private boolean isGlibcVersionCompatible() { */ private boolean detectGlibcVersionViaGetconf() { try { - ProcessBuilder pb = new ProcessBuilder("getconf", "GNU_LIBC_VERSION"); - pb.redirectErrorStream(true); - Process process = pb.start(); - - try (java.io.BufferedReader reader = - new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream()))) { - String line = reader.readLine(); - if (line != null && line.startsWith("glibc ")) { - String version = line.substring(6).trim(); + ShellResult result = LinuxOSUtils.execCmd("getconf GNU_LIBC_VERSION"); + if (result.getExitCode() == 0) { + String output = result.getOutput().trim(); + if (output.startsWith("glibc ")) { + String version = output.substring(6).trim(); boolean supported = compareVersionStrings(version, "2.34") >= 0; log.debug("Detected glibc version via getconf: {}, supported: {}", version, supported); return supported; } } - - process.waitFor(); } catch (Exception e) { log.debug("getconf method detection failed: {}", e.getMessage()); } From 963175c2284df0dcae95469add52b32a8f0064fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E6=99=A8=E9=98=B3?= Date: Mon, 25 Aug 2025 22:24:30 +0800 Subject: [PATCH 4/5] code checkstyle --- .../bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java index 457339617..54847ca94 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java @@ -18,13 +18,13 @@ */ package org.apache.bigtop.manager.stack.bigtop.v3_3_0.hadoop; +import org.apache.bigtop.manager.common.shell.ShellResult; import org.apache.bigtop.manager.grpc.payload.ComponentCommandPayload; import org.apache.bigtop.manager.stack.bigtop.param.BigtopParams; import org.apache.bigtop.manager.stack.core.annotations.GlobalParams; import org.apache.bigtop.manager.stack.core.spi.param.Params; import org.apache.bigtop.manager.stack.core.utils.LocalSettings; import org.apache.bigtop.manager.stack.core.utils.linux.LinuxOSUtils; -import org.apache.bigtop.manager.common.shell.ShellResult; import org.apache.commons.lang3.StringUtils; From 4c5062809e179c93ef95ec9413ec08bf7a689f1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=B5=E6=99=A8=E9=98=B3?= Date: Thu, 28 Aug 2025 13:32:39 +0800 Subject: [PATCH 5/5] =?UTF-8?q?Remove=20unused=20code=EF=BC=8CModify=20Log?= =?UTF-8?q?=20Level?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bigtop/v3_3_0/hadoop/HadoopParams.java | 42 +++++-------------- 1 file changed, 10 insertions(+), 32 deletions(-) diff --git a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java index 54847ca94..2409debc5 100644 --- a/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java +++ b/bigtop-manager-stack/bigtop-manager-stack-bigtop/src/main/java/org/apache/bigtop/manager/stack/bigtop/v3_3_0/hadoop/HadoopParams.java @@ -235,13 +235,9 @@ private void configureNativeLibraryDependentSettings(Map hdfsSit // Apply short-circuit read configuration applyShortCircuitConfiguration(hdfsSite, enableShortCircuit, domainSocketPath); - // Record configuration results to global parameter map for monitoring and debugging - recordNativeLibraryDetectionResult(enableShortCircuit, "glibc_version_check"); - } catch (Exception e) { log.error("Error occurred during glibc version detection, disabling short-circuit reads for safety", e); applyShortCircuitConfiguration(hdfsSite, false, null); - recordNativeLibraryDetectionResult(false, "detection_error"); } } @@ -268,20 +264,20 @@ private boolean isGlibcVersionCompatible() { String version = extractGlibcVersionFromLine(line); if (version != null) { boolean supported = compareVersionStrings(version, "2.34") >= 0; - log.debug("Detected glibc version via ldd: {}, supported: {}", version, supported); + log.info("Detected glibc version via ldd: {}, supported: {}", version, supported); return supported; } } } } else { - log.debug("ldd --version command failed with exit code: {}", result.getExitCode()); + log.info("ldd --version command failed with exit code: {}", result.getExitCode()); } // Method 2: Try getconf as fallback detection method return detectGlibcVersionViaGetconf(); } catch (Exception e) { - log.debug("Exception during glibc version detection: {}", e.getMessage()); + log.info("Exception during glibc version detection: {}", e.getMessage()); return detectGlibcVersionViaGetconf(); } } @@ -299,12 +295,12 @@ private boolean detectGlibcVersionViaGetconf() { if (output.startsWith("glibc ")) { String version = output.substring(6).trim(); boolean supported = compareVersionStrings(version, "2.34") >= 0; - log.debug("Detected glibc version via getconf: {}, supported: {}", version, supported); + log.info("Detected glibc version via getconf: {}, supported: {}", version, supported); return supported; } } } catch (Exception e) { - log.debug("getconf method detection failed: {}", e.getMessage()); + log.info("getconf method detection failed: {}", e.getMessage()); } // Default to false for safety @@ -385,7 +381,7 @@ private String findOptimalDomainSocketPath() { for (String path : candidatePaths) { java.io.File dir = new java.io.File(path); if (dir.exists() && dir.canWrite()) { - log.debug("Selected domain socket path: {}", path); + log.info("Selected domain socket path: {}", path); return path; } } @@ -395,7 +391,7 @@ private String findOptimalDomainSocketPath() { if (!defaultDir.exists()) { try { if (defaultDir.mkdirs()) { - log.debug("Created and using domain socket path: /tmp/hadoop"); + log.info("Created and using domain socket path: /tmp/hadoop"); return "/tmp/hadoop"; } } catch (Exception e) { @@ -403,7 +399,7 @@ private String findOptimalDomainSocketPath() { } } - log.debug("Using fallback domain socket path: /tmp"); + log.info("Using fallback domain socket path: /tmp"); return "/tmp"; } @@ -456,30 +452,12 @@ private void configureShortCircuitStreamCache(Map hdfsSite, bool Object currentCacheSize = hdfsSite.get("dfs.client.read.shortcircuit.streams.cache.size"); if (currentCacheSize == null || "0".equals(currentCacheSize.toString())) { hdfsSite.put("dfs.client.read.shortcircuit.streams.cache.size", "4096"); - log.debug("Configured short-circuit read stream cache size to 4096"); + log.info("Configured short-circuit read stream cache size to 4096"); } } else { // Set cache to 0 when short-circuit reads are disabled to save memory hdfsSite.put("dfs.client.read.shortcircuit.streams.cache.size", "0"); - log.debug("Short-circuit read stream cache disabled"); + log.info("Short-circuit read stream cache disabled"); } } - - /** - * Record native library detection results to global parameter map. - * Used for system monitoring, debugging and operational analysis. - * - * @param nativeLibAvailable Whether native library is available - * @param detectionMethod Detection method identifier - */ - private void recordNativeLibraryDetectionResult(boolean nativeLibAvailable, String detectionMethod) { - globalParamsMap.put("native_lib_available", nativeLibAvailable); - globalParamsMap.put("native_lib_detection_method", detectionMethod); - globalParamsMap.put("auto_configured_shortcircuit", nativeLibAvailable); - - log.debug( - "Native library detection result recorded - available: {}, method: {}", - nativeLibAvailable, - detectionMethod); - } }