List<NamedWriteableRegistry.Entry> entries = new ArrayList<>(); entries.addAll(NetworkModule.getNamedWriteables()); entries.addAll(searchModule.getNamedWriteables()); entries.addAll(indicesModule.getNamedWriteables()); entries.addAll(ClusterModule.getNamedWriteables());
NetworkModule.getNamedWriteables().stream(), indicesModule.getNamedWriteables().stream(), searchModule.getNamedWriteables().stream(), pluginsService.filterPlugins(Plugin.class).stream() .flatMap(p -> p.getNamedWriteables().stream()),
static NamedWriteableRegistry getNamedWriteableRegistry() { IndicesModule indicesModule = new IndicesModule(Collections.emptyList()); SearchModule searchModule = new SearchModule(Settings.EMPTY, false, Collections.emptyList()); List<NamedWriteableRegistry.Entry> entries = new ArrayList<>(); entries.addAll(indicesModule.getNamedWriteables()); entries.addAll(searchModule.getNamedWriteables()); return new NamedWriteableRegistry(entries); }
static NamedWriteableRegistry getNamedWriteableRegistry() { IndicesModule indicesModule = new IndicesModule(Collections.emptyList()); SearchModule searchModule = new SearchModule(Settings.EMPTY, false, Collections.emptyList()); List<NamedWriteableRegistry.Entry> entries = new ArrayList<>(); entries.addAll(indicesModule.getNamedWriteables()); entries.addAll(searchModule.getNamedWriteables()); return new NamedWriteableRegistry(entries); }
/** * Setup for the whole base test class. */ @Override public void setUp() throws Exception { super.setUp(); Settings settings = Settings.builder() .put("node.name", AbstractQueryTestCase.class.toString()) .put(Environment.PATH_HOME_SETTING.getKey(), createTempDir()) .build(); IndicesModule indicesModule = new IndicesModule(Collections.emptyList()); PluginsService pluginsService = new PluginsService(settings, null, null, null, getPlugins()); SearchModule searchModule = new SearchModule(settings, false, pluginsService.filterPlugins(SearchPlugin.class)); List<NamedWriteableRegistry.Entry> entries = new ArrayList<>(); entries.addAll(indicesModule.getNamedWriteables()); entries.addAll(searchModule.getNamedWriteables()); namedWriteableRegistry = new NamedWriteableRegistry(entries); xContentRegistry = new NamedXContentRegistry(searchModule.getNamedXContents()); //create some random type with some default field, those types will stick around for all of the subclasses currentTypes = new String[randomIntBetween(0, 5)]; for (int i = 0; i < currentTypes.length; i++) { String type = randomAlphaOfLengthBetween(1, 10); currentTypes[i] = type; } }
new SearchModule(Settings.EMPTY, false, emptyList()).getNamedWriteables());
List<NamedWriteableRegistry.Entry> entries = new ArrayList<>(); entries.addAll(NetworkModule.getNamedWriteables()); entries.addAll(searchModule.getNamedWriteables()); entries.addAll(indicesModule.getNamedWriteables()); entries.addAll(ClusterModule.getNamedWriteables());
List<NamedWriteableRegistry.Entry> entries = new ArrayList<>(); entries.addAll(NetworkModule.getNamedWriteables()); entries.addAll(searchModule.getNamedWriteables()); entries.addAll(ClusterModule.getNamedWriteables()); entries.addAll(pluginsService.filterPlugins(Plugin.class).stream()
List<NamedWriteableRegistry.Entry> entries = new ArrayList<>(); entries.addAll(indicesModule.getNamedWriteables()); entries.addAll(searchModule.getNamedWriteables()); namedWriteableRegistry = new NamedWriteableRegistry(entries); xContentRegistry = new NamedXContentRegistry(Stream.of(
public static void assertVersionSerializable(Version version, Streamable streamable) { /* * If possible we fetch the NamedWriteableRegistry from the test cluster. That is the only way to make sure that we properly handle * when plugins register names. If not possible we'll try and set up a registry based on whatever SearchModule registers. But that * is a hack at best - it only covers some things. If you end up with errors below and get to this comment I'm sorry. Please find * a way that sucks less. */ NamedWriteableRegistry registry; if (ESIntegTestCase.isInternalCluster() && ESIntegTestCase.internalCluster().size() > 0) { registry = ESIntegTestCase.internalCluster().getInstance(NamedWriteableRegistry.class); } else { SearchModule searchModule = new SearchModule(Settings.EMPTY, false, emptyList()); registry = new NamedWriteableRegistry(searchModule.getNamedWriteables()); } assertVersionSerializable(version, streamable, registry); }
NetworkModule.getNamedWriteables().stream(), indicesModule.getNamedWriteables().stream(), searchModule.getNamedWriteables().stream(), pluginsService.filterPlugins(Plugin.class).stream() .flatMap(p -> p.getNamedWriteables().stream()),
NetworkModule.getNamedWriteables().stream(), indicesModule.getNamedWriteables().stream(), searchModule.getNamedWriteables().stream(), pluginsService.filterPlugins(Plugin.class).stream() .flatMap(p -> p.getNamedWriteables().stream()),