diff --git a/src/main/java/org/elasticsearch/index/IndexService.java b/src/main/java/org/elasticsearch/index/IndexService.java index d0471a34d1e..c8fecf03d67 100644 --- a/src/main/java/org/elasticsearch/index/IndexService.java +++ b/src/main/java/org/elasticsearch/index/IndexService.java @@ -32,7 +32,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.CountDown; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.env.ShardLock; -import org.elasticsearch.index.*; import org.elasticsearch.index.aliases.IndexAliasesService; import org.elasticsearch.index.analysis.AnalysisService; import org.elasticsearch.index.cache.IndexCache; @@ -43,7 +42,6 @@ import org.elasticsearch.index.cache.query.ShardQueryCacheModule; import org.elasticsearch.index.deletionpolicy.DeletionPolicyModule; import org.elasticsearch.index.engine.Engine; import org.elasticsearch.index.engine.EngineModule; -import org.elasticsearch.index.engine.IndexEngine; import org.elasticsearch.index.fielddata.IndexFieldDataService; import org.elasticsearch.index.fielddata.ShardFieldDataModule; import org.elasticsearch.index.gateway.IndexGateway; @@ -62,10 +60,10 @@ import org.elasticsearch.index.query.IndexQueryParserService; import org.elasticsearch.index.search.stats.ShardSearchModule; import org.elasticsearch.index.settings.IndexSettings; import org.elasticsearch.index.settings.IndexSettingsService; +import org.elasticsearch.index.shard.IndexShard; import org.elasticsearch.index.shard.IndexShardCreationException; import org.elasticsearch.index.shard.IndexShardModule; import org.elasticsearch.index.shard.ShardId; -import org.elasticsearch.index.shard.IndexShard; import org.elasticsearch.index.similarity.SimilarityService; import org.elasticsearch.index.snapshots.IndexShardSnapshotModule; import org.elasticsearch.index.store.IndexStore; @@ -123,8 +121,6 @@ public class IndexService extends AbstractIndexComponent implements IndexCompone private final BitsetFilterCache bitsetFilterCache; - private final IndexEngine indexEngine; - private final IndexGateway indexGateway; private final IndexStore indexStore; @@ -142,9 +138,9 @@ public class IndexService extends AbstractIndexComponent implements IndexCompone @Inject public IndexService(Injector injector, Index index, @IndexSettings Settings indexSettings, NodeEnvironment nodeEnv, AnalysisService analysisService, MapperService mapperService, IndexQueryParserService queryParserService, - SimilarityService similarityService, IndexAliasesService aliasesService, IndexCache indexCache, IndexEngine indexEngine, - IndexGateway indexGateway, IndexStore indexStore, IndexSettingsService settingsService, IndexFieldDataService indexFieldData, - BitsetFilterCache bitSetFilterCache) { + SimilarityService similarityService, IndexAliasesService aliasesService, IndexCache indexCache, + IndexGateway indexGateway, IndexStore indexStore, IndexSettingsService settingsService, + IndexFieldDataService indexFieldData, BitsetFilterCache bitSetFilterCache) { super(index, indexSettings); this.injector = injector; this.indexSettings = indexSettings; @@ -155,7 +151,6 @@ public class IndexService extends AbstractIndexComponent implements IndexCompone this.aliasesService = aliasesService; this.indexCache = indexCache; this.indexFieldData = indexFieldData; - this.indexEngine = indexEngine; this.indexGateway = indexGateway; this.indexStore = indexStore; this.settingsService = settingsService; @@ -254,10 +249,6 @@ public class IndexService extends AbstractIndexComponent implements IndexCompone return aliasesService; } - public IndexEngine engine() { - return indexEngine; - } - public synchronized void close(final String reason, final IndicesService.IndexCloseListener listener) { if (closed.compareAndSet(false, true)) { final Set shardIds = shardIds(); diff --git a/src/main/java/org/elasticsearch/index/engine/EngineModule.java b/src/main/java/org/elasticsearch/index/engine/EngineModule.java index dcf91297b2a..e3ce6ec041f 100644 --- a/src/main/java/org/elasticsearch/index/engine/EngineModule.java +++ b/src/main/java/org/elasticsearch/index/engine/EngineModule.java @@ -25,12 +25,16 @@ import org.elasticsearch.common.inject.Module; import org.elasticsearch.common.inject.Modules; import org.elasticsearch.common.inject.SpawnModules; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.index.engine.internal.InternalEngineModule; /** * */ public class EngineModule extends AbstractModule implements SpawnModules { + public static final String ENGINE_TYPE = "index.engine.type"; + public static final Class DEFAULT_ENGINE = InternalEngineModule.class; + private final Settings settings; public EngineModule(Settings settings) { @@ -39,7 +43,8 @@ public class EngineModule extends AbstractModule implements SpawnModules { @Override public Iterable spawnModules() { - return ImmutableList.of(Modules.createModule(settings.getAsClass(IndexEngineModule.EngineSettings.ENGINE_TYPE, IndexEngineModule.EngineSettings.DEFAULT_ENGINE, "org.elasticsearch.index.engine.", "EngineModule"), settings)); + return ImmutableList.of(Modules.createModule(settings.getAsClass(ENGINE_TYPE, DEFAULT_ENGINE, + "org.elasticsearch.index.engine.", "EngineModule"), settings)); } @Override diff --git a/src/main/java/org/elasticsearch/index/engine/IndexEngine.java b/src/main/java/org/elasticsearch/index/engine/IndexEngine.java deleted file mode 100644 index 2be6009de0b..00000000000 --- a/src/main/java/org/elasticsearch/index/engine/IndexEngine.java +++ /dev/null @@ -1,33 +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.index.engine; - -import org.elasticsearch.index.IndexComponent; - -/** - * An "index" scoped engine that provides some meta engine for the engine, and can be used to store - * index level data structures that an engine requires. - * - * - */ -public interface IndexEngine extends IndexComponent { - - void close(); -} diff --git a/src/main/java/org/elasticsearch/index/engine/IndexEngineModule.java b/src/main/java/org/elasticsearch/index/engine/IndexEngineModule.java deleted file mode 100644 index 3ceaf8e780b..00000000000 --- a/src/main/java/org/elasticsearch/index/engine/IndexEngineModule.java +++ /dev/null @@ -1,58 +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.index.engine; - -import com.google.common.collect.ImmutableList; -import org.elasticsearch.common.inject.AbstractModule; -import org.elasticsearch.common.inject.Module; -import org.elasticsearch.common.inject.SpawnModules; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.engine.internal.InternalEngineModule; -import org.elasticsearch.index.engine.internal.InternalIndexEngineModule; - -import static org.elasticsearch.common.inject.Modules.createModule; - -/** - * - */ -public class IndexEngineModule extends AbstractModule implements SpawnModules { - - public static final class EngineSettings { - public static final String ENGINE_TYPE = "index.engine.type"; - public static final String INDEX_ENGINE_TYPE = "index.index_engine.type"; - public static final Class DEFAULT_INDEX_ENGINE = InternalIndexEngineModule.class; - public static final Class DEFAULT_ENGINE = InternalEngineModule.class; - } - - private final Settings settings; - - public IndexEngineModule(Settings settings) { - this.settings = settings; - } - - @Override - public Iterable spawnModules() { - return ImmutableList.of(createModule(settings.getAsClass(EngineSettings.INDEX_ENGINE_TYPE, EngineSettings.DEFAULT_INDEX_ENGINE, "org.elasticsearch.index.engine.", "IndexEngineModule"), settings)); - } - - @Override - protected void configure() { - } -} \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/index/engine/internal/InternalIndexEngine.java b/src/main/java/org/elasticsearch/index/engine/internal/InternalIndexEngine.java deleted file mode 100644 index 5a82e176f12..00000000000 --- a/src/main/java/org/elasticsearch/index/engine/internal/InternalIndexEngine.java +++ /dev/null @@ -1,48 +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.index.engine.internal; - -import org.elasticsearch.common.inject.Inject; -import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.AbstractIndexComponent; -import org.elasticsearch.index.Index; -import org.elasticsearch.index.engine.IndexEngine; -import org.elasticsearch.index.settings.IndexSettings; - -import static org.elasticsearch.common.settings.ImmutableSettings.Builder.EMPTY_SETTINGS; - -/** - * - */ -public class InternalIndexEngine extends AbstractIndexComponent implements IndexEngine { - - public InternalIndexEngine(Index index) { - this(index, EMPTY_SETTINGS); - } - - @Inject - public InternalIndexEngine(Index index, @IndexSettings Settings indexSettings) { - super(index, indexSettings); - } - - @Override - public void close() { - } -} diff --git a/src/main/java/org/elasticsearch/index/engine/internal/InternalIndexEngineModule.java b/src/main/java/org/elasticsearch/index/engine/internal/InternalIndexEngineModule.java deleted file mode 100644 index d3f596d45fe..00000000000 --- a/src/main/java/org/elasticsearch/index/engine/internal/InternalIndexEngineModule.java +++ /dev/null @@ -1,34 +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.index.engine.internal; - -import org.elasticsearch.common.inject.AbstractModule; -import org.elasticsearch.index.engine.IndexEngine; - -/** - * - */ -public class InternalIndexEngineModule extends AbstractModule { - - @Override - protected void configure() { - bind(IndexEngine.class).to(InternalIndexEngine.class).asEagerSingleton(); - } -} diff --git a/src/main/java/org/elasticsearch/index/query/IndexQueryParserService.java b/src/main/java/org/elasticsearch/index/query/IndexQueryParserService.java index 05e3d5f5c92..39d4426b8e5 100644 --- a/src/main/java/org/elasticsearch/index/query/IndexQueryParserService.java +++ b/src/main/java/org/elasticsearch/index/query/IndexQueryParserService.java @@ -39,7 +39,6 @@ import org.elasticsearch.index.Index; import org.elasticsearch.index.analysis.AnalysisService; import org.elasticsearch.index.cache.IndexCache; import org.elasticsearch.index.cache.bitset.BitsetFilterCache; -import org.elasticsearch.index.engine.IndexEngine; import org.elasticsearch.index.fielddata.IndexFieldDataService; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.mapper.internal.AllFieldMapper; @@ -93,8 +92,6 @@ public class IndexQueryParserService extends AbstractIndexComponent { final BitsetFilterCache bitsetFilterCache; - final IndexEngine indexEngine; - private final Map queryParsers; private final Map filterParsers; @@ -109,7 +106,7 @@ public class IndexQueryParserService extends AbstractIndexComponent { IndicesQueriesRegistry indicesQueriesRegistry, ScriptService scriptService, AnalysisService analysisService, MapperService mapperService, IndexCache indexCache, IndexFieldDataService fieldDataService, - IndexEngine indexEngine, BitsetFilterCache bitsetFilterCache, + BitsetFilterCache bitsetFilterCache, @Nullable SimilarityService similarityService, @Nullable Map namedQueryParsers, @Nullable Map namedFilterParsers) { @@ -120,7 +117,6 @@ public class IndexQueryParserService extends AbstractIndexComponent { this.similarityService = similarityService; this.indexCache = indexCache; this.fieldDataService = fieldDataService; - this.indexEngine = indexEngine; this.bitsetFilterCache = bitsetFilterCache; this.defaultField = indexSettings.get(DEFAULT_FIELD, AllFieldMapper.NAME); diff --git a/src/main/java/org/elasticsearch/index/query/QueryParseContext.java b/src/main/java/org/elasticsearch/index/query/QueryParseContext.java index f49f2e4e3b3..5a6a7cd115d 100644 --- a/src/main/java/org/elasticsearch/index/query/QueryParseContext.java +++ b/src/main/java/org/elasticsearch/index/query/QueryParseContext.java @@ -42,7 +42,6 @@ import org.elasticsearch.index.Index; import org.elasticsearch.index.analysis.AnalysisService; import org.elasticsearch.index.cache.filter.support.CacheKeyFilter; import org.elasticsearch.index.cache.query.parser.QueryParserCache; -import org.elasticsearch.index.engine.IndexEngine; import org.elasticsearch.index.fielddata.IndexFieldData; import org.elasticsearch.index.mapper.FieldMapper; import org.elasticsearch.index.mapper.FieldMappers; @@ -158,10 +157,6 @@ public class QueryParseContext { return indexQueryParser.mapperService; } - public IndexEngine indexEngine() { - return indexQueryParser.indexEngine; - } - @Nullable public SimilarityService similarityService() { return indexQueryParser.similarityService; diff --git a/src/main/java/org/elasticsearch/indices/IndicesService.java b/src/main/java/org/elasticsearch/indices/IndicesService.java index b3412f24227..8d1dfe3491d 100644 --- a/src/main/java/org/elasticsearch/indices/IndicesService.java +++ b/src/main/java/org/elasticsearch/indices/IndicesService.java @@ -43,8 +43,6 @@ import org.elasticsearch.index.analysis.AnalysisService; import org.elasticsearch.index.cache.IndexCache; import org.elasticsearch.index.cache.IndexCacheModule; import org.elasticsearch.index.codec.CodecModule; -import org.elasticsearch.index.engine.IndexEngine; -import org.elasticsearch.index.engine.IndexEngineModule; import org.elasticsearch.index.fielddata.IndexFieldDataModule; import org.elasticsearch.index.fielddata.IndexFieldDataService; import org.elasticsearch.index.flush.FlushStats; @@ -59,17 +57,15 @@ import org.elasticsearch.index.query.IndexQueryParserModule; import org.elasticsearch.index.query.IndexQueryParserService; import org.elasticsearch.index.refresh.RefreshStats; import org.elasticsearch.index.search.stats.SearchStats; -import org.elasticsearch.index.IndexService; import org.elasticsearch.index.settings.IndexSettingsModule; import org.elasticsearch.index.shard.IllegalIndexShardStateException; -import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.shard.IndexShard; +import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.similarity.SimilarityModule; import org.elasticsearch.index.store.IndexStore; import org.elasticsearch.index.store.IndexStoreModule; import org.elasticsearch.indices.analysis.IndicesAnalysisService; import org.elasticsearch.indices.recovery.RecoverySettings; -import org.elasticsearch.indices.store.IndicesStore; import org.elasticsearch.plugins.IndexPluginsModule; import org.elasticsearch.plugins.PluginsService; @@ -313,7 +309,6 @@ public class IndicesService extends AbstractLifecycleComponent i modules.add(new IndexSettingsModule(index, indexSettings)); modules.add(new IndexPluginsModule(indexSettings, pluginsService)); modules.add(new IndexStoreModule(indexSettings)); - modules.add(new IndexEngineModule(indexSettings)); modules.add(new AnalysisModule(indexSettings, indicesAnalysisService)); modules.add(new SimilarityModule(indexSettings)); modules.add(new IndexCacheModule(indexSettings)); @@ -434,8 +429,6 @@ public class IndicesService extends AbstractLifecycleComponent i indexInjector.getInstance(IndexFieldDataService.class).clear(); logger.debug("[{}] closing analysis service (reason [{}])", index, reason); indexInjector.getInstance(AnalysisService.class).close(); - logger.debug("[{}] closing index engine (reason [{}])", index, reason); - indexInjector.getInstance(IndexEngine.class).close(); logger.debug("[{}] closing index gateway (reason [{}])", index, reason); indexInjector.getInstance(IndexGateway.class).close(); diff --git a/src/test/java/org/elasticsearch/index/query/TemplateQueryParserTest.java b/src/test/java/org/elasticsearch/index/query/TemplateQueryParserTest.java index 6d4ce2a4814..86eb1eba72a 100644 --- a/src/test/java/org/elasticsearch/index/query/TemplateQueryParserTest.java +++ b/src/test/java/org/elasticsearch/index/query/TemplateQueryParserTest.java @@ -39,7 +39,6 @@ import org.elasticsearch.index.IndexNameModule; import org.elasticsearch.index.analysis.AnalysisModule; import org.elasticsearch.index.cache.IndexCacheModule; import org.elasticsearch.index.codec.CodecModule; -import org.elasticsearch.index.engine.IndexEngineModule; import org.elasticsearch.index.query.functionscore.FunctionScoreModule; import org.elasticsearch.index.settings.IndexSettingsModule; import org.elasticsearch.index.similarity.SimilarityModule; @@ -84,7 +83,6 @@ public class TemplateQueryParserTest extends ElasticsearchTestCase { new IndexSettingsModule(index, settings), new IndexCacheModule(settings), new AnalysisModule(settings), - new IndexEngineModule(settings), new SimilarityModule(settings), new IndexNameModule(index), new IndexQueryParserModule(settings), diff --git a/src/test/java/org/elasticsearch/index/query/plugin/IndexQueryParserPlugin2Tests.java b/src/test/java/org/elasticsearch/index/query/plugin/IndexQueryParserPlugin2Tests.java index 970a6fa8aa9..f2e787137b2 100644 --- a/src/test/java/org/elasticsearch/index/query/plugin/IndexQueryParserPlugin2Tests.java +++ b/src/test/java/org/elasticsearch/index/query/plugin/IndexQueryParserPlugin2Tests.java @@ -34,7 +34,6 @@ import org.elasticsearch.index.IndexNameModule; import org.elasticsearch.index.analysis.AnalysisModule; import org.elasticsearch.index.cache.IndexCacheModule; import org.elasticsearch.index.codec.CodecModule; -import org.elasticsearch.index.engine.IndexEngineModule; import org.elasticsearch.index.query.IndexQueryParserModule; import org.elasticsearch.index.query.IndexQueryParserService; import org.elasticsearch.index.query.functionscore.FunctionScoreModule; @@ -74,7 +73,6 @@ public class IndexQueryParserPlugin2Tests extends ElasticsearchTestCase { new IndexSettingsModule(index, settings), new IndexCacheModule(settings), new AnalysisModule(settings), - new IndexEngineModule(settings), new SimilarityModule(settings), queryParserModule, new IndexNameModule(index), diff --git a/src/test/java/org/elasticsearch/index/query/plugin/IndexQueryParserPluginTests.java b/src/test/java/org/elasticsearch/index/query/plugin/IndexQueryParserPluginTests.java index 59b5078319d..cf9f4db50ec 100644 --- a/src/test/java/org/elasticsearch/index/query/plugin/IndexQueryParserPluginTests.java +++ b/src/test/java/org/elasticsearch/index/query/plugin/IndexQueryParserPluginTests.java @@ -34,7 +34,6 @@ import org.elasticsearch.index.IndexNameModule; import org.elasticsearch.index.analysis.AnalysisModule; import org.elasticsearch.index.cache.IndexCacheModule; import org.elasticsearch.index.codec.CodecModule; -import org.elasticsearch.index.engine.IndexEngineModule; import org.elasticsearch.index.query.IndexQueryParserModule; import org.elasticsearch.index.query.IndexQueryParserService; import org.elasticsearch.index.query.functionscore.FunctionScoreModule; @@ -82,7 +81,6 @@ public class IndexQueryParserPluginTests extends ElasticsearchTestCase { new IndexSettingsModule(index, settings), new IndexCacheModule(settings), new AnalysisModule(settings), - new IndexEngineModule(settings), new SimilarityModule(settings), queryParserModule, new IndexNameModule(index), diff --git a/src/test/java/org/elasticsearch/test/InternalTestCluster.java b/src/test/java/org/elasticsearch/test/InternalTestCluster.java index dc2baebfdb6..250e26a5a3f 100644 --- a/src/test/java/org/elasticsearch/test/InternalTestCluster.java +++ b/src/test/java/org/elasticsearch/test/InternalTestCluster.java @@ -73,7 +73,6 @@ import org.elasticsearch.index.IndexService; import org.elasticsearch.index.cache.filter.FilterCacheModule; import org.elasticsearch.index.cache.filter.none.NoneFilterCache; import org.elasticsearch.index.cache.filter.weighted.WeightedFilterCache; -import org.elasticsearch.index.engine.IndexEngineModule; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.indices.IndicesService; import org.elasticsearch.indices.breaker.CircuitBreakerService; @@ -88,7 +87,6 @@ import org.elasticsearch.search.SearchService; import org.elasticsearch.test.cache.recycler.MockBigArraysModule; import org.elasticsearch.test.cache.recycler.MockPageCacheRecyclerModule; import org.elasticsearch.test.disruption.ServiceDisruptionScheme; -import org.elasticsearch.test.engine.MockEngineModule; import org.elasticsearch.test.store.MockFSIndexStoreModule; import org.elasticsearch.test.transport.AssertingLocalTransport; import org.elasticsearch.test.transport.MockTransportService; @@ -366,7 +364,6 @@ public final class InternalTestCluster extends TestCluster { .put(SETTING_CLUSTER_NODE_SEED, seed); if (ENABLE_MOCK_MODULES && usually(random)) { builder.put("index.store.type", MockFSIndexStoreModule.class.getName()); // no RAM dir for now! - builder.put(IndexEngineModule.EngineSettings.ENGINE_TYPE, MockEngineModule.class.getName()); builder.put(PageCacheRecyclerModule.CACHE_IMPL, MockPageCacheRecyclerModule.class.getName()); builder.put(BigArraysModule.IMPL, MockBigArraysModule.class.getName()); builder.put(TransportModule.TRANSPORT_SERVICE_TYPE_KEY, MockTransportService.class.getName());