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


##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTaskRestletResource.java:
##########
@@ -190,9 +200,20 @@ public Set<String> listTaskTypes() {
   @Produces(MediaType.APPLICATION_JSON)
   @ApiOperation("Get summary of all tasks across all task types, grouped by 
tenant. "
       + "Optionally filter by server tenant name to get tasks for a specific 
tenant only.")
-  public PinotHelixTaskResourceManager.TaskSummaryResponse getTasksSummary(
+  @ManagedAsync
+  public void getTasksSummary(
       @ApiParam(value = "Server tenant name to filter tasks. If not specified, 
returns all tenants grouped.")
-      @QueryParam("tenant") @Nullable String tenantName) {
+      @QueryParam("tenant") @Nullable String tenantName,
+      @Suspended AsyncResponse asyncResponse) {
+    try {
+      PinotHelixTaskResourceManager.TaskSummaryResponse response = 
getTasksSummarySync(tenantName);
+      asyncResponse.resume(response);
+    } catch (Exception e) {
+      asyncResponse.resume(e);
+    }
+  }
+
+  private PinotHelixTaskResourceManager.TaskSummaryResponse 
getTasksSummarySync(@Nullable String tenantName) {

Review Comment:
   (minor) Inline this. Same for other small sync calls



##########
pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTaskRestletResource.java:
##########
@@ -180,7 +180,17 @@ public class PinotTaskRestletResource {
   @Authorize(targetType = TargetType.CLUSTER, action = 
Actions.Cluster.GET_TASK)
   @Produces(MediaType.APPLICATION_JSON)
   @ApiOperation("List all task types")
-  public Set<String> listTaskTypes() {
+  @ManagedAsync
+  public void listTaskTypes(@Suspended AsyncResponse asyncResponse) {
+    try {
+      Set<String> taskTypes = listTaskTypesSync();
+      asyncResponse.resume(taskTypes);
+    } catch (Exception e) {
+      asyncResponse.resume(e);
+    }
+  }
+
+  private Set<String> listTaskTypesSync() {

Review Comment:
   (minor) Inline this



##########
pinot-common/src/main/java/org/apache/pinot/common/metrics/ControllerGauge.java:
##########
@@ -221,7 +221,8 @@ public enum ControllerGauge implements 
AbstractMetrics.Gauge {
   // The progress of a certain table rebalance job of a table
   TABLE_REBALANCE_JOB_PROGRESS_PERCENT("percent", false),
   // HTTP thread utilization
-  HTTP_THREAD_UTILIZATION("httpThreadUtilization", true);
+  HTTP_THREAD_UTILIZATION("httpThreadUtilization", true),
+  MANAGED_ASYNC_ACTIVE_THREADS("threads", true);

Review Comment:
   (minor) Add comment for the intention of this gauge



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