atris commented on a change in pull request #1906:
URL: https://github.com/apache/lucene-solr/pull/1906#discussion_r493207484



##########
File path: solr/core/src/java/org/apache/solr/handler/ClusterAPI.java
##########
@@ -171,10 +172,30 @@ public void setPlacementPlugin(PayloadObj<Map<String, 
Object>> obj) {
         // Need to reset to null first otherwise the mappings in 
placementPluginConfig are added to existing ones
         // in /clusterprops.json rather than replacing them. If removing the 
config, that's all we do.
         clusterProperties.setClusterProperties(
-                
Collections.singletonMap(PlacementPluginConfigImpl.PLACEMENT_PLUGIN_CONFIG_KEY, 
null));
+            
Collections.singletonMap(PlacementPluginConfigImpl.PLACEMENT_PLUGIN_CONFIG_KEY, 
null));
+        if (!unset) {
+          clusterProperties.setClusterProperties(
+              
Collections.singletonMap(PlacementPluginConfigImpl.PLACEMENT_PLUGIN_CONFIG_KEY, 
placementPluginConfig));
+        }
+
+      } catch (Exception e) {
+        throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "Error 
in API", e);
+      }
+    }
+
+    @Command(name = "set-ratelimiters")
+    public void setRateLimiters(PayloadObj<Map<String, Object>> obj) {
+      Map<String, Object> rateLimiterConfig = obj.getDataMap();
+      final boolean unset = rateLimiterConfig.isEmpty();

Review comment:
       I actually prefer {}, seems cleaner




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to