RobertIndie commented on a change in pull request #14087:
URL: https://github.com/apache/pulsar/pull/14087#discussion_r800270052
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/BrokersBase.java
##########
@@ -235,31 +244,24 @@ public void
deleteDynamicConfiguration(@PathParam("configName") String configNam
* @param configValue
* : configuration value
*/
- private synchronized void persistDynamicConfiguration(String configName,
String configValue) {
- try {
- if (!BrokerService.validateDynamicConfiguration(configName,
configValue)) {
- throw new RestException(Status.PRECONDITION_FAILED, " Invalid
dynamic-config value");
- }
- if (BrokerService.isDynamicConfiguration(configName)) {
-
dynamicConfigurationResources().setDynamicConfigurationWithCreate(old -> {
- Map<String, String> configurationMap = old.isPresent() ?
old.get() : Maps.newHashMap();
- configurationMap.put(configName, configValue);
- return configurationMap;
- });
- LOG.info("[{}] Updated Service configuration {}/{}",
clientAppId(), configName, configValue);
- } else {
- if (LOG.isDebugEnabled()) {
- LOG.debug("[{}] Can't update non-dynamic configuration
{}/{}", clientAppId(), configName,
- configValue);
- }
- throw new RestException(Status.PRECONDITION_FAILED, " Can't
update non-dynamic configuration");
+ private synchronized CompletableFuture<Void>
persistDynamicConfiguration(String configName, String configValue) {
Review comment:
```suggestion
private synchronized CompletableFuture<Void>
persistDynamicConfigurationAsync(String configName, String configValue) {
```
--
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]