xiangfu0 commented on code in PR #8465:
URL: https://github.com/apache/pinot/pull/8465#discussion_r843346735


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/PinotTaskManager.java:
##########
@@ -128,6 +132,53 @@ public PinotTaskManager(PinotHelixTaskResourceManager 
helixTaskResourceManager,
     }
   }
 
+  public String createTask(Map<String, String> taskConfigs)
+      throws Exception {
+    String taskName = taskConfigs.get("taskName");
+    if (taskName == null) {
+      throw new IllegalArgumentException("Missing field 'taskName'");
+    }
+    String taskType = taskConfigs.get("taskType");
+    if (taskType == null) {
+      throw new IllegalArgumentException("Missing field 'taskType'");
+    }
+    String tableName = taskConfigs.get("tableName");
+    if (tableName == null) {
+      throw new IllegalArgumentException("Missing field 'tableName'");
+    }
+    String parentTaskName = 
_helixTaskResourceManager.getParentTaskName(taskType, taskName);
+    TaskState taskState = 
_helixTaskResourceManager.getTaskState(parentTaskName);
+    if (taskState != null) {
+      throw new RuntimeException(
+          "Task [" + taskName + "] of type [" + taskType + "] is already 
created. Current state is " + taskState);
+    }
+    if (TableNameBuilder.isRealtimeTableResource(tableName)) {

Review Comment:
   make sense, will support offline/realtime/hybrid here.



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to