You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2021/03/10 10:09:54 UTC

[lucene] 22/33: SOLR-15016: Remove unneeded file.

This is an automated email from the ASF dual-hosted git repository.

dweiss pushed a commit to branch jira/solr-15016
in repository https://gitbox.apache.org/repos/asf/lucene.git

commit 29fd3f978733efab451adcdafe28db54bf7e7c29
Author: Andrzej Bialecki <ab...@apache.org>
AuthorDate: Fri Nov 27 12:27:50 2020 +0100

    SOLR-15016: Remove unneeded file.
---
 .../cluster/placement/PlacementPluginConfig.java   | 116 ---------------------
 .../cluster/placement/PlacementPluginFactory.java  |   5 +-
 2 files changed, 4 insertions(+), 117 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPluginConfig.java b/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPluginConfig.java
deleted file mode 100644
index 1518377..0000000
--- a/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPluginConfig.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * 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;
-
-/**
- * <p>Configuration passed by Solr to {@link PlacementPluginFactory#createPluginInstance(PlacementPluginConfig)} so that plugin instances
- * ({@link PlacementPlugin}) created by the factory can easily retrieve their configuration.</p>
- *
- * <p>A plugin writer decides the names and the types of the configurable parameters it needs. Available types are
- * {@link String}, {@link Long}, {@link Boolean}, {@link Double}. This configuration currently lives in the {@code /clusterprops.json}
- * file in Zookeeper (this could change in the future, the plugin code will not change but the way to store its configuration
- * in the cluster might). {@code clusterprops.json} also contains the name of the plugin factory class implementing
- * {@link org.apache.logging.log4j.core.config.plugins.PluginBuilderFactory}.</p>
- *
- * <p>In order to configure a plugin to be used for placement decisions, the following {@code curl} command (or something
- * equivalent) has to be executed once the cluster is already running to set the configuration.
- * Replace {@code localhost:8983} by one of your servers' IP address and port.</p>
- *
- * <pre>
- *
- * curl -X POST -H 'Content-type:application/json' -d '{
- *   "set-placement-plugin": {
- *     "class": "factory.class.name$inner",
- *     "myfirstString": "a text value",
- *     "aLong": 50,
- *     "aDoubleConfig": 3.1415928,
- *     "shouldIStay": true
- *   }
- * }' http://localhost:8983/api/cluster
- * </pre>
- *
- * <p>The consequence will be the creation (or replacement if it exists) of an element in the Zookeeper file
- * {@code /clusterprops.json} as follows:</p>
- *
- * <pre>
- *
- * "placement-plugin":{
- *     "class":"factory.class.name$inner",
- *     "myfirstString": "a text value",
- *     "aLong": 50,
- *     "aDoubleConfig": 3.1415928,
- *     "shouldIStay": true}
- * </pre>
- *
- * <p>In order to delete the placement-plugin section from {@code /clusterprops.json} (and to fallback to either Legacy
- * or rule based placement if so configured for a collection), execute:</p>
- *
- * <pre>
- *
- * curl -X POST -H 'Content-type:application/json' -d '{
- *   "set-placement-plugin" : null
- * }' http://localhost:8983/api/cluster
- * </pre>
- */
-public interface PlacementPluginConfig {
-
-  /**
-   * @return the configured {@link String} value corresponding to {@code configName} if one exists (could be the empty
-   * string) and {@code null} otherwise.
-   */
-  String getStringConfig(String configName);
-
-  /**
-   * @return the configured {@link String} value corresponding to {@code configName} if one exists (could be the empty
-   * string) and {@code defaultValue} otherwise.
-   */
-  String getStringConfig(String configName, String defaultValue);
-
-  /**
-   * @return the configured {@link Boolean} value corresponding to {@code configName} if one exists, {@code null} otherwise.
-   */
-  Boolean getBooleanConfig(String configName);
-
-  /**
-   * @return the configured {@link Boolean} value corresponding to {@code configName} if one exists, a boxed {@code defaultValue}
-   * otherwise (this method never returns {@code null}.
-   */
-  Boolean getBooleanConfig(String configName, boolean defaultValue);
-
-  /**
-   * @return the configured {@link Long} value corresponding to {@code configName} if one exists, {@code null} otherwise.
-   */
-  Long getLongConfig(String configName);
-
-  /**
-   * @return the configured {@link Long} value corresponding to {@code configName} if one exists, a boxed {@code defaultValue}
-   * otherwise (this method never returns {@code null}.
-   */
-  Long getLongConfig(String configName, long defaultValue);
-
-  /**
-   * @return the configured {@link Double} value corresponding to {@code configName} if one exists, {@code null} otherwise.
-   */
-  Double getDoubleConfig(String configName);
-
-  /**
-   * @return the configured {@link Double} value corresponding to {@code configName} if one exists, a boxed {@code defaultValue}
-   * otherwise (this method never returns {@code null}.
-   */
-  Double getDoubleConfig(String configName, double defaultValue);
-}
diff --git a/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPluginFactory.java b/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPluginFactory.java
index 7df4d86..abdd7b9 100644
--- a/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPluginFactory.java
+++ b/solr/core/src/java/org/apache/solr/cluster/placement/PlacementPluginFactory.java
@@ -18,8 +18,11 @@
 package org.apache.solr.cluster.placement;
 
 /**
- * Factory implemented by client code and configured in {@code solr.xml} allowing the creation of instances of
+ * Factory implemented by client code and configured in container plugins allowing the creation of instances of
  * {@link PlacementPlugin} to be used for replica placement computation.
+ * <p>Note: configurable factory implementations should also implement
+ * {@link org.apache.solr.api.ConfigurablePlugin} with the appropriate configuration
+ * bean type.</p>
  */
 public interface PlacementPluginFactory {
   /**