From 54ae55662cd6f2f32a617903b86be60a5972bf3a Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Tue, 18 Aug 2015 14:28:03 -0700 Subject: [PATCH] Remove leftover class and fix compile issues from master merge --- .../elasticsearch/plugins/AbstractPlugin.java | 35 ------------------- .../plugins/PluginsServiceTests.java | 4 +-- .../snapshots/mockstore/MockRepository.java | 12 ++----- .../plugin/mapper/MapperMurmur3Plugin.java | 9 ++--- 4 files changed, 10 insertions(+), 50 deletions(-) delete mode 100644 core/src/main/java/org/elasticsearch/plugins/AbstractPlugin.java diff --git a/core/src/main/java/org/elasticsearch/plugins/AbstractPlugin.java b/core/src/main/java/org/elasticsearch/plugins/AbstractPlugin.java deleted file mode 100644 index e33a2774771..00000000000 --- a/core/src/main/java/org/elasticsearch/plugins/AbstractPlugin.java +++ /dev/null @@ -1,35 +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.plugins; - -import org.elasticsearch.common.component.LifecycleComponent; -import org.elasticsearch.common.inject.Module; -import org.elasticsearch.common.settings.Settings; - -import java.io.Closeable; -import java.util.Collection; -import java.util.Collections; - -/** - * A base class for a plugin which returns no services or modules. - */ -public abstract class AbstractPlugin extends Plugin { - -} diff --git a/core/src/test/java/org/elasticsearch/plugins/PluginsServiceTests.java b/core/src/test/java/org/elasticsearch/plugins/PluginsServiceTests.java index 8a1c8b14693..6ac34c2297e 100644 --- a/core/src/test/java/org/elasticsearch/plugins/PluginsServiceTests.java +++ b/core/src/test/java/org/elasticsearch/plugins/PluginsServiceTests.java @@ -25,7 +25,7 @@ import org.elasticsearch.index.store.IndexStoreModule; import org.elasticsearch.test.ESTestCase; public class PluginsServiceTests extends ESTestCase { - public static class AdditionalSettingsPlugin1 extends AbstractPlugin { + public static class AdditionalSettingsPlugin1 extends Plugin { @Override public String name() { return "additional-settings1"; @@ -39,7 +39,7 @@ public class PluginsServiceTests extends ESTestCase { return Settings.builder().put("foo.bar", "1").put(IndexStoreModule.STORE_TYPE, IndexStoreModule.Type.MMAPFS.getSettingsKey()).build(); } } - public static class AdditionalSettingsPlugin2 extends AbstractPlugin { + public static class AdditionalSettingsPlugin2 extends Plugin { @Override public String name() { return "additional-settings2"; diff --git a/core/src/test/java/org/elasticsearch/snapshots/mockstore/MockRepository.java b/core/src/test/java/org/elasticsearch/snapshots/mockstore/MockRepository.java index c346e5817bc..e430827d881 100644 --- a/core/src/test/java/org/elasticsearch/snapshots/mockstore/MockRepository.java +++ b/core/src/test/java/org/elasticsearch/snapshots/mockstore/MockRepository.java @@ -20,7 +20,6 @@ package org.elasticsearch.snapshots.mockstore; import org.elasticsearch.ElasticsearchException; -import org.elasticsearch.Version; import org.elasticsearch.cluster.ClusterService; import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.cluster.metadata.SnapshotId; @@ -37,7 +36,6 @@ import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.env.Environment; import org.elasticsearch.index.snapshots.IndexShardRepository; import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardRepository; -import org.elasticsearch.plugins.AbstractPlugin; import org.elasticsearch.repositories.RepositoriesModule; import org.elasticsearch.repositories.RepositoryName; import org.elasticsearch.repositories.RepositorySettings; @@ -50,8 +48,6 @@ import java.io.UnsupportedEncodingException; import java.nio.file.Path; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; -import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.List; @@ -64,7 +60,7 @@ import static org.elasticsearch.common.settings.Settings.settingsBuilder; public class MockRepository extends FsRepository { - public static class Plugin extends AbstractPlugin { + public static class Plugin extends org.elasticsearch.plugins.Plugin { @Override public String name() { @@ -81,10 +77,8 @@ public class MockRepository extends FsRepository { } @Override - public Collection> modules() { - Collection> modules = new ArrayList<>(); - modules.add(SettingsFilteringModule.class); - return modules; + public Collection nodeModules() { + return Collections.singletonList(new SettingsFilteringModule()); } public static class SettingsFilteringModule extends AbstractModule { diff --git a/plugins/mapper-murmur3/src/main/java/org/elasticsearch/plugin/mapper/MapperMurmur3Plugin.java b/plugins/mapper-murmur3/src/main/java/org/elasticsearch/plugin/mapper/MapperMurmur3Plugin.java index 9b6611decde..429db165b75 100644 --- a/plugins/mapper-murmur3/src/main/java/org/elasticsearch/plugin/mapper/MapperMurmur3Plugin.java +++ b/plugins/mapper-murmur3/src/main/java/org/elasticsearch/plugin/mapper/MapperMurmur3Plugin.java @@ -20,12 +20,13 @@ package org.elasticsearch.plugin.mapper; import org.elasticsearch.common.inject.Module; -import org.elasticsearch.plugins.AbstractPlugin; +import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.plugins.Plugin; import java.util.Collection; import java.util.Collections; -public class MapperMurmur3Plugin extends AbstractPlugin { +public class MapperMurmur3Plugin extends Plugin { @Override public String name() { @@ -38,8 +39,8 @@ public class MapperMurmur3Plugin extends AbstractPlugin { } @Override - public Collection> indexModules() { - return Collections.>singleton(MapperMurmur3IndexModule.class); + public Collection indexModules(Settings settings) { + return Collections.singletonList(new MapperMurmur3IndexModule()); } }