update lists, rename stuff to be clearer, remove public method that is unused

This commit is contained in:
Robert Muir 2015-12-04 01:43:07 -05:00
parent 7160c5ec15
commit 699b140d69
7 changed files with 17 additions and 21 deletions

View File

@ -72,14 +72,14 @@ public class NodeInfo extends BaseNodeResponse {
private HttpInfo http;
@Nullable
private PluginsInfo plugins;
private PluginsAndModules plugins;
NodeInfo() {
}
public NodeInfo(Version version, Build build, DiscoveryNode node, @Nullable Map<String, String> serviceAttributes, @Nullable Settings settings,
@Nullable OsInfo os, @Nullable ProcessInfo process, @Nullable JvmInfo jvm, @Nullable ThreadPoolInfo threadPool,
@Nullable TransportInfo transport, @Nullable HttpInfo http, @Nullable PluginsInfo plugins) {
@Nullable TransportInfo transport, @Nullable HttpInfo http, @Nullable PluginsAndModules plugins) {
super(node);
this.version = version;
this.build = build;
@ -172,7 +172,7 @@ public class NodeInfo extends BaseNodeResponse {
}
@Nullable
public PluginsInfo getPlugins() {
public PluginsAndModules getPlugins() {
return this.plugins;
}
@ -217,7 +217,7 @@ public class NodeInfo extends BaseNodeResponse {
http = HttpInfo.readHttpInfo(in);
}
if (in.readBoolean()) {
plugins = new PluginsInfo();
plugins = new PluginsAndModules();
plugins.readFrom(in);
}
}

View File

@ -34,11 +34,11 @@ import java.util.List;
/**
* Information about plugins and modules
*/
public class PluginsInfo implements Streamable, ToXContent {
public class PluginsAndModules implements Streamable, ToXContent {
private List<PluginInfo> plugins;
private List<PluginInfo> modules;
public PluginsInfo() {
public PluginsAndModules() {
plugins = new ArrayList<>();
modules = new ArrayList<>();
}

View File

@ -26,7 +26,7 @@ import org.apache.lucene.codecs.Codec;
import org.apache.lucene.codecs.DocValuesFormat;
import org.apache.lucene.codecs.PostingsFormat;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.action.admin.cluster.node.info.PluginsInfo;
import org.elasticsearch.action.admin.cluster.node.info.PluginsAndModules;
import org.elasticsearch.bootstrap.JarHell;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.collect.Tuple;
@ -68,7 +68,7 @@ public class PluginsService extends AbstractComponent {
* We keep around a list of plugins and modules
*/
private final List<Tuple<PluginInfo, Plugin>> plugins;
private final PluginsInfo info;
private final PluginsAndModules info;
private final Map<Plugin, List<OnModuleReference>> onModuleReferences;
@ -91,7 +91,7 @@ public class PluginsService extends AbstractComponent {
*/
public PluginsService(Settings settings, Path modulesDirectory, Path pluginsDirectory, Collection<Class<? extends Plugin>> classpathPlugins) {
super(settings);
info = new PluginsInfo();
info = new PluginsAndModules();
List<Tuple<PluginInfo, Plugin>> pluginsLoaded = new ArrayList<>();
@ -191,7 +191,7 @@ public class PluginsService extends AbstractComponent {
this.onModuleReferences = Collections.unmodifiableMap(onModuleReferences);
}
public List<Tuple<PluginInfo, Plugin>> plugins() {
private List<Tuple<PluginInfo, Plugin>> plugins() {
return plugins;
}
@ -262,9 +262,9 @@ public class PluginsService extends AbstractComponent {
}
}
/**
* Get information about plugins (jvm and site plugins).
* Get information about plugins and modules
*/
public PluginsInfo info() {
public PluginsAndModules info() {
return info;
}

View File

@ -43,8 +43,6 @@ OFFICIAL PLUGINS
- discovery-ec2
- discovery-gce
- discovery-multicast
- lang-expression
- lang-groovy
- lang-javascript
- lang-python
- mapper-attachments

View File

@ -20,7 +20,7 @@
package org.elasticsearch.plugins;
import org.elasticsearch.Version;
import org.elasticsearch.action.admin.cluster.node.info.PluginsInfo;
import org.elasticsearch.action.admin.cluster.node.info.PluginsAndModules;
import org.elasticsearch.test.ESTestCase;
import java.io.IOException;
@ -259,7 +259,7 @@ public class PluginInfoTests extends ESTestCase {
}
public void testPluginListSorted() {
PluginsInfo pluginsInfo = new PluginsInfo();
PluginsAndModules pluginsInfo = new PluginsAndModules();
pluginsInfo.addPlugin(new PluginInfo("c", "foo", true, "dummy", true, "dummyclass", true));
pluginsInfo.addPlugin(new PluginInfo("b", "foo", true, "dummy", true, "dummyclass", true));
pluginsInfo.addPlugin(new PluginInfo("e", "foo", true, "dummy", true, "dummyclass", true));

View File

@ -630,8 +630,6 @@ public class PluginManagerTests extends ESIntegTestCase {
PluginManager.checkForOfficialPlugins("analysis-smartcn");
PluginManager.checkForOfficialPlugins("analysis-stempel");
PluginManager.checkForOfficialPlugins("delete-by-query");
PluginManager.checkForOfficialPlugins("lang-expression");
PluginManager.checkForOfficialPlugins("lang-groovy");
PluginManager.checkForOfficialPlugins("lang-javascript");
PluginManager.checkForOfficialPlugins("lang-python");
PluginManager.checkForOfficialPlugins("mapper-attachments");

View File

@ -30,7 +30,7 @@ import org.elasticsearch.action.ShardOperationFailedException;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequestBuilder;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoResponse;
import org.elasticsearch.action.admin.cluster.node.info.PluginsInfo;
import org.elasticsearch.action.admin.cluster.node.info.PluginsAndModules;
import org.elasticsearch.action.admin.indices.alias.exists.AliasesExistResponse;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequestBuilder;
import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse;
@ -741,7 +741,7 @@ public class ElasticsearchAssertions {
Assert.assertThat(response.getNodesMap().get(nodeId), notNullValue());
PluginsInfo plugins = response.getNodesMap().get(nodeId).getPlugins();
PluginsAndModules plugins = response.getNodesMap().get(nodeId).getPlugins();
Assert.assertThat(plugins, notNullValue());
List<String> pluginNames = filterAndMap(plugins, jvmPluginPredicate, nameFunction);
@ -791,7 +791,7 @@ public class ElasticsearchAssertions {
}
}
private static List<String> filterAndMap(PluginsInfo pluginsInfo, Predicate<PluginInfo> predicate, Function<PluginInfo, String> function) {
private static List<String> filterAndMap(PluginsAndModules pluginsInfo, Predicate<PluginInfo> predicate, Function<PluginInfo, String> function) {
return pluginsInfo.getPluginInfos().stream().filter(predicate).map(function).collect(Collectors.toList());
}