sigram commented on a change in pull request #1758:
URL: https://github.com/apache/lucene-solr/pull/1758#discussion_r494131970



##########
File path: solr/core/src/java/org/apache/solr/core/CoreContainer.java
##########
@@ -889,7 +896,37 @@ public void load() {
       ContainerPluginsApi containerPluginsApi = new ContainerPluginsApi(this);
       
containerHandlers.getApiBag().registerObject(containerPluginsApi.readAPI);
       
containerHandlers.getApiBag().registerObject(containerPluginsApi.editAPI);
+
+      // create the ClusterEventProducer
+      CustomContainerPlugins.ApiInfo clusterEventProducerInfo = 
customContainerPlugins.getPlugin(ClusterEventProducer.PLUGIN_NAME);
+      if (clusterEventProducerInfo != null) {
+        clusterEventProducer = (ClusterEventProducer) 
clusterEventProducerInfo.getInstance();
+      } else {
+        clusterEventProducer = new ClusterEventProducerImpl(this);
+      }
+      // init ClusterSingleton-s
+      Map<String, ClusterSingleton> singletons = new ConcurrentHashMap<>();
+      if (clusterEventProducer instanceof ClusterSingleton) {
+        singletons.put(ClusterEventProducer.PLUGIN_NAME, (ClusterSingleton) 
clusterEventProducer);
+      }
+
+      // register ClusterSingleton handlers
+      // XXX register also other ClusterSingleton-s from packages - how?
+      containerHandlers.keySet().forEach(handlerName -> {

Review comment:
       The purpose of this code is to build a registry of existing 
`ClusterSingleton` implementations (perhaps this should go to a dedicated 
registry class). We don't have a dependency injection framework, so we need to 
somewhere perform the discovery and registration ourselves.
   And we need a registry in order to manage the `ClusterSingleton` lifecycle 
together with the Overseer leader life-cycle.

##########
File path: 
solr/core/src/java/org/apache/solr/handler/admin/ContainerPluginsApi.java
##########
@@ -64,15 +64,15 @@ public ContainerPluginsApi(CoreContainer coreContainer) {
 
   public class Read {
     @EndPoint(method = METHOD.GET,
-        path = "/cluster/plugin",
+        path = "/cluster/plugins",

Review comment:
       Right, but this is for 9.0 so we can break back-compat if it's justified 
- and I think it is because the singular name here doesn't make sense, as it is 
a location where multiple plugin configurations are defined.
   
   In any case we can provide a back-compat shim for 9.0 to also accept 
`plugin` singular.

##########
File path: 
solr/core/src/java/org/apache/solr/handler/admin/ContainerPluginsApi.java
##########
@@ -64,15 +64,15 @@ public ContainerPluginsApi(CoreContainer coreContainer) {
 
   public class Read {
     @EndPoint(method = METHOD.GET,
-        path = "/cluster/plugin",
+        path = "/cluster/plugins",
         permission = PermissionNameProvider.Name.COLL_READ_PERM)
     public void list(SolrQueryRequest req, SolrQueryResponse rsp) throws 
IOException {
-      rsp.add(PLUGIN, plugins(zkClientSupplier));
+      rsp.add(PLUGINS, plugins(zkClientSupplier));

Review comment:
       See above.




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