noblepaul commented on a change in pull request #1758: URL: https://github.com/apache/lucene-solr/pull/1758#discussion_r493975213
########## File path: solr/core/src/java/org/apache/solr/api/CustomContainerPlugins.java ########## @@ -78,6 +79,10 @@ public void writeMap(EntryWriter ew) throws IOException { currentPlugins.forEach(ew.getBiConsumer()); } + public synchronized ApiInfo getPlugin(String name) { Review comment: why is this synchronized ? ########## 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: what are you trying to do here? I'm totally confused about - What are the objects you are registering - where they are registered? - what is the purpose? ########## 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: you know this is a backward incompatible change , right? ########## 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: this too is backward incompatible ########## File path: solr/core/src/java/org/apache/solr/packagemanager/PackageManager.java ########## @@ -231,7 +232,7 @@ public void uninstall(String packageName, String version) { } } @SuppressWarnings({"unchecked"}) - Map<String, Object> clusterPlugins = (Map<String, Object>) result.getOrDefault("plugin", Collections.emptyMap()); + Map<String, Object> clusterPlugins = (Map<String, Object>) result.getOrDefault(ContainerPluginsApi.PLUGINS, Collections.emptyMap()); Review comment: backward incompatble ---------------------------------------------------------------- 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