murblanc commented on a change in pull request #1684: URL: https://github.com/apache/lucene-solr/pull/1684#discussion_r468398576
########## File path: solr/core/src/java/org/apache/solr/cluster/placement/PlacementPlugin.java ########## @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.solr.cluster.placement; + +/** + * Implemented by external plugins to control replica placement and movement on the search cluster (as well as other things + * such as cluster elasticity?) when cluster changes are required (initiated elsewhere, most likely following a Collection + * API call). + */ +public interface PlacementPlugin { Review comment: So what do you suggest here and how would the plug-in code deal with it? And how different it would be from the plug-in storing/caching whatever processing it has done in static variables? I thought about this and we can introduce a concept of "Config session" during which which the config doesn't change. The plug-in would implement such a newConfigSession method that would accept a config and return an instance of the compute plug-in. That instance would then be called by the framework to do computation. When the framework sees a change of config, it would call again newConfigSession. By using the appropriate classes without storing references in funny places, garbage collection would clean up old configs... Just having a Solr callback into the existing plug-in passing config is not elegant IMO: forces to synchronize access to config (JMM) and to deal with first compute request coming before first config + race conditions between the two. ---------------------------------------------------------------- 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