You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by GitBox <gi...@apache.org> on 2022/07/26 08:34:14 UTC

[GitHub] [incubator-uniffle] frankliee commented on a diff in pull request #72: [Improvement]LocalStorage init use multi thread #71

frankliee commented on code in PR #72:
URL: https://github.com/apache/incubator-uniffle/pull/72#discussion_r929681750


##########
server/src/main/java/org/apache/uniffle/server/storage/LocalStorageManager.java:
##########
@@ -63,18 +65,43 @@ public class LocalStorageManager extends SingleStorageManager {
     if (highWaterMarkOfWrite < lowWaterMarkOfWrite) {
       throw new IllegalArgumentException("highWaterMarkOfWrite must be larger than lowWaterMarkOfWrite");
     }
+
+    CountDownLatch countDownLatch = new CountDownLatch(storageBasePaths.length);
+    AtomicInteger successCount = new AtomicInteger();
     for (String storagePath : storageBasePaths) {
-      localStorages.add(LocalStorage.newBuilder()
-          .basePath(storagePath)
-          .capacity(capacity)
-          .lowWaterMarkOfWrite(lowWaterMarkOfWrite)
-          .highWaterMarkOfWrite(highWaterMarkOfWrite)
-          .shuffleExpiredTimeoutMs(shuffleExpiredTimeoutMs)
-          .build());
+      new Thread(() -> {
+        try {

Review Comment:
   I prefer to leverage more graceful `parallelStream`



-- 
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: issues-unsubscribe@uniffle.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org