dongjoon-hyun commented on code in PR #51545:
URL: https://github.com/apache/spark/pull/51545#discussion_r2215215267
##########
common/utils/src/main/java/org/apache/spark/network/util/JavaUtils.java:
##########
@@ -110,7 +108,15 @@ public static void deleteRecursively(File file,
FilenameFilter filter)
// On Unix systems, use operating system command to run faster
// If that does not work out, fallback to the Java IO way
// We exclude Apple Silicon test environment due to the limited resource
issues.
- if (SystemUtils.IS_OS_UNIX && filter == null &&
!(SystemUtils.IS_OS_MAC_OSX &&
+ String osName = System.getProperty("os.name");
+ boolean isMac = osName.regionMatches(true, 0, "Mac OS X", 0, 8);
+ String[] prefixes = {
+ "AIX", "HP-UX", "Irix", "Linux", "Mac OS X", "Solaris", "SunOS",
"FreeBSD",
+ "OpenBSD", "NetBSD"
+ };
+ boolean isUnix = Arrays.stream(prefixes)
+ .anyMatch(prefix -> osName.regionMatches(true, 0, prefix, 0,
prefix.length()));
+ if (isUnix && filter == null && !(isMac &&
Review Comment:
Thank you for review, @viirya .
Since `Utils.scala` is in the `core` module, I thought I cannot use it here,
`commons/utils` module. I completely forgot `SparkSystemUtils`. I address your
comment.
--
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]