ramabme commented on a change in pull request #7300:
URL: https://github.com/apache/pinot/pull/7300#discussion_r688959582



##########
File path: 
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/minion/PinotHelixTaskResourceManager.java
##########
@@ -381,6 +377,74 @@ public synchronized TaskState getTaskState(String 
taskName) {
     return filteredTaskStateMap;
   }
 
+  /**
+   * Given a taskType, helper method to debug all the HelixJobs for the 
taskType.
+   * For each of the HelixJobs, collects status of the (sub)tasks in the 
taskbatch.
+   *
+   * @param taskType      Pinot taskType / Helix JobQueue
+   * @param verboseLevel  By default, does not show details for completed 
tasks.
+   *                      If verboseLevel >= 10, shows details for all tasks.
+   * @return Map of Pinot Task Name to TaskDebugInfo. TaskDebugInfo contains 
details for subtasks.
+   */
+  public synchronized Map<String, TaskDebugInfo> getTaskDebugInfo(String 
taskType, int verboseLevel) {
+    Map<String, TaskDebugInfo> taskDebugInfos = new HashMap<>();
+    WorkflowContext workflowContext = 
_taskDriver.getWorkflowContext(getHelixJobQueueName(taskType));
+    if (workflowContext == null) {
+      return taskDebugInfos;
+    }
+    boolean showCompleted = verboseLevel >= 10;
+    long timeMillis;
+    SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd 
HH:mm:ss z", Locale.getDefault());
+    SIMPLE_DATE_FORMAT.setTimeZone(TimeZone.getDefault());
+    Map<String, TaskState> helixJobStates = workflowContext.getJobStates();
+    for (String helixJobName : helixJobStates.keySet()) {

Review comment:
       cleaned




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