noblepaul commented on a change in pull request #1813:
URL: https://github.com/apache/lucene-solr/pull/1813#discussion_r484682298



##########
File path: solr/core/src/java/org/apache/solr/cloud/api/collections/Assign.java
##########
@@ -551,11 +555,29 @@ public AssignStrategyFactory(SolrCloudManager 
solrCloudManager) {
       this.solrCloudManager = solrCloudManager;
     }
 
+    @SuppressWarnings("unchecked")
     public AssignStrategy create(ClusterState clusterState, CloudConfig 
cloudConfig, DocCollection collection) throws IOException, InterruptedException 
{
       @SuppressWarnings({"unchecked", "rawtypes"})
       List<Map> ruleMaps = (List<Map>) collection.get("rule");
       @SuppressWarnings({"rawtypes"})
       List snitches = (List) collection.get(SNITCH);
+      Map<String, Object> props = 
solrCloudManager.getClusterStateProvider().getClusterProperties();
+      Map<String,Object> assignInfo = (Map<String, Object>) 
props.get("assign-strategy");

Review comment:
       We already have an endpoint called  `/api/cluster/plugin`  GET/POST
   
   Please refer to 
[SOLR-14404](https://issues.apache.org/jira/browse/SOLR-14404) for details
   
   it can look as follows
   
   ```
   curl -X POST -H 'Content-type:application/json' --data-binary '
   {
     "set-assign-strategy": {
     "class": "full.ClassName", 
     "key1" : "val1"
     }
   }' http://localhost:8983/api/cluster/plugins
   ```
   ```
   curl -X POST -H 'Content-type:application/json' --data-binary '
   {
     "set-assign-strategy":  null
   }' http://localhost:8983/api/cluster/plugins
   ```
   You may add your code 
[here](https://github.com/apache/lucene-solr/blob/f7cbde2ad85b656b7c7ac16acaafb05481fa75ba/solr/core/src/java/org/apache/solr/handler/admin/ContainerPluginsApi.java#L77)
   
   




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