leventov commented on a change in pull request #7088: Improve parallelism of 
zookeeper based segment change processing
URL: https://github.com/apache/incubator-druid/pull/7088#discussion_r279830477
 
 

 ##########
 File path: 
server/src/main/java/org/apache/druid/server/coordinator/CuratorLoadQueuePeon.java
 ##########
 @@ -152,29 +176,18 @@ public int getNumberOfSegmentsInQueue()
   @Override
   public void loadSegment(final DataSegment segment, final LoadPeonCallback 
callback)
   {
-    synchronized (lock) {
-      if ((currentlyProcessing != null) &&
-          currentlyProcessing.getSegmentId().equals(segment.getId())) {
-        if (callback != null) {
-          currentlyProcessing.addCallback(callback);
-        }
-        return;
-      }
-    }
+    SegmentHolder segmentHolder = new SegmentHolder(segment, LOAD, 
Collections.singletonList(callback));
 
 Review comment:
   The question is if the downstream code prepared to see nulls in this list? 
Even if it does, it would be better if it didn't and it was a guarantee that 
the list never contains nulls. It's less error-prone.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to