You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/04/08 18:31:33 UTC

[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #8465: Add adhoc minion task creation endpoint

Jackie-Jiang commented on code in PR #8465:
URL: https://github.com/apache/pinot/pull/8465#discussion_r846383207


##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTaskRestletResource.java:
##########
@@ -346,6 +347,29 @@ public StringResultResponse getTaskStateDeprecated(
     }
   }
 
+  @GET
+  @Path("/tasks/all")
+  @Authenticate(AccessType.READ)
+  @ApiOperation("Read all tasks status")
+  public Map<String, TaskState> getAllTasks() {
+    Map<String, TaskState> taskStates = new HashMap<>();
+    _pinotHelixTaskResourceManager.getTaskTypes()
+        .forEach(taskType -> taskStates.putAll(_pinotHelixTaskResourceManager.getTaskStates(taskType)));
+    return taskStates;
+  }
+
+  @POST
+  @Path("/tasks/create")
+  @Authenticate(AccessType.CREATE)

Review Comment:
   I'd suggest adding a JSON serializable wrapper class to wrap all the arguments and the config map. See `Instance` as an example. The API can be as simple as `POST /tasks/execute`



-- 
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-unsubscribe@pinot.apache.org

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


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