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


##########
server/src/main/java/org/apache/druid/server/coordinator/duty/KillUnusedSegments.java:
##########
@@ -63,25 +67,32 @@ public class KillUnusedSegments implements CoordinatorDuty
                 && (KILL_TASK_TYPE.equals(status.getType()) && 
status.getId().startsWith(TASK_ID_PREFIX));
   private static final Logger log = new Logger(KillUnusedSegments.class);
 
-  private final long period;
+  @Nullable private final Long period;
   private final long retainDuration;
   private final boolean ignoreRetainDuration;
   private final int maxSegmentsToKill;
+
+  /**
+   * Used to keep track of the last interval end time that was killed for each
+   * datasource.
+   */
+  private final Map<String, DateTime> datasourceToLastKillIntervalEnd;
   private long lastKillTime = 0;
 
   private final SegmentsMetadataManager segmentsMetadataManager;
   private final OverlordClient overlordClient;
 
   @Inject
+  @JsonCreator
   public KillUnusedSegments(
-      SegmentsMetadataManager segmentsMetadataManager,
-      OverlordClient overlordClient,
-      DruidCoordinatorConfig config
+      @JacksonInject SegmentsMetadataManager segmentsMetadataManager,
+      @JacksonInject OverlordClient overlordClient,
+      @JacksonInject DruidCoordinatorConfig config
   )
   {
-    this.period = config.getCoordinatorKillPeriod().getMillis();
+    this.period = null != config.getCoordinatorKillPeriod() ? 
config.getCoordinatorKillPeriod().getMillis() : null;
     Preconditions.checkArgument(
-        this.period > config.getCoordinatorIndexingPeriod().getMillis(),
+        null == this.period || this.period > 
config.getCoordinatorIndexingPeriod().getMillis(),

Review Comment:
   now checking against the dutyPeriod which is not always the same as indexing 
period. Think this needs to be done here, consequently.



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