This is an automated email from the ASF dual-hosted git repository.

jlli pushed a commit to branch stop-all-segments-in-releaseAndRemoveAllSegments
in repository https://gitbox.apache.org/repos/asf/pinot.git

commit cb5a82080f6ae909311ce5dcc12c2298e060084d
Author: jlli_LinkedIn <j...@linkedin.com>
AuthorDate: Sun Jan 21 16:18:12 2024 -0800

    Release all segments of a table in releaseAndRemoveAllSegments method
---
 .../org/apache/pinot/core/data/manager/BaseTableDataManager.java     | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java
 
b/pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java
index 119bede805..d5248dc71b 100644
--- 
a/pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java
+++ 
b/pinot-core/src/main/java/org/apache/pinot/core/data/manager/BaseTableDataManager.java
@@ -33,6 +33,7 @@ import java.util.Map;
 import java.util.UUID;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -223,9 +224,11 @@ public abstract class BaseTableDataManager implements 
TableDataManager {
       segmentDataManagers = new ArrayList<>(_segmentDataManagerMap.values());
       _segmentDataManagerMap.clear();
     }
+    ExecutorService stopExecutorService = 
Executors.newFixedThreadPool(segmentDataManagers.size());
     for (SegmentDataManager segmentDataManager : segmentDataManagers) {
-      releaseSegment(segmentDataManager);
+      stopExecutorService.submit(() -> releaseSegment(segmentDataManager));
     }
+    stopExecutorService.shutdown();
   }
 
   @Override


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to