clintropolis commented on a change in pull request #6272: Add
suspend|resume|terminate all supervisors endpoints.
URL: https://github.com/apache/incubator-druid/pull/6272#discussion_r219357642
##########
File path:
indexing-service/src/main/java/org/apache/druid/indexing/overlord/supervisor/SupervisorResource.java
##########
@@ -398,4 +431,31 @@ private Response specSuspendOrResume(final String id,
boolean suspend)
}
);
}
+
+ private Response specSuspendAllOrResumeAll(boolean suspend)
+ {
+ return asLeaderWithSupervisorManager(
+ manager -> {
+ Set<String> supervisorIds = manager.getSupervisorIds();
+ List<String> successes = new ArrayList<>();
+ List<String> errors = new ArrayList<>();
+
+ supervisorIds.forEach(id -> {
+ Optional<SupervisorSpec> spec = manager.getSupervisorSpec(id);
+ if (spec.get().isSuspended() == suspend) {
+ errors.add(id);
+ } else {
+ manager.suspendOrResumeSupervisor(id, suspend);
+ successes.add(id);
+ }
+ });
+ return Response.ok(ImmutableMap.of(
Review comment:
I think it would probably be nice to have a consistent response between
these 3 api methods, in the case of suspending/resuming all i think only the
supervisors which changed state are interesting, since a supervisor already
being in the requested state isn't really an error
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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]