kfaraz commented on code in PR #16291:
URL: https://github.com/apache/druid/pull/16291#discussion_r1666324039
##########
server/src/main/java/org/apache/druid/server/http/CoordinatorCompactionConfigsResource.java:
##########
@@ -119,6 +122,11 @@ public Response addOrUpdateCompactionConfig(
.getCompactionConfigs()
.stream()
.collect(Collectors.toMap(DataSourceCompactionConfig::getDataSource,
Function.identity()));
+ CompactionConfigValidationResult validationResult =
+ ClientCompactionRunnerInfo.validateCompactionConfig(newConfig,
current.getEngine());
+ if (!validationResult.isValid()) {
+ throw InvalidInput.exception("Compaction config not supported.
Reason[%s].", validationResult.getReason());
Review Comment:
Just throwing an exception here takes away control over the HTTP status code.
Do this instead:
```
return
ServletResourceUtils.buildErrorResponseFrom(InvalidInput.exception(...));
```
--
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]