gianm commented on code in PR #20825:
URL: https://github.com/apache/druid/pull/20825#discussion_r4472809272
##########
multi-stage-query/src/main/java/org/apache/druid/msq/dart/worker/http/DartWorkerResource.java:
##########
@@ -120,19 +123,32 @@ public Response httpPostWorkOrder(
)
{
MSQResourceUtils.authorizeAdminRequest(permissionMapper, authorizerMapper,
req);
- final String controllerHost = req.getHeader(HEADER_CONTROLLER_HOST);
- if (controllerHost == null) {
- throw DruidException.forPersona(DruidException.Persona.DEVELOPER)
- .ofCategory(DruidException.Category.INVALID_INPUT)
- .build("Missing controllerId[%s]",
HEADER_CONTROLLER_HOST);
- }
-
- workerRunner.startWorker(queryId, controllerHost,
workOrder.getWorkerContext())
+ workerRunner.startWorker(queryId, getControllerHost(req),
workOrder.getWorkerContext())
.postWorkOrder(workOrder);
return Response.status(Response.Status.ACCEPTED).build();
}
+ /**
+ * Process a {@link SyncWorkersRequest} from {@link DartWorkerSyncer}.
+ */
+ @POST
+ @Consumes({MediaType.APPLICATION_JSON,
SmileMediaTypes.APPLICATION_JACKSON_SMILE})
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("/sync")
+ public SyncWorkersResponse httpPostSync(
+ final SyncWorkersRequest request,
+ @Context final HttpServletRequest req
+ )
+ {
+ MSQResourceUtils.authorizeAdminRequest(permissionMapper, authorizerMapper,
req);
+ if (request == null) {
Review Comment:
Fixed the test, thanks.
--
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]