ccaominh commented on a change in pull request #8304: Add group_id to the 
sys.tasks table
URL: https://github.com/apache/incubator-druid/pull/8304#discussion_r316332146
 
 

 ##########
 File path: 
indexing-service/src/test/java/org/apache/druid/indexing/common/task/batch/parallel/AbstractParallelIndexSupervisorTaskTest.java
 ##########
 @@ -158,6 +166,8 @@ public String runTask(Object taskObject)
     public TaskStatusResponse getTaskStatus(String taskId)
     {
       final Future<TaskStatus> taskStatusFuture = tasks.get(taskId);
+      final Optional<Task> task = getTaskStorage().getTask(taskId);
+      final String groupId = task.isPresent() ? task.orNull().getGroupId() : 
taskId;
 
 Review comment:
   The `orNull()` is misleading since it would allow the subsequent call to 
`getGroupId()` to throw an `NPE`. Change to `task.get().getGroupId()`, which is 
also consistent with the preceding `task.isPresent()`.
   
   Also, a comment explaining why the `groupId` should default to the `taskId` 
the caller specified would work well 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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to