YongGang commented on code in PR #16510:
URL: https://github.com/apache/druid/pull/16510#discussion_r1624742790


##########
extensions-contrib/kubernetes-overlord-extensions/src/main/java/org/apache/druid/k8s/overlord/taskadapter/PodTemplateTaskAdapter.java:
##########
@@ -126,7 +132,19 @@ public PodTemplateTaskAdapter(
   @Override
   public Job fromTask(Task task) throws IOException
   {
-    PodTemplate podTemplate = templates.getOrDefault(task.getType(), 
templates.get("base"));
+    ExecutionBehaviorStrategy behaviorStrategy;
+    ExecutionConfig executionConfig = executionConfigRef.get();
+    if (executionConfig == null || executionConfig.getBehaviorStrategy() == 
null) {
+      behaviorStrategy = ExecutionConfig.DEFAULT_STRATEGY;
+    } else {
+      behaviorStrategy = executionConfig.getBehaviorStrategy();
+    }
+    String category = behaviorStrategy.getTaskCategory(task);
+    PodTemplate podTemplate = templates.getOrDefault(
+        category != null ? category : task.getType(),

Review Comment:
   My thinking is when switching to use the new 
`DynamicTaskExecutionBehaviorStrategy` config, we need to ensure that any 
existing configs related to task type templates mapping are also considered. 
Sometimes, these mappings can be overlooked. Therefore, the new strategy should 
still default to the existing behavior when no category is found, thus 
facilitating a smoother transition to the new configuration.



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