You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "danny0405 (via GitHub)" <gi...@apache.org> on 2023/06/28 02:43:37 UTC

[GitHub] [hudi] danny0405 commented on a diff in pull request #9065: [HUDI-6451]. Randomly obtain a path in HoodieMemoryConfig#getDefaultSpillableMapBasePath.

danny0405 commented on code in PR #9065:
URL: https://github.com/apache/hudi/pull/9065#discussion_r1244597833


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieMemoryConfig.java:
##########
@@ -140,7 +144,9 @@ private HoodieMemoryConfig() {
 
   public static String getDefaultSpillableMapBasePath() {
     String[] localDirs = FileIOUtils.getConfiguredLocalDirs();
-    return (localDirs != null && localDirs.length > 0) ? localDirs[0] : "/tmp/";
+    List<String> localDirLists = Arrays.asList(localDirs);
+    Collections.shuffle(localDirLists);
+    return !localDirLists.isEmpty() ? localDirLists.get(0) : "/tmp/";

Review Comment:
   Nice catch ~



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org