pjmcarthur commented on code in PR #2126:
URL: https://github.com/apache/solr/pull/2126#discussion_r1449148959


##########
solr/core/src/java/org/apache/solr/core/SolrXmlConfig.java:
##########
@@ -651,6 +651,27 @@ private static PluginInfo[] 
getBackupRepositoryPluginInfos(List<ConfigNode> cfg)
     return configs;
   }
 
+  private static PluginInfo[] getClusterPlugins(SolrResourceLoader loader, 
ConfigNode root) {
+    List<PluginInfo> clusterPlugins = new ArrayList<>();
+
+    Collections.addAll(
+        clusterPlugins, getClusterSingletonPluginInfos(loader, 
root.getAll("clusterSingleton")));
+
+    PluginInfo replicaPlacementFactory = 
getPluginInfo(root.get("replicaPlacementFactory"));
+    if (replicaPlacementFactory != null) {
+      if (replicaPlacementFactory.name != null
+          && 
!replicaPlacementFactory.name.equals(PlacementPluginFactory.PLUGIN_NAME)) {
+        throw new SolrException(
+            SolrException.ErrorCode.SERVER_ERROR,
+            "The replicaPlacementFactory name attribute must be "
+                + PlacementPluginFactory.PLUGIN_NAME);
+      }
+      clusterPlugins.add(replicaPlacementFactory);
+    }
+
+    return clusterPlugins.toArray(new PluginInfo[0]);

Review Comment:
   The interface to NodeConfig and its Builder uses native arrays, at least for 
the existing backupRepository plugins. I think if we return a list here, we 
would immediately have to convert it back to an array anyway, unless we change 
the Builder. I would rather not do that in this PR. 



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