uds5501 commented on code in PR #18466:
URL: https://github.com/apache/druid/pull/18466#discussion_r2371700871
##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java:
##########
@@ -1717,6 +1749,135 @@ public Response getUnparseableEvents(
return
Response.ok(parseExceptionHandler.getSavedParseExceptionReports()).build();
}
+ @POST
+ @Path("/updateConfig")
+ @Consumes(MediaType.APPLICATION_JSON)
+ @Produces(MediaType.APPLICATION_JSON)
+ public Response updateConfig(TaskConfigUpdateRequest request, @Context final
HttpServletRequest req)
+ throws InterruptedException
+ {
+ authorizationCheck(req);
+ if (!waitForConfigUpdate.get()) {
+ return Response.status(409).entity("Task must be paused for checkpoint
completion before updating config").build();
+ }
+ try {
+ log.info("Attempting to update config to [%s]", request.getIoConfig());
+
+ SeekableStreamIndexTaskIOConfig<PartitionIdType, SequenceOffsetType>
newIoConfig = (SeekableStreamIndexTaskIOConfig<PartitionIdType,
SequenceOffsetType>)
+ toolbox.getJsonMapper().convertValue(request.getIoConfig(),
SeekableStreamIndexTaskIOConfig.class);
+ setIOConfig(newIoConfig);
+ createNewSequenceFromIoConfig(newIoConfig);
+
+ assignment = assignPartitions(recordSupplier);
+ boolean shouldResume = true;
+ if (!assignment.isEmpty()) {
+ possiblyResetDataSourceMetadata(toolbox, recordSupplier, assignment);
+ seekToStartingSequence(recordSupplier, assignment);
+ } else {
+ // if there is no assignment, It means that there was no partition
assigned to this task after scaling down.
+ pause();
Review Comment:
It would be, fair enough
--
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]