AmatyaAvadhanula commented on code in PR #16803:
URL: https://github.com/apache/druid/pull/16803#discussion_r1692884672


##########
server/src/main/java/org/apache/druid/server/http/CoordinatorCompactionConfigsResource.java:
##########
@@ -86,11 +87,46 @@ public CoordinatorCompactionConfigsResource(
 
   @GET
   @Produces(MediaType.APPLICATION_JSON)
-  public Response getCompactionConfig()
+  public Response getClusterCompactionConfig()
   {
     return Response.ok(configManager.getCurrentCompactionConfig()).build();
   }
 
+  @POST
+  @Path("/global")
+  @Consumes(MediaType.APPLICATION_JSON)
+  public Response updateClusterCompactionConfig(
+      CompactionConfigUpdateRequest updatePayload,
+      @Context HttpServletRequest req
+  )
+  {
+    UnaryOperator<CoordinatorCompactionConfig> operator = current -> {
+      final CoordinatorCompactionConfig newConfig = 
CoordinatorCompactionConfig.from(current, updatePayload);
+
+      final List<DataSourceCompactionConfig> datasourceConfigs = 
newConfig.getCompactionConfigs();
+      if (CollectionUtils.isNullOrEmpty(datasourceConfigs)
+          || current.getEngine() == newConfig.getEngine()) {

Review Comment:
   Is it possible for the payload to contain the current engine but 
incompatible configs?
   For example the current engine is MSQ, and the update payload is also MSQ 
but with Native-only configs.



-- 
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]

Reply via email to