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

kfaraz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/master by this push:
     new 28b7b6a8ab1 Use ConcurrentLinkedDeque in SegmentBootstrapper (#18470)
28b7b6a8ab1 is described below

commit 28b7b6a8ab164e377ee86a6ffb727729d8de6784
Author: Virushade <[email protected]>
AuthorDate: Thu Sep 4 12:54:21 2025 +0800

    Use ConcurrentLinkedDeque in SegmentBootstrapper (#18470)
---
 .../apache/druid/server/coordination/SegmentCacheBootstrapper.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/server/src/main/java/org/apache/druid/server/coordination/SegmentCacheBootstrapper.java
 
b/server/src/main/java/org/apache/druid/server/coordination/SegmentCacheBootstrapper.java
index 42ac9fec70a..b58d0641cad 100644
--- 
a/server/src/main/java/org/apache/druid/server/coordination/SegmentCacheBootstrapper.java
+++ 
b/server/src/main/java/org/apache/druid/server/coordination/SegmentCacheBootstrapper.java
@@ -47,7 +47,7 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
-import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
@@ -198,7 +198,7 @@ public class SegmentCacheBootstrapper
       final int numSegments = segmentsOnStartup.size();
       final CountDownLatch latch = new CountDownLatch(numSegments);
       final AtomicInteger counter = new AtomicInteger(0);
-      final CopyOnWriteArrayList<DataSegment> failedSegments = new 
CopyOnWriteArrayList<>();
+      final ConcurrentLinkedQueue<DataSegment> failedSegments = new 
ConcurrentLinkedQueue<>();
       for (final DataSegment segment : segmentsOnStartup) {
         bootstrapExecutor.submit(
             () -> {
@@ -239,7 +239,7 @@ public class SegmentCacheBootstrapper
       try {
         latch.await();
 
-        if (failedSegments.size() > 0) {
+        if (!failedSegments.isEmpty()) {
           log.makeAlert("[%,d] errors seen while loading segments on startup", 
failedSegments.size())
              .addData("failedSegments", failedSegments)
              .emit();


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to