kfaraz commented on a change in pull request #12187:
URL: https://github.com/apache/druid/pull/12187#discussion_r790162086



##########
File path: 
server/src/main/java/org/apache/druid/server/coordinator/CoordinatorDynamicConfig.java
##########
@@ -315,7 +318,9 @@ public int getBalancerComputeThreads()
   @JsonProperty("killAllDataSources")
   public boolean isKillUnusedSegmentsInAllDataSources()
   {
-    return killUnusedSegmentsInAllDataSources;
+    return killUnusedSegmentsInAllDataSources != null
+           ? killUnusedSegmentsInAllDataSources
+           : specificDataSourcesToKillUnusedSegmentsIn.isEmpty();

Review comment:
       Can this be simplified as?
   
   ```suggestion
       return specificDataSourcesToKillUnusedSegmentsIn.isEmpty();
   ```
   
   The method returns true when
   - either `killUnusedSegmentsInAllDataSources = true` which implies that 
`specifiedDataSourcesToKillUnusedSegmentsIn` is empty, otherwise we would have 
thrown an exception
   - or `killUnusedSegmentsInAllDataSources = null` and 
`specifiedDataSourcesToKillUnusedSegmentsIn` is empty
   
   With these new defaults, maybe we don't even need `killAll` anymore?
   If `killList` is empty, we kill all
   Otherwise, we kill only the ones specified.
   Unless I am missing a case.




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