AmatyaAvadhanula commented on code in PR #15699:
URL: https://github.com/apache/druid/pull/15699#discussion_r1460228486


##########
indexing-service/src/main/java/org/apache/druid/indexing/common/actions/RetrieveUsedSegmentsAction.java:
##########
@@ -113,11 +139,84 @@ public TypeReference<Collection<DataSegment>> 
getReturnTypeReference()
 
   @Override
   public Collection<DataSegment> perform(Task task, TaskActionToolbox toolbox)
+  {
+    if (!replace) {

Review Comment:
   I think the current structure makes it more readable as it is obvious that 
we are using the old logic whenever possible before trying to filter the locks.
   
   ```
   
   if (datasourceToReplace != datasourceToRead) {
     return retrieveUsedSegments();
   }
   
   Set<ReplaceLock> replaceLocks = fetchReplaceLocksForTask();
   
   if (replaceLocks.isEmpty()) {
     return retrieveUsedSegments()
   } 
   
   return retrieveUsedSegmentsCreatedBeforeReplaceVersions(replaceLocks);
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to