diff --git a/core/src/main/java/org/elasticsearch/indices/IndicesModule.java b/core/src/main/java/org/elasticsearch/indices/IndicesModule.java index 8cedea931c0..885e2d78eca 100644 --- a/core/src/main/java/org/elasticsearch/indices/IndicesModule.java +++ b/core/src/main/java/org/elasticsearch/indices/IndicesModule.java @@ -19,10 +19,12 @@ package org.elasticsearch.indices; +import org.elasticsearch.action.admin.indices.rollover.Condition; import org.elasticsearch.action.update.UpdateHelper; import org.elasticsearch.cluster.metadata.MetaDataIndexUpgradeService; import org.elasticsearch.common.geo.ShapesAvailability; import org.elasticsearch.common.inject.AbstractModule; +import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.index.NodeServicesProvider; import org.elasticsearch.index.mapper.Mapper; import org.elasticsearch.index.mapper.MetadataFieldMapper; @@ -74,10 +76,18 @@ public class IndicesModule extends AbstractModule { // Use a LinkedHashMap for metadataMappers because iteration order matters private final Map metadataMapperParsers = new LinkedHashMap<>(); + private final NamedWriteableRegistry namedWritableRegistry; - public IndicesModule() { + public IndicesModule(NamedWriteableRegistry namedWriteableRegistry) { + this.namedWritableRegistry = namedWriteableRegistry; registerBuiltInMappers(); registerBuiltInMetadataMappers(); + registerBuildInWritables(); + } + + private void registerBuildInWritables() { + namedWritableRegistry.register(Condition.class, Condition.MaxAge.NAME, Condition.MaxAge::new); + namedWritableRegistry.register(Condition.class, Condition.MaxDocs.NAME, Condition.MaxDocs::new); } private void registerBuiltInMappers() { diff --git a/core/src/main/java/org/elasticsearch/node/Node.java b/core/src/main/java/org/elasticsearch/node/Node.java index cf33770fd16..ad287549931 100644 --- a/core/src/main/java/org/elasticsearch/node/Node.java +++ b/core/src/main/java/org/elasticsearch/node/Node.java @@ -235,7 +235,7 @@ public class Node implements Closeable { modules.add(new ThreadPoolModule(threadPool)); modules.add(new DiscoveryModule(this.settings)); modules.add(new ClusterModule(this.settings)); - modules.add(new IndicesModule()); + modules.add(new IndicesModule(namedWriteableRegistry)); modules.add(new SearchModule(settings, namedWriteableRegistry)); modules.add(new ActionModule(DiscoveryNode.isIngestNode(settings), false)); modules.add(new GatewayModule(settings)); diff --git a/core/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverIT.java b/core/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverIT.java index f80543fd7c2..3ab9c8cc040 100644 --- a/core/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverIT.java +++ b/core/src/test/java/org/elasticsearch/action/admin/indices/rollover/RolloverIT.java @@ -22,6 +22,7 @@ package org.elasticsearch.action.admin.indices.rollover; import org.elasticsearch.action.admin.indices.alias.Alias; import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.metadata.IndexMetaData; +import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.test.ESIntegTestCase; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked; @@ -61,7 +62,7 @@ public class RolloverIT extends ESIntegTestCase { index("test_index", "type1", "1", "field", "value"); flush("test_index"); final RolloverResponse response = client().admin().indices().prepareRolloverIndex("test_alias") - .addMaxIndexAgeCondition("7d").get(); + .addMaxIndexAgeCondition(TimeValue.timeValueHours(4)).get(); assertThat(response.getOldIndex(), equalTo("test_index")); assertThat(response.getNewIndex(), equalTo("test_index")); final ClusterState state = client().admin().cluster().prepareState().get().getState(); @@ -71,22 +72,6 @@ public class RolloverIT extends ESIntegTestCase { assertNull(newIndex); } - public void testRolloverWithOptionalTargetAlias() throws Exception { - assertAcked(prepareCreate("test_index").addAlias(new Alias("test_alias")).get()); - index("test_index", "type1", "1", "field", "value"); - flush("test_index"); - final RolloverResponse response = client().admin().indices().prepareRolloverIndex("test_alias") - .setOptionalTargetAlias("test_alias_2").get(); - assertThat(response.getOldIndex(), equalTo("test_index")); - assertThat(response.getNewIndex(), equalTo("test_index-1")); - final ClusterState state = client().admin().cluster().prepareState().get().getState(); - final IndexMetaData oldIndex = state.metaData().index("test_index"); - assertFalse(oldIndex.getAliases().containsKey("test_alias")); - final IndexMetaData newIndex = state.metaData().index("test_index-1"); - assertTrue(newIndex.getAliases().containsKey("test_alias")); - assertTrue(newIndex.getAliases().containsKey("test_alias_2")); - } - public void testRolloverOnExistingIndex() throws Exception { assertAcked(prepareCreate("test_index").addAlias(new Alias("test_alias")).get()); index("test_index", "type1", "1", "field", "value"); diff --git a/core/src/test/java/org/elasticsearch/action/admin/indices/rollover/TransportRolloverActionTests.java b/core/src/test/java/org/elasticsearch/action/admin/indices/rollover/TransportRolloverActionTests.java index 959f0d81bf0..ff121ff3dfb 100644 --- a/core/src/test/java/org/elasticsearch/action/admin/indices/rollover/TransportRolloverActionTests.java +++ b/core/src/test/java/org/elasticsearch/action/admin/indices/rollover/TransportRolloverActionTests.java @@ -27,59 +27,49 @@ import org.elasticsearch.cluster.metadata.IndexMetaData; import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.common.UUIDs; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.common.unit.TimeValue; +import org.elasticsearch.common.util.set.Sets; import org.elasticsearch.test.ESTestCase; -import java.util.Arrays; import java.util.Collections; -import java.util.List; +import java.util.Set; -import static org.hamcrest.Matchers.anyOf; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.not; public class TransportRolloverActionTests extends ESTestCase { public void testSatisfyConditions() throws Exception { - List conditions = Collections.emptyList(); - assertTrue(TransportRolloverAction.satisfiesConditions(conditions, randomLong(), randomLong(), + Set conditions = Collections.emptySet(); + assertTrue(TransportRolloverAction.satisfiesConditions(conditions, randomLong(), randomLong())); - conditions = Collections.singletonList( - new Condition(Condition.ConditionType.MAX_AGE, 10L)); - assertTrue(TransportRolloverAction.satisfiesConditions(conditions, randomLong(), randomLong(), - System.currentTimeMillis() - randomIntBetween(10, 100))); - assertFalse(TransportRolloverAction.satisfiesConditions(conditions, randomLong(), randomLong(), - System.currentTimeMillis() - randomIntBetween(1, 9))); + conditions = Collections.singleton(new Condition.MaxAge(TimeValue.timeValueMillis(10))); + assertTrue(TransportRolloverAction.satisfiesConditions(conditions, randomLong(), + TimeValue.timeValueMillis(randomIntBetween(10, 100)).getMillis())); + assertFalse(TransportRolloverAction.satisfiesConditions(conditions, randomLong(), + TimeValue.timeValueMillis(randomIntBetween(0, 9)).getMillis())); - conditions = Collections.singletonList( - new Condition(Condition.ConditionType.MAX_SIZE, 10L)); - assertTrue(TransportRolloverAction.satisfiesConditions(conditions, randomLong(), randomIntBetween(10, 100), + conditions = Collections.singleton(new Condition.MaxDocs(10L)); + assertTrue(TransportRolloverAction.satisfiesConditions(conditions, randomIntBetween(10, 100), randomLong())); - assertFalse(TransportRolloverAction.satisfiesConditions(conditions, randomLong(), randomIntBetween(1, 9), + assertFalse(TransportRolloverAction.satisfiesConditions(conditions, randomIntBetween(1, 9), randomLong())); - conditions = Collections.singletonList( - new Condition(Condition.ConditionType.MAX_DOCS, 10L)); - assertTrue(TransportRolloverAction.satisfiesConditions(conditions, randomIntBetween(10, 100), randomLong(), - randomLong())); - assertFalse(TransportRolloverAction.satisfiesConditions(conditions, randomIntBetween(1, 9), randomLong(), - randomLong())); - - conditions = Arrays.asList(new Condition(Condition.ConditionType.MAX_AGE, 100L), - new Condition(Condition.ConditionType.MAX_DOCS, 1000L)); + conditions = Sets.newHashSet(new Condition.MaxAge(TimeValue.timeValueMillis(100)), new Condition.MaxDocs(1000L)); assertTrue(TransportRolloverAction.satisfiesConditions(conditions, randomIntBetween(1000, 1500), - randomLong(), System.currentTimeMillis() - randomIntBetween(100, 500))); + TimeValue.timeValueMillis(randomIntBetween(100, 1000)).getMillis())); assertFalse(TransportRolloverAction.satisfiesConditions(conditions, randomIntBetween(1, 999), - randomLong(), System.currentTimeMillis() - randomIntBetween(100, 500))); + TimeValue.timeValueMillis(randomIntBetween(100, 1000)).getMillis())); assertFalse(TransportRolloverAction.satisfiesConditions(conditions, randomIntBetween(1000, 1500), - randomLong(), System.currentTimeMillis() - randomIntBetween(1, 99))); + TimeValue.timeValueMillis(randomIntBetween(0, 99)).getMillis())); } public void testCreateUpdateAliasRequest() throws Exception { String sourceAlias = randomAsciiOfLength(10); String sourceIndex = randomAsciiOfLength(10); String targetIndex = randomAsciiOfLength(10); - final RolloverRequest rolloverRequest = new RolloverRequest(sourceAlias, null); + final RolloverRequest rolloverRequest = new RolloverRequest(sourceAlias); final IndicesAliasesClusterStateUpdateRequest updateRequest = TransportRolloverAction.prepareIndicesAliasesRequest(sourceIndex, targetIndex, rolloverRequest); @@ -102,35 +92,6 @@ public class TransportRolloverActionTests extends ESTestCase { assertTrue(foundRemove); } - public void testCreateUpdateAliasRequestWithOptionalTargetAlias() throws Exception { - String sourceAlias = randomAsciiOfLength(10); - String optionalTargetAlias = randomAsciiOfLength(10); - String sourceIndex = randomAsciiOfLength(10); - String targetIndex = randomAsciiOfLength(10); - final RolloverRequest rolloverRequest = new RolloverRequest(sourceAlias, optionalTargetAlias); - final IndicesAliasesClusterStateUpdateRequest updateRequest = - TransportRolloverAction.prepareIndicesAliasesRequest(sourceIndex, targetIndex, rolloverRequest); - - final AliasAction[] actions = updateRequest.actions(); - assertThat(actions.length, equalTo(3)); - boolean foundAdd = false; - boolean foundRemove = false; - for (AliasAction action : actions) { - if (action.actionType() == AliasAction.Type.ADD) { - foundAdd = true; - assertThat(action.index(), equalTo(targetIndex)); - assertThat(action.alias(), anyOf(equalTo(sourceAlias), - equalTo(optionalTargetAlias))); - } else if (action.actionType() == AliasAction.Type.REMOVE) { - foundRemove = true; - assertThat(action.index(), equalTo(sourceIndex)); - assertThat(action.alias(), equalTo(sourceAlias)); - } - } - assertTrue(foundAdd); - assertTrue(foundRemove); - } - public void testValidation() throws Exception { String index1 = randomAsciiOfLength(10); String alias = randomAsciiOfLength(10); @@ -154,31 +115,27 @@ public class TransportRolloverActionTests extends ESTestCase { ).build(); try { - TransportRolloverAction.validate(metaData, new RolloverRequest(aliasWithMultipleIndices, - randomBoolean() ? null : randomAsciiOfLength(10))); + TransportRolloverAction.validate(metaData, new RolloverRequest(aliasWithMultipleIndices)); fail("expected to throw exception"); } catch (IllegalArgumentException e) { assertThat(e.getMessage(), equalTo("source alias maps to multiple indices")); } try { - TransportRolloverAction.validate(metaData, new RolloverRequest(randomFrom(index1, index2), - randomBoolean() ? null : randomAsciiOfLength(10))); + TransportRolloverAction.validate(metaData, new RolloverRequest(randomFrom(index1, index2))); fail("expected to throw exception"); } catch (IllegalArgumentException e) { assertThat(e.getMessage(), equalTo("source alias is a concrete index")); } try { - TransportRolloverAction.validate(metaData, new RolloverRequest(randomAsciiOfLength(5), - randomBoolean() ? null : randomAsciiOfLength(10))); + TransportRolloverAction.validate(metaData, new RolloverRequest(randomAsciiOfLength(5))); fail("expected to throw exception"); } catch (IllegalArgumentException e) { assertThat(e.getMessage(), equalTo("source alias does not exist")); } - TransportRolloverAction.validate(metaData, new RolloverRequest(alias, - randomBoolean() ? null : randomAsciiOfLength(10))); + TransportRolloverAction.validate(metaData, new RolloverRequest(alias)); } public void testGenerateRolloverIndexName() throws Exception { diff --git a/core/src/test/java/org/elasticsearch/index/IndexModuleTests.java b/core/src/test/java/org/elasticsearch/index/IndexModuleTests.java index 38b7341cd24..6078b0a8a17 100644 --- a/core/src/test/java/org/elasticsearch/index/IndexModuleTests.java +++ b/core/src/test/java/org/elasticsearch/index/IndexModuleTests.java @@ -35,6 +35,7 @@ import org.elasticsearch.Version; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.metadata.IndexMetaData; import org.elasticsearch.cluster.service.ClusterService; +import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.test.ClusterServiceUtils; import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Setting.Property; @@ -134,7 +135,7 @@ public class IndexModuleTests extends ESTestCase { environment = new Environment(settings); nodeServicesProvider = newNodeServiceProvider(settings, environment, null); nodeEnvironment = new NodeEnvironment(settings, environment); - mapperRegistry = new IndicesModule().getMapperRegistry(); + mapperRegistry = new IndicesModule(new NamedWriteableRegistry()).getMapperRegistry(); } @Override diff --git a/core/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java b/core/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java index 51df3ee0386..7dd60de6c40 100644 --- a/core/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java +++ b/core/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java @@ -58,6 +58,7 @@ import org.elasticsearch.common.Nullable; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.io.FileSystemUtils; +import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.logging.ESLogger; import org.elasticsearch.common.lucene.Lucene; import org.elasticsearch.common.lucene.uid.Versions; @@ -2015,7 +2016,7 @@ public class InternalEngineTests extends ESTestCase { IndexSettings indexSettings = IndexSettingsModule.newIndexSettings(index, settings); AnalysisService analysisService = new AnalysisService(indexSettings, Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap()); SimilarityService similarityService = new SimilarityService(indexSettings, Collections.emptyMap()); - MapperRegistry mapperRegistry = new IndicesModule().getMapperRegistry(); + MapperRegistry mapperRegistry = new IndicesModule(new NamedWriteableRegistry()).getMapperRegistry(); MapperService mapperService = new MapperService(indexSettings, analysisService, similarityService, mapperRegistry, () -> null); DocumentMapper.Builder b = new DocumentMapper.Builder(rootBuilder, mapperService); this.docMapper = b.build(mapperService); diff --git a/core/src/test/java/org/elasticsearch/index/mapper/internal/FieldNamesFieldMapperTests.java b/core/src/test/java/org/elasticsearch/index/mapper/internal/FieldNamesFieldMapperTests.java index cd7f46844fc..2ec5aee9d15 100644 --- a/core/src/test/java/org/elasticsearch/index/mapper/internal/FieldNamesFieldMapperTests.java +++ b/core/src/test/java/org/elasticsearch/index/mapper/internal/FieldNamesFieldMapperTests.java @@ -24,6 +24,7 @@ import org.apache.lucene.index.IndexOptions; import org.apache.lucene.index.IndexableField; import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.compress.CompressedXContent; +import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.IndexService; @@ -234,7 +235,7 @@ public class FieldNamesFieldMapperTests extends ESSingleNodeTestCase { public void testSeesFieldsFromPlugins() throws IOException { IndexService indexService = createIndex("test"); - IndicesModule indicesModule = new IndicesModule(); + IndicesModule indicesModule = new IndicesModule(new NamedWriteableRegistry()); indicesModule.registerMetadataMapper("_dummy", new DummyMetadataFieldMapper.TypeParser()); final MapperRegistry mapperRegistry = indicesModule.getMapperRegistry(); MapperService mapperService = new MapperService(indexService.getIndexSettings(), indexService.analysisService(), indexService.similarityService(), mapperRegistry, indexService::newQueryShardContext); diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/AggregatorParsingTests.java b/core/src/test/java/org/elasticsearch/search/aggregations/AggregatorParsingTests.java index 8801b3da45e..09c16e4ae46 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/AggregatorParsingTests.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/AggregatorParsingTests.java @@ -151,7 +151,7 @@ public class AggregatorParsingTests extends ESTestCase { }; scriptModule.prepareSettings(settingsModule); injector = new ModulesBuilder().add(new EnvironmentModule(new Environment(settings)), settingsModule, - new ThreadPoolModule(threadPool), scriptModule, new IndicesModule() { + new ThreadPoolModule(threadPool), scriptModule, new IndicesModule(namedWriteableRegistry) { @Override protected void configure() { diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/BaseAggregationTestCase.java b/core/src/test/java/org/elasticsearch/search/aggregations/BaseAggregationTestCase.java index c81ee0bb9c2..d43c54a0e09 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/BaseAggregationTestCase.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/BaseAggregationTestCase.java @@ -169,7 +169,7 @@ public abstract class BaseAggregationTestCase contextFactory.get()); IndicesFieldDataCache cache = new IndicesFieldDataCache(settings, new IndexFieldDataCache.Listener() {}); diff --git a/plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/AttachmentUnitTestCase.java b/plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/AttachmentUnitTestCase.java index 2d55587961b..e0d5d7a2ec6 100644 --- a/plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/AttachmentUnitTestCase.java +++ b/plugins/mapper-attachments/src/test/java/org/elasticsearch/mapper/attachments/AttachmentUnitTestCase.java @@ -21,6 +21,7 @@ package org.elasticsearch.mapper.attachments; import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetaData; +import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; import org.elasticsearch.indices.IndicesModule; @@ -32,7 +33,7 @@ public abstract class AttachmentUnitTestCase extends ESTestCase { protected Settings testSettings; protected static IndicesModule getIndicesModuleWithRegisteredAttachmentMapper() { - IndicesModule indicesModule = new IndicesModule(); + IndicesModule indicesModule = new IndicesModule(new NamedWriteableRegistry()); indicesModule.registerMapper(AttachmentMapper.CONTENT_TYPE, new AttachmentMapper.TypeParser()); return indicesModule; } diff --git a/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java b/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java index 352d84e975a..ce44fef59a5 100644 --- a/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java +++ b/plugins/mapper-size/src/test/java/org/elasticsearch/index/mapper/size/SizeMappingTests.java @@ -21,6 +21,7 @@ package org.elasticsearch.index.mapper.size; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.compress.CompressedXContent; +import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.xcontent.XContentFactory; import org.elasticsearch.index.IndexService; import org.elasticsearch.index.mapper.DocumentMapper; @@ -47,7 +48,7 @@ public class SizeMappingTests extends ESSingleNodeTestCase { @Before public void before() { indexService = createIndex("test"); - IndicesModule indices = new IndicesModule(); + IndicesModule indices = new IndicesModule(new NamedWriteableRegistry()); indices.registerMetadataMapper(SizeFieldMapper.NAME, new SizeFieldMapper.TypeParser()); mapperService = new MapperService(indexService.getIndexSettings(), indexService.analysisService(), indexService.similarityService(), indices.getMapperRegistry(), indexService::newQueryShardContext); parser = mapperService.documentMapperParser(); diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.rollover.json b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.rollover.json index 494ff408273..f7b1fdc010a 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/indices.rollover.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/indices.rollover.json @@ -3,18 +3,13 @@ "documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/indices-rollover-index.html", "methods": ["PUT", "POST"], "url": { - "path": "/{alias}/_rollover/{target_alias}", - "paths": ["/{alias}/_rollover/{target_alias}"], + "path": "/{alias}/_rollover", + "paths": ["/{alias}/_rollover", "/{alias}/_rollover/{target_alias}"], "parts": { "alias": { "type" : "string", "required" : true, "description" : "The name of the alias to rollover" - }, - "target_alias": { - "type" : "string", - "required" : false, - "description" : "The name of optional target alias" } }, "params": { diff --git a/test/framework/src/main/java/org/elasticsearch/index/MapperTestUtils.java b/test/framework/src/main/java/org/elasticsearch/index/MapperTestUtils.java index b2b172e88ba..fe434246035 100644 --- a/test/framework/src/main/java/org/elasticsearch/index/MapperTestUtils.java +++ b/test/framework/src/main/java/org/elasticsearch/index/MapperTestUtils.java @@ -21,6 +21,7 @@ package org.elasticsearch.index; import org.elasticsearch.Version; import org.elasticsearch.cluster.metadata.IndexMetaData; +import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.env.Environment; import org.elasticsearch.index.analysis.AnalysisRegistry; @@ -39,7 +40,7 @@ import java.util.Collections; public class MapperTestUtils { public static MapperService newMapperService(Path tempDir, Settings indexSettings) throws IOException { - IndicesModule indicesModule = new IndicesModule(); + IndicesModule indicesModule = new IndicesModule(new NamedWriteableRegistry()); return newMapperService(tempDir, indexSettings, indicesModule); } diff --git a/test/framework/src/main/java/org/elasticsearch/test/AbstractQueryTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/AbstractQueryTestCase.java index c27617a7287..db086cf16e1 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/AbstractQueryTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/AbstractQueryTestCase.java @@ -934,7 +934,7 @@ public abstract class AbstractQueryTestCase> new EnvironmentModule(new Environment(settings)), settingsModule, new ThreadPoolModule(threadPool), - new IndicesModule() { + new IndicesModule(namedWriteableRegistry) { @Override public void configure() { // skip services