nozjkoitop commented on code in PR #16889:
URL: https://github.com/apache/druid/pull/16889#discussion_r1775013447


##########
indexing-service/src/main/java/org/apache/druid/indexing/overlord/config/WorkerTaskRunnerConfig.java:
##########
@@ -48,4 +57,46 @@ public double getParallelIndexTaskSlotRatio()
   {
     return parallelIndexTaskSlotRatio;
   }
+
+  /**
+   * The `taskSlotLimits` configuration is a map where each key is a task type,
+   * and the corresponding value represents the limit on the number of task 
slots
+   * that a task of that type can occupy on a worker.
+   * <p>
+   * The key is a `String` that specifies the task type.
+   * The value can either be a Double or Integer:
+   * <p>
+   * 1. A `Double` in the range [0, 1], representing a ratio of the available 
task slots
+   * that tasks of this type can occupy. For example, a value of 0.5 means 
that tasks
+   * of this type can occupy up to 50% of the task slots on a worker.
+   * A value of 0 means that tasks of this type can occupy no slots (i.e., 
they are effectively disabled).
+   * A value of 1.0 means no restriction, allowing tasks of this type to 
occupy all available slots.
+   * <p>
+   * 2. An `Integer` that is greater than or equal to 0, representing an 
absolute limit
+   * on the number of task slots that tasks of this type can occupy. For 
example, a value of 5
+   * means that tasks of this type can occupy up to 5 task slots on a worker.
+   * <p>
+   * If a task type is not present in the `taskSlotLimits` map, there is no 
restriction
+   * on the number of task slots it can occupy, meaning it can use all 
available slots.
+   * <p>
+   * Example:
+   * <p>
+   * taskSlotLimits = {
+   * "index_parallel": 0.5,  // 'index_parallel' can occupy up to 50% of task 
slots
+   * "query_controller": 3     // 'query_controller' can occupy up to 3 task 
slots
+   * }
+   * <p>
+   * This configuration allows for granular control over the allocation of 
task slots
+   * based on the specific needs of different task types, helping to prevent 
any one type
+   * of task from monopolizing worker resources and reducing the risk of 
deadlocks.
+   *
+   * @return A map where the key is the task type (`String`), and the value is 
either a `Double` (0 to 1)
+   * representing the ratio of task slots available for that type, or an 
`Integer` (>= 0)
+   * representing the absolute limit of task slots for that type. If a task 
type is absent,
+   * it is not limited in terms of the number of task slots it can occupy.
+   */

Review Comment:
   Split that into two blocks, one for each getter and simplified



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