zachjsh commented on code in PR #16719:
URL: https://github.com/apache/druid/pull/16719#discussion_r1672822867


##########
server/src/main/java/org/apache/druid/server/coordinator/duty/KillUnusedSegments.java:
##########
@@ -75,14 +77,23 @@ public class KillUnusedSegments implements CoordinatorDuty
   private final Duration durationToRetain;
   private final boolean ignoreDurationToRetain;
   private final int maxSegmentsToKill;
+  private final Duration bufferPeriod;
 
   /**
    * Used to keep track of the last interval end time that was killed for each
    * datasource.
    */
   private final Map<String, DateTime> datasourceToLastKillIntervalEnd;
+
+  /**
+   * State that is maintained in the duty to determine if the duty needs to 
run or not.
+   */
   private DateTime lastKillTime;
-  private final Duration bufferPeriod;
+
+  /**
+   * Round-robin iterator of the datasources to kill. It's updated in every 
run by the duty.
+   */
+  private final RoundRobinIterator datasourceIterator;

Review Comment:
   Is this iterator thread safe? What protects this duty from only having one 
thread running at a given time?



-- 
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