Plugins: Remove name() and description() from api
In 2.0 we added plugin descriptors which require defining a name and description for the plugin. However, we still have name() and description() which must be overriden from the Plugin class. This still exists for classpath plugins. But classpath plugins are mainly for tests, and even then, referring to classpath plugins with their class is a better idea. This change removes name() and description(), replacing the name for classpath plugins with the full class name.
This commit is contained in:
parent
7f6e0c6c02
commit
a4503c2aed
|
@ -38,16 +38,6 @@ import java.util.List;
|
|||
*/
|
||||
public abstract class Plugin {
|
||||
|
||||
/**
|
||||
* The name of the plugin.
|
||||
*/
|
||||
public abstract String name();
|
||||
|
||||
/**
|
||||
* The description of the plugin.
|
||||
*/
|
||||
public abstract String description();
|
||||
|
||||
/**
|
||||
* Node level modules.
|
||||
*/
|
||||
|
|
|
@ -104,7 +104,7 @@ public class PluginsService extends AbstractComponent {
|
|||
// first we load plugins that are on the classpath. this is for tests and transport clients
|
||||
for (Class<? extends Plugin> pluginClass : classpathPlugins) {
|
||||
Plugin plugin = loadPlugin(pluginClass, settings);
|
||||
PluginInfo pluginInfo = new PluginInfo(plugin.name(), plugin.description(), "NA", pluginClass.getName());
|
||||
PluginInfo pluginInfo = new PluginInfo(pluginClass.getName(), "classpath plugin", "NA", pluginClass.getName());
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("plugin loaded from classpath [{}]", pluginInfo);
|
||||
}
|
||||
|
@ -188,12 +188,12 @@ public class PluginsService extends AbstractComponent {
|
|||
continue;
|
||||
}
|
||||
if (method.getParameterTypes().length == 0 || method.getParameterTypes().length > 1) {
|
||||
logger.warn("Plugin: {} implementing onModule with no parameters or more than one parameter", plugin.name());
|
||||
logger.warn("Plugin: {} implementing onModule with no parameters or more than one parameter", pluginEntry.v1().getName());
|
||||
continue;
|
||||
}
|
||||
Class moduleClass = method.getParameterTypes()[0];
|
||||
if (!Module.class.isAssignableFrom(moduleClass)) {
|
||||
logger.warn("Plugin: {} implementing onModule by the type is not of Module type {}", plugin.name(), moduleClass);
|
||||
logger.warn("Plugin: {} implementing onModule by the type is not of Module type {}", pluginEntry.v1().getName(), moduleClass);
|
||||
continue;
|
||||
}
|
||||
list.add(new OnModuleReference(moduleClass, method));
|
||||
|
@ -225,10 +225,10 @@ public class PluginsService extends AbstractComponent {
|
|||
try {
|
||||
reference.onModuleMethod.invoke(plugin.v2(), module);
|
||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||
logger.warn("plugin {}, failed to invoke custom onModule method", e, plugin.v2().name());
|
||||
logger.warn("plugin {}, failed to invoke custom onModule method", e, plugin.v1().getName());
|
||||
throw new ElasticsearchException("failed to invoke onModule", e);
|
||||
} catch (Exception e) {
|
||||
logger.warn("plugin {}, failed to invoke custom onModule method", e, plugin.v2().name());
|
||||
logger.warn("plugin {}, failed to invoke custom onModule method", e, plugin.v1().getName());
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,17 +67,6 @@ import static org.elasticsearch.test.ESTestCase.awaitBusy;
|
|||
*/
|
||||
public class TestTaskPlugin extends Plugin {
|
||||
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "test-task-plugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Test plugin for testing task management";
|
||||
}
|
||||
|
||||
public void onModule(ActionModule module) {
|
||||
module.registerAction(TestTaskAction.INSTANCE, TransportTestTaskAction.class);
|
||||
module.registerAction(UnblockTestTasksAction.INSTANCE, TransportUnblockTestTasksAction.class);
|
||||
|
|
|
@ -103,14 +103,6 @@ public class TransportClientHeadersTests extends AbstractClientHeadersTestCase {
|
|||
public static class InternalTransportService extends TransportService {
|
||||
|
||||
public static class TestPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "mock-transport-service";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "a mock transport service";
|
||||
}
|
||||
public void onModule(NetworkModule transportModule) {
|
||||
transportModule.registerTransportService("internal", InternalTransportService.class);
|
||||
}
|
||||
|
|
|
@ -76,16 +76,6 @@ public class ClusterInfoServiceIT extends ESIntegTestCase {
|
|||
|
||||
public static class TestPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ClusterInfoServiceIT";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "ClusterInfoServiceIT";
|
||||
}
|
||||
|
||||
public void onModule(ActionModule module) {
|
||||
module.registerFilter(BlockingActionFilter.class);
|
||||
}
|
||||
|
|
|
@ -582,16 +582,6 @@ public class ClusterServiceIT extends ESIntegTestCase {
|
|||
|
||||
public static class TestPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "test plugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "test plugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Class<? extends LifecycleComponent>> nodeServices() {
|
||||
List<Class<? extends LifecycleComponent>> services = new ArrayList<>(1);
|
||||
|
|
|
@ -51,22 +51,6 @@ public class SettingsFilteringIT extends ESIntegTestCase {
|
|||
public static final Setting<Boolean> SOME_OTHER_NODE_SETTING =
|
||||
Setting.boolSetting("some.other.node.setting", false, Property.NodeScope);
|
||||
|
||||
/**
|
||||
* The name of the plugin.
|
||||
*/
|
||||
@Override
|
||||
public String name() {
|
||||
return "settings-filtering";
|
||||
}
|
||||
|
||||
/**
|
||||
* The description of the plugin.
|
||||
*/
|
||||
@Override
|
||||
public String description() {
|
||||
return "Settings Filtering Plugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Settings additionalSettings() {
|
||||
return Settings.builder().put("some.node.setting", true).put("some.other.node.setting", true).build();
|
||||
|
|
|
@ -46,21 +46,6 @@ public class SettingsListenerIT extends ESIntegTestCase {
|
|||
private final SettingsTestingService service = new SettingsTestingService();
|
||||
private static final Setting<Integer> SETTING = Setting.intSetting("index.test.new.setting", 0,
|
||||
Property.Dynamic, Property.IndexScope);
|
||||
/**
|
||||
* The name of the plugin.
|
||||
*/
|
||||
@Override
|
||||
public String name() {
|
||||
return "settings-listener";
|
||||
}
|
||||
|
||||
/**
|
||||
* The description of the plugin.
|
||||
*/
|
||||
@Override
|
||||
public String description() {
|
||||
return "Settings Listenern Plugin";
|
||||
}
|
||||
|
||||
public void onModule(SettingsModule settingsModule) {
|
||||
settingsModule.registerSetting(SettingsTestingService.VALUE);
|
||||
|
|
|
@ -172,16 +172,6 @@ public class WaitUntilRefreshIT extends ESIntegTestCase {
|
|||
}
|
||||
|
||||
public static class DeletePlzPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "delete_please";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "adds a script that converts any update into a delete for testing";
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule scriptModule) {
|
||||
scriptModule.registerScript("delete_plz", DeletePlzFactory.class);
|
||||
}
|
||||
|
|
|
@ -28,16 +28,6 @@ public class ExternalMapperPlugin extends Plugin {
|
|||
public static final String EXTERNAL_BIS = "external_bis";
|
||||
public static final String EXTERNAL_UPPER = "external_upper";
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "external-mappers";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "External Mappers Plugin";
|
||||
}
|
||||
|
||||
public void onModule(IndicesModule indicesModule) {
|
||||
indicesModule.registerMetadataMapper(ExternalMetadataMapper.CONTENT_TYPE, new ExternalMetadataMapper.TypeParser());
|
||||
indicesModule.registerMapper(EXTERNAL, new ExternalMapper.TypeParser(EXTERNAL, "foo"));
|
||||
|
|
|
@ -761,17 +761,6 @@ public class FunctionScoreQueryBuilderTests extends AbstractQueryTestCase<Functi
|
|||
}
|
||||
|
||||
public static class TestPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "test-plugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Adds random function with fixed seed";
|
||||
}
|
||||
|
||||
public void onModule(SearchModule module) {
|
||||
module.registerScoreFunction(RandomScoreFunctionBuilderWithFixedSeed::new,
|
||||
RandomScoreFunctionBuilderWithFixedSeed::fromXContent, RandomScoreFunctionBuilderWithFixedSeed.FUNCTION_NAME_FIELD);
|
||||
|
|
|
@ -30,16 +30,6 @@ import java.io.IOException;
|
|||
|
||||
public class DummyQueryParserPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "dummy";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "dummy query";
|
||||
}
|
||||
|
||||
public void onModule(SearchModule module) {
|
||||
module.registerQuery(DummyQueryBuilder::new, DummyQueryBuilder::fromXContent, DummyQueryBuilder.QUERY_NAME_FIELD);
|
||||
}
|
||||
|
@ -72,4 +62,4 @@ public class DummyQueryParserPlugin extends Plugin {
|
|||
return classHash();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -588,15 +588,6 @@ public class IndicesOptionsIntegrationIT extends ESIntegTestCase {
|
|||
}
|
||||
|
||||
public static final class TestPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "index-a-setting";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "a plugin that adds a dynamic tst setting";
|
||||
}
|
||||
|
||||
private static final Setting<String> INDEX_A =
|
||||
new Setting<>("index.a", "", Function.identity(), Property.Dynamic, Property.IndexScope);
|
||||
|
|
|
@ -22,22 +22,6 @@ package org.elasticsearch.indices.analysis;
|
|||
import org.elasticsearch.plugins.Plugin;
|
||||
|
||||
public class DummyAnalysisPlugin extends Plugin {
|
||||
/**
|
||||
* The name of the plugin.
|
||||
*/
|
||||
@Override
|
||||
public String name() {
|
||||
return "analysis-dummy";
|
||||
}
|
||||
|
||||
/**
|
||||
* The description of the plugin.
|
||||
*/
|
||||
@Override
|
||||
public String description() {
|
||||
return "Analysis Dummy Plugin";
|
||||
}
|
||||
|
||||
|
||||
public void onModule(AnalysisModule module) {
|
||||
module.registerAnalyzer("dummy", (a, b, c, d) -> new DummyAnalyzerProvider());
|
||||
|
|
|
@ -200,15 +200,6 @@ public class RandomExceptionCircuitBreakerIT extends ESIntegTestCase {
|
|||
public static final Setting<Double> EXCEPTION_LOW_LEVEL_RATIO_SETTING =
|
||||
Setting.doubleSetting(EXCEPTION_LOW_LEVEL_RATIO_KEY, 0.1d, 0.0d, Property.IndexScope);
|
||||
public static class TestPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "random-exception-reader-wrapper";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "a mock reader wrapper that throws random exceptions for testing";
|
||||
}
|
||||
|
||||
public void onModule(SettingsModule module) {
|
||||
module.registerSetting(EXCEPTION_TOP_LEVEL_RATIO_SETTING);
|
||||
module.registerSetting(EXCEPTION_LOW_LEVEL_RATIO_SETTING);
|
||||
|
|
|
@ -75,16 +75,6 @@ public class IndexTemplateFilteringIT extends ESIntegTestCase {
|
|||
}
|
||||
|
||||
public static class TestPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "test-plugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public void onModule(ClusterModule module) {
|
||||
module.registerIndexTemplateFilter(TestFilter.class);
|
||||
}
|
||||
|
|
|
@ -53,17 +53,6 @@ public class IngestCloseIT extends ESSingleNodeTestCase {
|
|||
}
|
||||
|
||||
public static class IngestPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ingest";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "ingest mock";
|
||||
}
|
||||
|
||||
public void onModule(NodeModule nodeModule) {
|
||||
nodeModule.registerProcessor("test", (registry) -> new Factory());
|
||||
}
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
/*
|
||||
* Licensed to Elasticsearch under one or more contributor
|
||||
* license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright
|
||||
* ownership. Elasticsearch 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.elasticsearch.nodesinfo.plugin.dummy1;
|
||||
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
|
||||
public class TestPlugin extends Plugin {
|
||||
|
||||
static final public class Fields {
|
||||
static public final String NAME = "test-plugin";
|
||||
static public final String DESCRIPTION = NAME + " description";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return Fields.NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return Fields.DESCRIPTION;
|
||||
}
|
||||
}
|
|
@ -32,28 +32,12 @@ import java.util.Arrays;
|
|||
|
||||
public class PluginsServiceTests extends ESTestCase {
|
||||
public static class AdditionalSettingsPlugin1 extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "additional-settings1";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "adds additional setting 'foo.bar'";
|
||||
}
|
||||
@Override
|
||||
public Settings additionalSettings() {
|
||||
return Settings.builder().put("foo.bar", "1").put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), IndexModule.Type.MMAPFS.getSettingsKey()).build();
|
||||
}
|
||||
}
|
||||
public static class AdditionalSettingsPlugin2 extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "additional-settings2";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "adds additional setting 'foo.bar'";
|
||||
}
|
||||
@Override
|
||||
public Settings additionalSettings() {
|
||||
return Settings.builder().put("foo.bar", "2").build();
|
||||
|
@ -61,15 +45,6 @@ public class PluginsServiceTests extends ESTestCase {
|
|||
}
|
||||
|
||||
public static class FailOnModule extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "fail-on-module";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "fails in onModule";
|
||||
}
|
||||
|
||||
public void onModule(BrokenModule brokenModule) {
|
||||
throw new IllegalStateException("boom");
|
||||
}
|
||||
|
@ -108,8 +83,8 @@ public class PluginsServiceTests extends ESTestCase {
|
|||
} catch (IllegalArgumentException e) {
|
||||
String msg = e.getMessage();
|
||||
assertTrue(msg, msg.contains("Cannot have additional setting [foo.bar]"));
|
||||
assertTrue(msg, msg.contains("plugin [additional-settings1]"));
|
||||
assertTrue(msg, msg.contains("plugin [additional-settings2]"));
|
||||
assertTrue(msg, msg.contains("plugin [" + AdditionalSettingsPlugin1.class.getName()));
|
||||
assertTrue(msg, msg.contains("plugin [" + AdditionalSettingsPlugin2.class.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -24,16 +24,6 @@ import org.elasticsearch.plugins.Plugin;
|
|||
|
||||
public class TestResponseHeaderPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "test-plugin-custom-header";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "test-plugin-custom-header-desc";
|
||||
}
|
||||
|
||||
public void onModule(NetworkModule module) {
|
||||
module.registerRestHandler(TestResponseHeaderRestAction.class);
|
||||
}
|
||||
|
|
|
@ -153,16 +153,6 @@ public class ScriptFieldIT extends ESIntegTestCase {
|
|||
|
||||
public static class CustomScriptPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "custom_script";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "script ";
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule scriptModule) {
|
||||
scriptModule.registerScript("int", IntArrayScriptFactory.class);
|
||||
scriptModule.registerScript("long", LongArrayScriptFactory.class);
|
||||
|
|
|
@ -112,16 +112,6 @@ public class SearchServiceTests extends ESSingleNodeTestCase {
|
|||
|
||||
public static class FailOnRewriteQueryPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return FailOnRewriteQueryPlugin.class.getSimpleName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "This plugin registers a query that always fails at rewrite phase";
|
||||
}
|
||||
|
||||
public void onModule(SearchModule module) {
|
||||
module.registerQuery(FailOnRewriteQueryBuilder::new, parseContext -> {
|
||||
throw new UnsupportedOperationException("No query parser for this plugin");
|
||||
|
|
|
@ -65,15 +65,6 @@ public class SearchTimeoutIT extends ESIntegTestCase {
|
|||
}
|
||||
|
||||
public static class ScriptedTimeoutPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "test-scripted-search-timeout";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Test for scripted timeouts on searches";
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.registerScript(NativeTestScriptedTimeout.TEST_NATIVE_SCRIPT_TIMEOUT, NativeTestScriptedTimeout.Factory.class);
|
||||
|
|
|
@ -41,16 +41,6 @@ public class DateScriptMocks {
|
|||
*/
|
||||
public static class DateScriptsMockPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "DateScriptMocks";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "A mock script plugin.";
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.registerScript(ExtractFieldScript.NAME, ExtractFieldScriptFactory.class);
|
||||
module.registerScript(PlusOneMonthScript.NAME, PlusOneMonthScriptFactory.class);
|
||||
|
|
|
@ -218,16 +218,6 @@ public class IpRangeIT extends ESIntegTestCase {
|
|||
|
||||
public static class DummyScriptPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "DummyScriptPlugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "A mock script plugin.";
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.registerScript(DummyScript.NAME, DummyScriptFactory.class);
|
||||
}
|
||||
|
|
|
@ -165,15 +165,6 @@ public class SignificantTermsSignificanceScoreIT extends ESIntegTestCase {
|
|||
}
|
||||
|
||||
public static class CustomSignificanceHeuristicPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "test-plugin-significance-heuristic";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Significance heuristic plugin";
|
||||
}
|
||||
|
||||
public void onModule(SearchModule searchModule) {
|
||||
searchModule.registerSignificanceHeuristic(SimpleHeuristic.NAMES_FIELD, SimpleHeuristic::new, SimpleHeuristic::parse);
|
||||
|
|
|
@ -357,17 +357,6 @@ public class AvgIT extends AbstractNumericTestCase {
|
|||
* Mock plugin for the {@link ExtractFieldScriptEngine}
|
||||
*/
|
||||
public static class ExtractFieldScriptPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return ExtractFieldScriptEngine.NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Mock script engine for " + AvgIT.class;
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(ExtractFieldScriptEngine.class, ExtractFieldScriptEngine.NAME, true));
|
||||
}
|
||||
|
@ -477,17 +466,6 @@ public class AvgIT extends AbstractNumericTestCase {
|
|||
* Mock plugin for the {@link FieldValueScriptEngine}
|
||||
*/
|
||||
public static class FieldValueScriptPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return FieldValueScriptEngine.NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Mock script engine for " + AvgIT.class;
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(FieldValueScriptEngine.class, FieldValueScriptEngine.NAME, true));
|
||||
}
|
||||
|
|
|
@ -352,17 +352,6 @@ public class SumIT extends AbstractNumericTestCase {
|
|||
* Mock plugin for the {@link ExtractFieldScriptEngine}
|
||||
*/
|
||||
public static class ExtractFieldScriptPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return ExtractFieldScriptEngine.NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Mock script engine for " + SumIT.class;
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(ExtractFieldScriptEngine.class, ExtractFieldScriptEngine.NAME, true));
|
||||
}
|
||||
|
@ -474,17 +463,6 @@ public class SumIT extends AbstractNumericTestCase {
|
|||
* Mock plugin for the {@link FieldValueScriptEngine}
|
||||
*/
|
||||
public static class FieldValueScriptPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return FieldValueScriptEngine.NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Mock script engine for " + SumIT.class;
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(FieldValueScriptEngine.class, FieldValueScriptEngine.NAME, true));
|
||||
}
|
||||
|
|
|
@ -211,17 +211,6 @@ public class ValueCountIT extends ESIntegTestCase {
|
|||
* Mock plugin for the {@link FieldValueScriptEngine}
|
||||
*/
|
||||
public static class FieldValueScriptPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return FieldValueScriptEngine.NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Mock script engine for " + ValueCountIT.class;
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(FieldValueScriptEngine.class, FieldValueScriptEngine.NAME, true));
|
||||
}
|
||||
|
|
|
@ -156,18 +156,10 @@ public class SearchWithRandomExceptionsIT extends ESIntegTestCase {
|
|||
Setting.doubleSetting(EXCEPTION_TOP_LEVEL_RATIO_KEY, 0.1d, 0.0d, Property.IndexScope);
|
||||
public static final Setting<Double> EXCEPTION_LOW_LEVEL_RATIO_SETTING =
|
||||
Setting.doubleSetting(EXCEPTION_LOW_LEVEL_RATIO_KEY, 0.1d, 0.0d, Property.IndexScope);
|
||||
@Override
|
||||
public String name() {
|
||||
return "random-exception-reader-wrapper";
|
||||
}
|
||||
public void onModule(SettingsModule module) {
|
||||
module.registerSetting(EXCEPTION_TOP_LEVEL_RATIO_SETTING);
|
||||
module.registerSetting(EXCEPTION_LOW_LEVEL_RATIO_SETTING);
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "a mock reader wrapper that throws random exceptions for testing";
|
||||
}
|
||||
public void onModule(MockEngineFactoryPlugin.MockEngineReaderModule module) {
|
||||
module.setReaderClass(RandomExceptionDirectoryReaderWrapper.class);
|
||||
}
|
||||
|
|
|
@ -100,17 +100,6 @@ public class FetchSubPhasePluginIT extends ESIntegTestCase {
|
|||
}
|
||||
|
||||
public static class FetchTermVectorsPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "fetch-term-vectors";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "fetch plugin to test if the plugin mechanism works";
|
||||
}
|
||||
|
||||
public void onModule(SearchModule searchModule) {
|
||||
searchModule.registerFetchSubPhase(new TermVectorsFetchSubPhase());
|
||||
}
|
||||
|
|
|
@ -23,18 +23,6 @@ import org.elasticsearch.plugins.Plugin;
|
|||
import org.elasticsearch.script.ScriptModule;
|
||||
|
||||
public class ExplainableScriptPlugin extends Plugin {
|
||||
|
||||
public ExplainableScriptPlugin() {}
|
||||
@Override
|
||||
public String name() {
|
||||
return "native-explainable-script";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Native explainable script";
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.registerScript("native_explainable_script", ExplainableScriptIT.MyNativeScriptFactory.class);
|
||||
}
|
||||
|
|
|
@ -95,17 +95,6 @@ public class FunctionScorePluginIT extends ESIntegTestCase {
|
|||
}
|
||||
|
||||
public static class CustomDistanceScorePlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "test-plugin-distance-score";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Distance score plugin to test pluggable implementation";
|
||||
}
|
||||
|
||||
public void onModule(SearchModule scoreModule) {
|
||||
scoreModule.registerScoreFunction(CustomDistanceScoreBuilder::new, CustomDistanceScoreBuilder.PARSER,
|
||||
CustomDistanceScoreBuilder.FUNCTION_NAME_FIELD);
|
||||
|
|
|
@ -24,16 +24,6 @@ import org.elasticsearch.search.SearchModule;
|
|||
|
||||
public class CustomHighlighterPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "test-plugin-custom-highlighter";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Custom highlighter to test pluggable implementation";
|
||||
}
|
||||
|
||||
public void onModule(SearchModule highlightModule) {
|
||||
highlightModule.registerHighlighter("test-custom", new CustomHighlighter());
|
||||
}
|
||||
|
|
|
@ -21,21 +21,8 @@ package org.elasticsearch.search.suggest;
|
|||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.search.SearchModule;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class CustomSuggesterPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "test-plugin-custom-suggester";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Custom suggester to test pluggable implementation";
|
||||
}
|
||||
|
||||
public void onModule(SearchModule searchModule) {
|
||||
searchModule.registerSuggester("custom", CustomSuggester.INSTANCE);
|
||||
}
|
||||
|
|
|
@ -62,16 +62,6 @@ public class MockRepository extends FsRepository {
|
|||
public static final Setting<String> PASSWORD_SETTING =
|
||||
Setting.simpleString("secret.mock.password", Property.NodeScope, Property.Filtered);
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "mock-repository";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Mock Repository";
|
||||
}
|
||||
|
||||
public void onModule(RepositoriesModule repositoriesModule) {
|
||||
repositoriesModule.registerRepository("mock", MockRepository.class, BlobStoreIndexShardRepository.class);
|
||||
}
|
||||
|
|
|
@ -294,16 +294,6 @@ public class ContextAndHeaderTransportIT extends ESIntegTestCase {
|
|||
|
||||
public static class ActionLoggingPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "test-action-logging";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Test action logging";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Module> nodeModules() {
|
||||
return Collections.<Module>singletonList(new ActionLoggingModule());
|
||||
|
|
|
@ -86,14 +86,6 @@ public class NettyTransportIT extends ESIntegTestCase {
|
|||
public static final class ExceptionThrowingNettyTransport extends NettyTransport {
|
||||
|
||||
public static class TestPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "exception-throwing-netty-transport";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "an exception throwing transport for testing";
|
||||
}
|
||||
public void onModule(NetworkModule module) {
|
||||
module.registerTransport("exception-throwing", ExceptionThrowingNettyTransport.class);
|
||||
}
|
||||
|
|
|
@ -67,14 +67,6 @@ public class UpdateByNativeScriptIT extends ESIntegTestCase {
|
|||
|
||||
public static class CustomNativeScriptFactory implements NativeScriptFactory {
|
||||
public static class TestPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "mock-native-script";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "a mock native script for testing";
|
||||
}
|
||||
public void onModule(ScriptModule scriptModule) {
|
||||
scriptModule.registerScript("custom", CustomNativeScriptFactory.class);
|
||||
}
|
||||
|
|
|
@ -79,20 +79,6 @@ import static org.hamcrest.Matchers.nullValue;
|
|||
public class UpdateIT extends ESIntegTestCase {
|
||||
|
||||
public static class PutFieldValuesScriptPlugin extends Plugin {
|
||||
|
||||
public PutFieldValuesScriptPlugin() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return PutFieldValuesScriptEngine.NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Mock script engine for " + UpdateIT.class;
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(PutFieldValuesScriptEngine.class, PutFieldValuesScriptEngine.NAME, true));
|
||||
}
|
||||
|
@ -166,20 +152,6 @@ public class UpdateIT extends ESIntegTestCase {
|
|||
}
|
||||
|
||||
public static class FieldIncrementScriptPlugin extends Plugin {
|
||||
|
||||
public FieldIncrementScriptPlugin() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return FieldIncrementScriptEngine.NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Mock script engine for " + UpdateIT.class;
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(FieldIncrementScriptEngine.class, FieldIncrementScriptEngine.NAME, true));
|
||||
}
|
||||
|
@ -246,20 +218,6 @@ public class UpdateIT extends ESIntegTestCase {
|
|||
}
|
||||
|
||||
public static class ScriptedUpsertScriptPlugin extends Plugin {
|
||||
|
||||
public ScriptedUpsertScriptPlugin() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return ScriptedUpsertScriptEngine.NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Mock script engine for " + UpdateIT.class + ".testScriptedUpsert";
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(ScriptedUpsertScriptEngine.class, ScriptedUpsertScriptEngine.NAME, true));
|
||||
}
|
||||
|
@ -326,20 +284,6 @@ public class UpdateIT extends ESIntegTestCase {
|
|||
}
|
||||
|
||||
public static class ExtractContextInSourceScriptPlugin extends Plugin {
|
||||
|
||||
public ExtractContextInSourceScriptPlugin() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return ExtractContextInSourceScriptEngine.NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Mock script engine for " + UpdateIT.class;
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(ExtractContextInSourceScriptEngine.class, ExtractContextInSourceScriptEngine.NAME, true));
|
||||
}
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
################################################################
|
||||
# Licensed to Elasticsearch under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright
|
||||
# ownership. Elasticsearch 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.
|
||||
################################################################
|
||||
description=This is a description for a dummy test site plugin.
|
||||
version=0.0.7-BOND-SITE
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Dummy Site Plugin on Node 3</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Welcome to this dummy elasticsearch plugin</p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,9 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Dummy Site Plugin on Node 3</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Welcome to this dummy elasticsearch plugin</p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,9 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Dummy Site Plugin on Node 3</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Welcome to this dummy elasticsearch plugin</p>
|
||||
</body>
|
||||
</html>
|
|
@ -29,19 +29,6 @@ import java.io.IOException;
|
|||
|
||||
public class MatrixAggregationPlugin extends Plugin {
|
||||
|
||||
public MatrixAggregationPlugin() throws IOException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "aggs-matrix-stats";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Adds aggregations whose input are a list of numeric fields and output includes a matrix.";
|
||||
}
|
||||
|
||||
public void onModule(SearchModule searchModule) {
|
||||
InternalMatrixStats.registerStreams();
|
||||
searchModule.registerAggregation(MatrixStatsAggregationBuilder::new, new MatrixStatsParser(),
|
||||
|
|
|
@ -41,16 +41,6 @@ public class IngestCommonPlugin extends Plugin {
|
|||
this.builtinPatterns = loadBuiltinPatterns();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Module for ingest processors that do not require additional security permissions or have large dependencies and resources";
|
||||
}
|
||||
|
||||
public void onModule(NodeModule nodeModule) {
|
||||
nodeModule.registerProcessor(DateProcessor.TYPE, (registry) -> new DateProcessor.Factory());
|
||||
nodeModule.registerProcessor(SetProcessor.TYPE, (registry) -> new SetProcessor.Factory(registry.getTemplateService()));
|
||||
|
|
|
@ -25,16 +25,6 @@ import org.elasticsearch.script.ScriptModule;
|
|||
|
||||
public class ExpressionPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "lang-expression";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Lucene expressions integration for Elasticsearch";
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(ExpressionScriptEngineService.class,
|
||||
ExpressionScriptEngineService.NAME, true));
|
||||
|
|
|
@ -25,16 +25,6 @@ import org.elasticsearch.script.ScriptModule;
|
|||
|
||||
public class GroovyPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "lang-groovy";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Groovy scripting integration for Elasticsearch";
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(GroovyScriptEngineService.class, GroovyScriptEngineService.NAME));
|
||||
}
|
||||
|
|
|
@ -708,14 +708,7 @@ public class IndicesRequestTests extends ESIntegTestCase {
|
|||
public static class InterceptingTransportService extends TransportService {
|
||||
|
||||
public static class TestPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "intercepting-transport-service";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "an intercepting transport service for testing";
|
||||
}
|
||||
|
||||
public void onModule(NetworkModule module) {
|
||||
module.registerTransportService("intercepting", InterceptingTransportService.class);
|
||||
}
|
||||
|
|
|
@ -25,16 +25,6 @@ import org.elasticsearch.script.ScriptModule;
|
|||
|
||||
public class MustachePlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "lang-mustache";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Mustache scripting integration for Elasticsearch";
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(MustacheScriptEngineService.class,
|
||||
MustacheScriptEngineService.NAME, true));
|
||||
|
|
|
@ -34,16 +34,6 @@ public final class PainlessPlugin extends Plugin {
|
|||
Definition.VOID_TYPE.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "lang-painless";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Painless scripting language for Elasticsearch";
|
||||
}
|
||||
|
||||
public void onModule(final ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(
|
||||
PainlessScriptEngineService.class, PainlessScriptEngineService.NAME, true));
|
||||
|
|
|
@ -45,16 +45,6 @@ public class PercolatorPlugin extends Plugin {
|
|||
this.settings = settings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Percolator module adds capability to index queries and query these queries by specifying documents";
|
||||
}
|
||||
|
||||
public void onModule(ActionModule module) {
|
||||
module.registerAction(PercolateAction.INSTANCE, TransportPercolateAction.class);
|
||||
module.registerAction(MultiPercolateAction.INSTANCE, TransportMultiPercolateAction.class);
|
||||
|
|
|
@ -26,16 +26,6 @@ import org.elasticsearch.plugins.Plugin;
|
|||
public class ReindexPlugin extends Plugin {
|
||||
public static final String NAME = "reindex";
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "The Reindex module adds APIs to reindex from one index to another or update documents in place.";
|
||||
}
|
||||
|
||||
public void onModule(ActionModule actionModule) {
|
||||
actionModule.registerAction(ReindexAction.INSTANCE, TransportReindexAction.class);
|
||||
actionModule.registerAction(UpdateByQueryAction.INSTANCE, TransportUpdateByQueryAction.class);
|
||||
|
|
|
@ -190,16 +190,6 @@ public class CancelTests extends ReindexTestCase {
|
|||
|
||||
public static class ReindexCancellationPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "reindex-cancellation";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "See " + CancelTests.class.getName() + " documentation";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onIndexModule(IndexModule indexModule) {
|
||||
indexModule.addIndexOperationListener(new BlockingDeleteListener());
|
||||
|
|
|
@ -28,21 +28,8 @@ import org.elasticsearch.index.analysis.IcuTransformTokenFilterFactory;
|
|||
import org.elasticsearch.indices.analysis.AnalysisModule;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class AnalysisICUPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "analysis-icu";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "UTF related ICU analysis support";
|
||||
}
|
||||
|
||||
/**
|
||||
* Automatically called with the analysis module.
|
||||
*/
|
||||
|
|
|
@ -36,17 +36,6 @@ import org.elasticsearch.plugins.Plugin;
|
|||
*/
|
||||
public class AnalysisKuromojiPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "analysis-kuromoji";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Kuromoji analysis support";
|
||||
}
|
||||
|
||||
|
||||
public void onModule(AnalysisModule module) {
|
||||
module.registerCharFilter("kuromoji_iteration_mark", KuromojiIterationMarkCharFilterFactory::new);
|
||||
module.registerAnalyzer("kuromoji", KuromojiAnalyzerProvider::new);
|
||||
|
|
|
@ -23,20 +23,8 @@ import org.elasticsearch.index.analysis.PhoneticTokenFilterFactory;
|
|||
import org.elasticsearch.indices.analysis.AnalysisModule;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class AnalysisPhoneticPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "analysis-phonetic";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Phonetic analysis support";
|
||||
}
|
||||
|
||||
public void onModule(AnalysisModule module) {
|
||||
module.registerTokenFilter("phonetic", PhoneticTokenFilterFactory::new);
|
||||
}
|
||||
|
|
|
@ -25,21 +25,8 @@ import org.elasticsearch.index.analysis.SmartChineseTokenizerTokenizerFactory;
|
|||
import org.elasticsearch.indices.analysis.AnalysisModule;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class AnalysisSmartChinesePlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "analysis-smartcn";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Smart Chinese analysis support";
|
||||
}
|
||||
|
||||
public void onModule(AnalysisModule module) {
|
||||
module.registerAnalyzer("smartcn", SmartChineseAnalyzerProvider::new);
|
||||
module.registerTokenizer("smartcn_tokenizer", SmartChineseTokenizerTokenizerFactory::new);
|
||||
|
|
|
@ -24,21 +24,8 @@ import org.elasticsearch.index.analysis.pl.PolishStemTokenFilterFactory;
|
|||
import org.elasticsearch.indices.analysis.AnalysisModule;
|
||||
import org.elasticsearch.plugins.Plugin;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class AnalysisStempelPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "analysis-stempel";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Stempel (Polish) analysis support";
|
||||
}
|
||||
|
||||
public void onModule(AnalysisModule module) {
|
||||
module.registerAnalyzer("polish", PolishAnalyzerProvider::new);
|
||||
module.registerTokenFilter("polish_stem", PolishStemTokenFilterFactory::new);
|
||||
|
|
|
@ -45,16 +45,6 @@ public class AzureDiscoveryPlugin extends Plugin {
|
|||
logger.trace("starting azure discovery plugin...");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "discovery-azure";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Azure Discovery Plugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Module> nodeModules() {
|
||||
return Collections.singletonList((Module) new AzureDiscoveryModule(settings));
|
||||
|
|
|
@ -38,14 +38,6 @@ import java.net.InetAddress;
|
|||
public class AzureComputeServiceSimpleMock extends AzureComputeServiceAbstractMock {
|
||||
|
||||
public static class TestPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "mock-compute-service";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "plugs in a mock compute service for testing";
|
||||
}
|
||||
public void onModule(AzureDiscoveryModule azureDiscoveryModule) {
|
||||
azureDiscoveryModule.computeServiceImpl = AzureComputeServiceSimpleMock.class;
|
||||
}
|
||||
|
|
|
@ -42,14 +42,6 @@ import static org.elasticsearch.common.util.CollectionUtils.newSingletonArrayLis
|
|||
*/
|
||||
public class AzureComputeServiceTwoNodesMock extends AzureComputeServiceAbstractMock {
|
||||
public static class TestPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "mock-compute-service";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "plugs in a mock compute service for testing";
|
||||
}
|
||||
public void onModule(AzureDiscoveryModule azureDiscoveryModule) {
|
||||
azureDiscoveryModule.computeServiceImpl = AzureComputeServiceTwoNodesMock.class;
|
||||
}
|
||||
|
|
|
@ -72,17 +72,6 @@ import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoTi
|
|||
public class AzureDiscoveryClusterFormationTests extends ESIntegTestCase {
|
||||
|
||||
public static class TestPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return AzureDiscoveryClusterFormationTests.class.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return AzureDiscoveryClusterFormationTests.class.getName();
|
||||
}
|
||||
|
||||
public void onModule(SettingsModule settingsModule) {
|
||||
settingsModule.registerSetting(AzureComputeService.Management.ENDPOINT_SETTING);
|
||||
}
|
||||
|
|
|
@ -67,23 +67,6 @@ public class Ec2DiscoveryPlugin extends Plugin {
|
|||
});
|
||||
}
|
||||
|
||||
private final Settings settings;
|
||||
protected final ESLogger logger = Loggers.getLogger(Ec2DiscoveryPlugin.class);
|
||||
|
||||
public Ec2DiscoveryPlugin(Settings settings) {
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "discovery-ec2";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "EC2 Discovery Plugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Module> nodeModules() {
|
||||
Collection<Module> modules = new ArrayList<>();
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
package org.elasticsearch.cloud.aws;
|
||||
|
||||
import com.amazonaws.ClientConfiguration;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.plugin.discovery.ec2.Ec2DiscoveryPlugin;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
import org.junit.BeforeClass;
|
||||
|
@ -35,7 +34,7 @@ public class AWSSignersTests extends ESTestCase {
|
|||
*/
|
||||
@BeforeClass
|
||||
public static void instantiatePlugin() {
|
||||
new Ec2DiscoveryPlugin(Settings.EMPTY);
|
||||
new Ec2DiscoveryPlugin();
|
||||
}
|
||||
|
||||
public void testSigners() {
|
||||
|
|
|
@ -62,25 +62,12 @@ import static org.hamcrest.Matchers.equalTo;
|
|||
// TODO this should be a IT but currently all ITs in this project run against a real cluster
|
||||
public class Ec2DiscoveryClusterFormationTests extends ESIntegTestCase {
|
||||
|
||||
public static class TestPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return Ec2DiscoveryClusterFormationTests.class.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return Ec2DiscoveryClusterFormationTests.class.getName();
|
||||
}
|
||||
}
|
||||
|
||||
private static HttpServer httpServer;
|
||||
private static Path logDir;
|
||||
|
||||
@Override
|
||||
protected Collection<Class<? extends Plugin>> nodePlugins() {
|
||||
return pluginList(Ec2DiscoveryPlugin.class, TestPlugin.class);
|
||||
return pluginList(Ec2DiscoveryPlugin.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -66,23 +66,6 @@ public class GceDiscoveryPlugin extends Plugin {
|
|||
});
|
||||
}
|
||||
|
||||
private final Settings settings;
|
||||
protected final ESLogger logger = Loggers.getLogger(GceDiscoveryPlugin.class);
|
||||
|
||||
public GceDiscoveryPlugin(Settings settings) {
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "discovery-gce";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Cloud Google Compute Engine Discovery Plugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Module> nodeModules() {
|
||||
return Collections.singletonList(new GceModule());
|
||||
|
|
|
@ -64,16 +64,6 @@ public class GceDiscoverTests extends ESIntegTestCase {
|
|||
|
||||
public static class TestPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "GceDiscoverTests";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "GceDiscoverTests";
|
||||
}
|
||||
|
||||
public void onModule(SettingsModule module) {
|
||||
module.registerSetting(GceComputeServiceImpl.GCE_HOST);
|
||||
module.registerSetting(GceComputeServiceImpl.GCE_ROOT_URL);
|
||||
|
|
|
@ -26,16 +26,6 @@ import java.io.IOException;
|
|||
|
||||
public class IngestAttachmentPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ingest-attachment";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Ingest processor that adds uses Tika to extract binary data";
|
||||
}
|
||||
|
||||
public void onModule(NodeModule nodeModule) throws IOException {
|
||||
nodeModule.registerProcessor(AttachmentProcessor.TYPE,
|
||||
(registry) -> new AttachmentProcessor.Factory());
|
||||
|
|
|
@ -38,16 +38,6 @@ import java.util.zip.GZIPInputStream;
|
|||
|
||||
public class IngestGeoIpPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ingest-geoip";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Ingest processor that adds information about the geographical location of ip addresses";
|
||||
}
|
||||
|
||||
public void onModule(NodeModule nodeModule) throws IOException {
|
||||
Path geoIpConfigDirectory = nodeModule.getNode().getEnvironment().configFile().resolve("ingest-geoip");
|
||||
Map<String, DatabaseReader> databaseReaders = loadDatabaseReaders(geoIpConfigDirectory);
|
||||
|
|
|
@ -43,16 +43,6 @@ public class JvmExamplePlugin extends Plugin {
|
|||
this.settings = settings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "jvm-example";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "A plugin that extends all extension points";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Module> nodeModules() {
|
||||
return Collections.<Module>singletonList(new ConfiguredExampleModule());
|
||||
|
|
|
@ -34,16 +34,6 @@ public class JavaScriptPlugin extends Plugin {
|
|||
JavaScriptScriptEngineService.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "lang-javascript";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "JavaScript plugin allowing to add javascript scripting support";
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(JavaScriptScriptEngineService.class, JavaScriptScriptEngineService.NAME));
|
||||
}
|
||||
|
|
|
@ -24,21 +24,8 @@ import org.elasticsearch.script.ScriptEngineRegistry;
|
|||
import org.elasticsearch.script.ScriptModule;
|
||||
import org.elasticsearch.script.python.PythonScriptEngineService;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class PythonPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "lang-python";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Adds support for writing scripts in Python";
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(PythonScriptEngineService.class, PythonScriptEngineService.NAME));
|
||||
}
|
||||
|
|
|
@ -32,16 +32,6 @@ public class MapperAttachmentsPlugin extends Plugin {
|
|||
private static ESLogger logger = ESLoggerFactory.getLogger("mapper.attachment");
|
||||
private static DeprecationLogger deprecationLogger = new DeprecationLogger(logger);
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "mapper-attachments";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Adds the attachment type allowing to parse difference attachment formats";
|
||||
}
|
||||
|
||||
public void onModule(SettingsModule settingsModule) {
|
||||
deprecationLogger.deprecated("[mapper-attachments] plugin has been deprecated and will be replaced by [ingest-attachment] plugin.");
|
||||
settingsModule.registerSetting(AttachmentMapper.INDEX_ATTACHMENT_DETECT_LANGUAGE_SETTING);
|
||||
|
|
|
@ -25,16 +25,6 @@ import org.elasticsearch.plugins.Plugin;
|
|||
|
||||
public class MapperMurmur3Plugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "mapper-murmur3";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "A mapper that allows to precompute murmur3 hashes of values at index-time and store them in the index";
|
||||
}
|
||||
|
||||
public void onModule(IndicesModule indicesModule) {
|
||||
indicesModule.registerMapper(Murmur3FieldMapper.CONTENT_TYPE, new Murmur3FieldMapper.TypeParser());
|
||||
}
|
||||
|
|
|
@ -25,16 +25,6 @@ import org.elasticsearch.plugins.Plugin;
|
|||
|
||||
public class MapperSizePlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "mapper-size";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "A mapper that allows document to record their uncompressed size";
|
||||
}
|
||||
|
||||
public void onModule(IndicesModule indicesModule) {
|
||||
indicesModule.registerMetadataMapper(SizeFieldMapper.NAME, new SizeFieldMapper.TypeParser());
|
||||
}
|
||||
|
|
|
@ -47,16 +47,6 @@ public class AzureRepositoryPlugin extends Plugin {
|
|||
logger.trace("starting azure repository plugin...");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "repository-azure";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Azure Repository Plugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Module> nodeModules() {
|
||||
return Collections.singletonList((Module) new AzureRepositoryModule(settings));
|
||||
|
|
|
@ -41,14 +41,6 @@ import java.util.Collection;
|
|||
public abstract class AbstractAzureRepositoryServiceIntegTestCase extends AbstractAzureIntegTestCase {
|
||||
|
||||
public static class TestPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "mock-storage-service";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "plugs in a mock storage service for testing";
|
||||
}
|
||||
public void onModule(AzureRepositoryModule azureRepositoryModule) {
|
||||
AzureRepositoryModule.storageServiceImpl = AzureStorageServiceMock.class;
|
||||
}
|
||||
|
|
|
@ -109,16 +109,6 @@ public class GoogleCloudStoragePlugin extends Plugin {
|
|||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Google Cloud Storage Repository Plugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Module> nodeModules() {
|
||||
return Collections.singletonList(new GoogleCloudStorageModule());
|
||||
|
|
|
@ -30,9 +30,9 @@ import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardRepository
|
|||
import org.elasticsearch.plugins.Plugin;
|
||||
import org.elasticsearch.repositories.RepositoriesModule;
|
||||
|
||||
// Code
|
||||
// Code
|
||||
public final class HdfsPlugin extends Plugin {
|
||||
|
||||
|
||||
// initialize some problematic classes with elevated privileges
|
||||
static {
|
||||
SecurityManager sm = System.getSecurityManager();
|
||||
|
@ -84,16 +84,6 @@ public final class HdfsPlugin extends Plugin {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "repository-hdfs";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "HDFS Repository Plugin";
|
||||
}
|
||||
|
||||
public void onModule(RepositoriesModule repositoriesModule) {
|
||||
repositoriesModule.registerRepository("hdfs", HdfsRepository.class, BlobStoreIndexShardRepository.class);
|
||||
}
|
||||
|
|
|
@ -62,16 +62,6 @@ public class S3RepositoryPlugin extends Plugin {
|
|||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "repository-s3";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "S3 Repository Plugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<Module> nodeModules() {
|
||||
Collection<Module> modules = new ArrayList<>();
|
||||
|
|
|
@ -29,14 +29,6 @@ import java.util.IdentityHashMap;
|
|||
|
||||
public class TestAwsS3Service extends InternalAwsS3Service {
|
||||
public static class TestPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "mock-s3-service";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "plugs in mock s3 service";
|
||||
}
|
||||
public void onModule(S3Module s3Module) {
|
||||
S3Module.s3ServiceImpl = TestAwsS3Service.class;
|
||||
}
|
||||
|
|
|
@ -26,16 +26,6 @@ import org.elasticsearch.plugins.Plugin;
|
|||
|
||||
public class SMBStorePlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "store-smb";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "SMB Store Plugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onIndexModule(IndexModule indexModule) {
|
||||
indexModule.addIndexStore("smb_mmap_fs", SmbMmapFsIndexStore::new);
|
||||
|
|
|
@ -52,14 +52,6 @@ import static java.util.Collections.emptySet;
|
|||
public class MockInternalClusterInfoService extends InternalClusterInfoService {
|
||||
|
||||
public static class TestPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "mock-cluster-info-service";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "a mock cluster info service for testing";
|
||||
}
|
||||
public void onModule(ClusterModule module) {
|
||||
module.clusterInfoServiceImpl = MockInternalClusterInfoService.class;
|
||||
}
|
||||
|
|
|
@ -32,14 +32,6 @@ import java.util.Collections;
|
|||
|
||||
// this must exist in the same package as IndexModule to allow access to setting the impl
|
||||
public class MockEngineFactoryPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "mock-engine-factory";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "a mock engine factory for testing";
|
||||
}
|
||||
|
||||
private Class<? extends FilterDirectoryReader> readerWrapper = AssertingDirectoryReader.class;
|
||||
|
||||
|
|
|
@ -27,16 +27,6 @@ import org.elasticsearch.plugins.Plugin;
|
|||
*/
|
||||
public class IngestTestPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "ingest-test";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Contains an ingest processor to be used in tests";
|
||||
}
|
||||
|
||||
public void onModule(NodeModule nodeModule) {
|
||||
nodeModule.registerProcessor("test", (registry) -> config ->
|
||||
new TestProcessor("id", "test", doc -> {
|
||||
|
|
|
@ -23,16 +23,6 @@ import org.elasticsearch.plugins.Plugin;
|
|||
|
||||
public class NodeMocksPlugin extends Plugin {
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return "node-mocks";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "a plugin to setup mocks for node level classes";
|
||||
}
|
||||
|
||||
public void onModule(NodeModule module) {
|
||||
module.bigArraysImpl = MockBigArrays.class;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* A dummy script engine used for testing. Scripts must be a number. Many
|
||||
* A dummy script engine used for testing. Scripts must be a number. Many
|
||||
* tests rely on the fact this thing returns a String as its compiled form.
|
||||
* they even try to serialize it over the network!
|
||||
*/
|
||||
|
@ -51,22 +51,8 @@ public class MockScriptEngine implements ScriptEngineService {
|
|||
this.params = params;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class TestPlugin extends Plugin {
|
||||
|
||||
public TestPlugin() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "Mock script engine for integration tests";
|
||||
}
|
||||
|
||||
public void onModule(ScriptModule module) {
|
||||
module.addScriptEngine(new ScriptEngineRegistry.ScriptEngineRegistration(MockScriptEngine.class,
|
||||
MockScriptEngine.NAME, true));
|
||||
|
@ -91,7 +77,7 @@ public class MockScriptEngine implements ScriptEngineService {
|
|||
|
||||
@Override
|
||||
public ExecutableScript executable(CompiledScript compiledScript, @Nullable Map<String, Object> vars) {
|
||||
assert compiledScript.compiled() instanceof MockCompiledScript
|
||||
assert compiledScript.compiled() instanceof MockCompiledScript
|
||||
: "do NOT pass compiled scripts from other engines to me, I will fail your test, got: " + compiledScript;
|
||||
return new AbstractExecutableScript() {
|
||||
@Override
|
||||
|
|
|
@ -39,14 +39,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
|
||||
public class MockSearchService extends SearchService {
|
||||
public static class TestPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "mock-search-service";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "a mock search service for testing";
|
||||
}
|
||||
public void onModule(SearchModule module) {
|
||||
module.searchServiceImpl = MockSearchService.class;
|
||||
}
|
||||
|
|
|
@ -1798,14 +1798,6 @@ public abstract class ESIntegTestCase extends ESTestCase {
|
|||
}
|
||||
|
||||
public static final class TestSeedPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "test-seed-plugin";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "a test plugin that registers index.tests.seed as an index setting";
|
||||
}
|
||||
public void onModule(SettingsModule module) {
|
||||
module.registerSetting(INDEX_TEST_SEED_SETTING);
|
||||
}
|
||||
|
|
|
@ -25,15 +25,6 @@ import org.elasticsearch.common.settings.SettingsModule;
|
|||
import org.elasticsearch.plugins.Plugin;
|
||||
|
||||
public final class InternalSettingsPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "internal-settings-plugin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String description() {
|
||||
return "a plugin that allows to set values for internal settings which are can't be set via the ordinary API without this plugin installed";
|
||||
}
|
||||
|
||||
public static final Setting<Integer> VERSION_CREATED =
|
||||
Setting.intSetting("index.version.created", 0, Property.IndexScope, Property.NodeScope);
|
||||
|
|
|
@ -52,14 +52,6 @@ public final class MockIndexEventListener {
|
|||
|
||||
public static class TestPlugin extends Plugin {
|
||||
private final TestEventListener listener = new TestEventListener();
|
||||
@Override
|
||||
public String name() {
|
||||
return "mock-index-listener";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "a mock index listener for testing only";
|
||||
}
|
||||
|
||||
/**
|
||||
* For tests to pass in to fail on listener invocation
|
||||
|
|
|
@ -49,14 +49,6 @@ public class MockFSIndexStore extends IndexStore {
|
|||
Setting.boolSetting("index.store.mock.check_index_on_close", true, Property.IndexScope, Property.NodeScope);
|
||||
|
||||
public static class TestPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "mock-index-store";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "a mock index store for testing";
|
||||
}
|
||||
@Override
|
||||
public Settings additionalSettings() {
|
||||
return Settings.builder().put(IndexModule.INDEX_STORE_TYPE_SETTING.getKey(), "mock").build();
|
||||
|
|
|
@ -47,14 +47,6 @@ import java.util.Random;
|
|||
public class AssertingLocalTransport extends LocalTransport {
|
||||
|
||||
public static class TestPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "asserting-local-transport";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "an asserting transport for testing";
|
||||
}
|
||||
public void onModule(NetworkModule module) {
|
||||
module.registerTransport("mock", AssertingLocalTransport.class);
|
||||
}
|
||||
|
|
|
@ -79,14 +79,6 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
|||
public class MockTransportService extends TransportService {
|
||||
|
||||
public static class TestPlugin extends Plugin {
|
||||
@Override
|
||||
public String name() {
|
||||
return "mock-transport-service";
|
||||
}
|
||||
@Override
|
||||
public String description() {
|
||||
return "a mock transport service for testing";
|
||||
}
|
||||
public void onModule(NetworkModule module) {
|
||||
module.registerTransportService("mock", MockTransportService.class);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue