suneet-s commented on code in PR #16310:
URL: https://github.com/apache/druid/pull/16310#discussion_r1598772843
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:
##########
@@ -203,6 +203,8 @@ public class TaskGroup
final String baseSequenceName;
DateTime completionTimeout; // is set after signalTasksToFinish(); if not
done by timeout, take corrective action
+ Boolean shutdownEarly = false; // set by
SupervisorManager.stopTaskGroupEarly
Review Comment:
```suggestion
boolean shutdownEarly = false; // set by
SupervisorManager.stopTaskGroupEarly
```
^ easier if this is a primitive, then we don't need to think about handling
the null state
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java:
##########
@@ -657,6 +669,39 @@ public String getType()
}
}
+ private class HandoffTaskGroupsNotice implements Notice
+ {
+ final List<Integer> taskGroupIds;
+ private static final String TYPE = "handoff_task_group_notice";
+
+ HandoffTaskGroupsNotice(
+ @Nonnull final List<Integer> taskGroupIds
+ )
+ {
+ this.taskGroupIds = taskGroupIds;
+ }
+
+ @Override
+ public void handle()
+ {
+ for (Integer taskGroupId : taskGroupIds) {
+ TaskGroup taskGroup =
activelyReadingTaskGroups.getOrDefault(taskGroupId, null);
+ if (taskGroup == null) {
+ log.info("Tried to stop task group that wasn't actively reading.");
Review Comment:
```suggestion
log.info("Tried to stop task group [%d] that wasn't actively
reading.", taskGroupId);
```
##########
docs/api-reference/supervisor-api.md:
##########
@@ -3550,6 +3550,61 @@ Host: http://ROUTER_IP:ROUTER_PORT
```
</details>
+### Handoff task groups for a supervisor early
+
+Trigger handoff for specified task groups of a supervisor early. This is a
best effort API and makes no guarantees of handoff execution
+
+#### URL
+
+`POST` `/druid/indexer/v1/supervisor/{supervisorId}/taskGroups/handoff`
+
+#### Sample request
+
+The following example shows how to handoff task groups for a Kafka supervisor
with the name `social_media` and has the task groups: `1,2,3`.
+
+<Tabs>
+
+<TabItem value="3" label="cURL">
+
+
+```shell
+curl --request POST
"http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/supervisor/social_media/taskGroups/handoff"
+--header 'Content-Type: application/json'
+--data-raw '["1", "2", "3"]'
Review Comment:
```suggestion
--data-raw '{"taskGroupIds": [1, 2, 3]}'
```
I think this is the expected format for a REST API. Also it looks like
taskGroupIds are integers, so I don't think quotes are needed around the numbers
--
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]