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


##########
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:
   Good point, the implementation is not thread safe. I've added the 
`@NotThreadSafe` annotation to this class.
   
   Also, related comment: 
https://github.com/apache/druid/pull/16719#discussion_r1673243028



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