From 5a9694783b657e58ee2c3e3c84b9696a0fdd4eeb Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Fri, 29 May 2015 13:52:26 +0200 Subject: [PATCH] Consolidate shard level modules without logic into IndexShardModule We have a lot of module classes that don't contain any actual logic, only declarative bind actions. These classes are unnecessary and can be consolidated into the already existings IndexShardModule --- .../metadata/MetaDataCreateIndexService.java | 4 +- .../org/elasticsearch/index/IndexService.java | 39 +++++++----------- .../bitset/ShardBitsetFilterCacheModule.java | 32 --------------- .../cache/filter/ShardFilterCacheModule.java | 38 ----------------- .../cache/query/ShardQueryCacheModule.java | 32 --------------- .../gateway/IndexShardGatewayModule.java | 35 ---------------- .../index/get/ShardGetModule.java | 32 --------------- .../index/indexing/ShardIndexingModule.java | 34 --------------- .../percolator/PercolatorShardModule.java | 34 --------------- .../index/search/stats/ShardSearchModule.java | 34 --------------- .../index/shard/IndexShardModule.java | 41 ++++++++++++++++++- .../snapshots/IndexShardSnapshotModule.java | 33 --------------- .../index/store/StoreModule.java | 2 - .../termvectors/ShardTermVectorsModule.java | 32 --------------- .../index/shard/IndexShardModuleTests.java | 8 ++-- 15 files changed, 59 insertions(+), 371 deletions(-) delete mode 100644 src/main/java/org/elasticsearch/index/cache/bitset/ShardBitsetFilterCacheModule.java delete mode 100644 src/main/java/org/elasticsearch/index/cache/filter/ShardFilterCacheModule.java delete mode 100644 src/main/java/org/elasticsearch/index/cache/query/ShardQueryCacheModule.java delete mode 100644 src/main/java/org/elasticsearch/index/gateway/IndexShardGatewayModule.java delete mode 100644 src/main/java/org/elasticsearch/index/get/ShardGetModule.java delete mode 100644 src/main/java/org/elasticsearch/index/indexing/ShardIndexingModule.java delete mode 100644 src/main/java/org/elasticsearch/index/percolator/PercolatorShardModule.java delete mode 100644 src/main/java/org/elasticsearch/index/search/stats/ShardSearchModule.java delete mode 100644 src/main/java/org/elasticsearch/index/snapshots/IndexShardSnapshotModule.java delete mode 100644 src/main/java/org/elasticsearch/index/termvectors/ShardTermVectorsModule.java diff --git a/src/main/java/org/elasticsearch/cluster/metadata/MetaDataCreateIndexService.java b/src/main/java/org/elasticsearch/cluster/metadata/MetaDataCreateIndexService.java index 41e310a95ad..b16edc21dd7 100644 --- a/src/main/java/org/elasticsearch/cluster/metadata/MetaDataCreateIndexService.java +++ b/src/main/java/org/elasticsearch/cluster/metadata/MetaDataCreateIndexService.java @@ -87,7 +87,6 @@ public class MetaDataCreateIndexService extends AbstractComponent { public final static int MAX_INDEX_NAME_BYTES = 255; private static final DefaultIndexTemplateFilter DEFAULT_INDEX_TEMPLATE_FILTER = new DefaultIndexTemplateFilter(); - private final Environment environment; private final ThreadPool threadPool; private final ClusterService clusterService; private final IndicesService indicesService; @@ -100,12 +99,11 @@ public class MetaDataCreateIndexService extends AbstractComponent { private final NodeEnvironment nodeEnv; @Inject - public MetaDataCreateIndexService(Settings settings, Environment environment, ThreadPool threadPool, ClusterService clusterService, + public MetaDataCreateIndexService(Settings settings, ThreadPool threadPool, ClusterService clusterService, IndicesService indicesService, AllocationService allocationService, MetaDataService metaDataService, Version version, @RiverIndexName String riverIndexName, AliasValidator aliasValidator, Set indexTemplateFilters, NodeEnvironment nodeEnv) { super(settings); - this.environment = environment; this.threadPool = threadPool; this.clusterService = clusterService; this.indicesService = indicesService; diff --git a/src/main/java/org/elasticsearch/index/IndexService.java b/src/main/java/org/elasticsearch/index/IndexService.java index 09335126c73..e6ff7f232f2 100644 --- a/src/main/java/org/elasticsearch/index/IndexService.java +++ b/src/main/java/org/elasticsearch/index/IndexService.java @@ -36,36 +36,37 @@ import org.elasticsearch.index.aliases.IndexAliasesService; import org.elasticsearch.index.analysis.AnalysisService; import org.elasticsearch.index.cache.IndexCache; import org.elasticsearch.index.cache.bitset.BitsetFilterCache; -import org.elasticsearch.index.cache.bitset.ShardBitsetFilterCacheModule; +import org.elasticsearch.index.cache.bitset.ShardBitsetFilterCache; import org.elasticsearch.index.cache.filter.ShardFilterCache; -import org.elasticsearch.index.cache.filter.ShardFilterCacheModule; -import org.elasticsearch.index.cache.query.ShardQueryCacheModule; +import org.elasticsearch.index.cache.query.ShardQueryCache; import org.elasticsearch.index.deletionpolicy.DeletionPolicyModule; import org.elasticsearch.index.fielddata.IndexFieldDataService; -import org.elasticsearch.index.fielddata.ShardFieldDataModule; -import org.elasticsearch.index.gateway.IndexShardGatewayModule; +import org.elasticsearch.index.fielddata.ShardFieldData; +import org.elasticsearch.index.gateway.IndexShardGateway; import org.elasticsearch.index.gateway.IndexShardGatewayService; -import org.elasticsearch.index.get.ShardGetModule; -import org.elasticsearch.index.indexing.ShardIndexingModule; +import org.elasticsearch.index.get.ShardGetService; +import org.elasticsearch.index.indexing.ShardIndexingService; +import org.elasticsearch.index.indexing.slowlog.ShardSlowLogIndexingService; import org.elasticsearch.index.mapper.MapperService; import org.elasticsearch.index.merge.policy.MergePolicyModule; import org.elasticsearch.index.merge.policy.MergePolicyProvider; import org.elasticsearch.index.merge.scheduler.MergeSchedulerModule; import org.elasticsearch.index.merge.scheduler.MergeSchedulerProvider; import org.elasticsearch.index.percolator.PercolatorQueriesRegistry; -import org.elasticsearch.index.percolator.PercolatorShardModule; +import org.elasticsearch.index.percolator.stats.ShardPercolateService; import org.elasticsearch.index.query.IndexQueryParserService; -import org.elasticsearch.index.search.stats.ShardSearchModule; +import org.elasticsearch.index.search.slowlog.ShardSlowLogSearchService; +import org.elasticsearch.index.search.stats.ShardSearchService; import org.elasticsearch.index.settings.IndexSettings; import org.elasticsearch.index.settings.IndexSettingsService; import org.elasticsearch.index.shard.*; import org.elasticsearch.index.similarity.SimilarityService; -import org.elasticsearch.index.snapshots.IndexShardSnapshotModule; +import org.elasticsearch.index.snapshots.IndexShardSnapshotAndRestoreService; import org.elasticsearch.index.store.IndexStore; import org.elasticsearch.index.store.Store; import org.elasticsearch.index.store.StoreModule; -import org.elasticsearch.index.suggest.SuggestShardModule; -import org.elasticsearch.index.termvectors.ShardTermVectorsModule; +import org.elasticsearch.index.suggest.stats.ShardSuggestService; +import org.elasticsearch.index.termvectors.ShardTermVectorsService; import org.elasticsearch.index.translog.TranslogService; import org.elasticsearch.indices.IndicesLifecycle; import org.elasticsearch.indices.IndicesService; @@ -307,24 +308,12 @@ public class IndexService extends AbstractIndexComponent implements IndexCompone final ShardFilterCache shardFilterCache = new ShardFilterCache(shardId, injector.getInstance(IndicesFilterCache.class)); ModulesBuilder modules = new ModulesBuilder(); modules.add(new ShardsPluginsModule(indexSettings, pluginsService)); - modules.add(new IndexShardModule(shardId, primary, indexSettings)); - modules.add(new ShardIndexingModule()); - modules.add(new ShardSearchModule()); - modules.add(new ShardGetModule()); + modules.add(new IndexShardModule(shardId, primary, indexSettings, shardFilterCache)); modules.add(new StoreModule(injector.getInstance(IndexStore.class).shardDirectory(), lock, new StoreCloseListener(shardId, canDeleteShardContent, shardFilterCache), path)); modules.add(new DeletionPolicyModule(indexSettings)); modules.add(new MergePolicyModule(indexSettings)); modules.add(new MergeSchedulerModule(indexSettings)); - modules.add(new ShardFilterCacheModule(shardFilterCache)); - modules.add(new ShardQueryCacheModule()); - modules.add(new ShardBitsetFilterCacheModule()); - modules.add(new ShardFieldDataModule()); - modules.add(new IndexShardGatewayModule()); - modules.add(new PercolatorShardModule()); - modules.add(new ShardTermVectorsModule()); - modules.add(new IndexShardSnapshotModule()); - modules.add(new SuggestShardModule()); try { shardInjector = modules.createChildInjector(injector); } catch (CreationException e) { diff --git a/src/main/java/org/elasticsearch/index/cache/bitset/ShardBitsetFilterCacheModule.java b/src/main/java/org/elasticsearch/index/cache/bitset/ShardBitsetFilterCacheModule.java deleted file mode 100644 index c0087119f66..00000000000 --- a/src/main/java/org/elasticsearch/index/cache/bitset/ShardBitsetFilterCacheModule.java +++ /dev/null @@ -1,32 +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.cache.bitset; - -import org.elasticsearch.common.inject.AbstractModule; - -/** - */ -public class ShardBitsetFilterCacheModule extends AbstractModule { - - @Override - protected void configure() { - bind(ShardBitsetFilterCache.class).asEagerSingleton(); - } -} diff --git a/src/main/java/org/elasticsearch/index/cache/filter/ShardFilterCacheModule.java b/src/main/java/org/elasticsearch/index/cache/filter/ShardFilterCacheModule.java deleted file mode 100644 index 37bcb805768..00000000000 --- a/src/main/java/org/elasticsearch/index/cache/filter/ShardFilterCacheModule.java +++ /dev/null @@ -1,38 +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.cache.filter; - -import org.elasticsearch.common.inject.AbstractModule; - -/** - */ -public class ShardFilterCacheModule extends AbstractModule { - - private final ShardFilterCache shardFilterCache; - - public ShardFilterCacheModule(ShardFilterCache shardFilterCache) { - this.shardFilterCache = shardFilterCache; - } - - @Override - protected void configure() { - bind(ShardFilterCache.class).toInstance(shardFilterCache); - } -} diff --git a/src/main/java/org/elasticsearch/index/cache/query/ShardQueryCacheModule.java b/src/main/java/org/elasticsearch/index/cache/query/ShardQueryCacheModule.java deleted file mode 100644 index 938f016a8c3..00000000000 --- a/src/main/java/org/elasticsearch/index/cache/query/ShardQueryCacheModule.java +++ /dev/null @@ -1,32 +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.cache.query; - -import org.elasticsearch.common.inject.AbstractModule; - -/** - */ -public class ShardQueryCacheModule extends AbstractModule { - - @Override - protected void configure() { - bind(ShardQueryCache.class).asEagerSingleton(); - } -} diff --git a/src/main/java/org/elasticsearch/index/gateway/IndexShardGatewayModule.java b/src/main/java/org/elasticsearch/index/gateway/IndexShardGatewayModule.java deleted file mode 100644 index 11ff2cf717e..00000000000 --- a/src/main/java/org/elasticsearch/index/gateway/IndexShardGatewayModule.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.index.gateway; - -import org.elasticsearch.common.inject.AbstractModule; - -/** - * - */ -public class IndexShardGatewayModule extends AbstractModule { - - - @Override - protected void configure() { - bind(IndexShardGateway.class).asEagerSingleton(); - bind(IndexShardGatewayService.class).asEagerSingleton(); - } -} diff --git a/src/main/java/org/elasticsearch/index/get/ShardGetModule.java b/src/main/java/org/elasticsearch/index/get/ShardGetModule.java deleted file mode 100644 index bc1df275dc5..00000000000 --- a/src/main/java/org/elasticsearch/index/get/ShardGetModule.java +++ /dev/null @@ -1,32 +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.get; - -import org.elasticsearch.common.inject.AbstractModule; - -/** - */ -public class ShardGetModule extends AbstractModule { - - @Override - protected void configure() { - bind(ShardGetService.class).asEagerSingleton(); - } -} diff --git a/src/main/java/org/elasticsearch/index/indexing/ShardIndexingModule.java b/src/main/java/org/elasticsearch/index/indexing/ShardIndexingModule.java deleted file mode 100644 index 4d5e29daca3..00000000000 --- a/src/main/java/org/elasticsearch/index/indexing/ShardIndexingModule.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.indexing; - -import org.elasticsearch.common.inject.AbstractModule; -import org.elasticsearch.index.indexing.slowlog.ShardSlowLogIndexingService; - -/** - */ -public class ShardIndexingModule extends AbstractModule { - - @Override - protected void configure() { - bind(ShardIndexingService.class).asEagerSingleton(); - bind(ShardSlowLogIndexingService.class).asEagerSingleton(); - } -} diff --git a/src/main/java/org/elasticsearch/index/percolator/PercolatorShardModule.java b/src/main/java/org/elasticsearch/index/percolator/PercolatorShardModule.java deleted file mode 100644 index aba7e10fb2e..00000000000 --- a/src/main/java/org/elasticsearch/index/percolator/PercolatorShardModule.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.percolator; - -import org.elasticsearch.common.inject.AbstractModule; -import org.elasticsearch.index.percolator.stats.ShardPercolateService; - -/** - * - */ -public class PercolatorShardModule extends AbstractModule { - - @Override - protected void configure() { - bind(PercolatorQueriesRegistry.class).asEagerSingleton(); - bind(ShardPercolateService.class).asEagerSingleton(); - } -} diff --git a/src/main/java/org/elasticsearch/index/search/stats/ShardSearchModule.java b/src/main/java/org/elasticsearch/index/search/stats/ShardSearchModule.java deleted file mode 100644 index 28f8c09c8c2..00000000000 --- a/src/main/java/org/elasticsearch/index/search/stats/ShardSearchModule.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.search.stats; - -import org.elasticsearch.common.inject.AbstractModule; -import org.elasticsearch.index.search.slowlog.ShardSlowLogSearchService; - -/** - */ -public class ShardSearchModule extends AbstractModule { - - @Override - protected void configure() { - bind(ShardSearchService.class).asEagerSingleton(); - bind(ShardSlowLogSearchService.class).asEagerSingleton(); - } -} diff --git a/src/main/java/org/elasticsearch/index/shard/IndexShardModule.java b/src/main/java/org/elasticsearch/index/shard/IndexShardModule.java index fc44f11eab9..672b63bfb1c 100644 --- a/src/main/java/org/elasticsearch/index/shard/IndexShardModule.java +++ b/src/main/java/org/elasticsearch/index/shard/IndexShardModule.java @@ -22,8 +22,27 @@ package org.elasticsearch.index.shard; import org.elasticsearch.cluster.metadata.IndexMetaData; import org.elasticsearch.common.inject.AbstractModule; import org.elasticsearch.common.settings.Settings; +import org.elasticsearch.env.ShardLock; +import org.elasticsearch.index.cache.bitset.ShardBitsetFilterCache; +import org.elasticsearch.index.cache.filter.ShardFilterCache; +import org.elasticsearch.index.cache.query.ShardQueryCache; import org.elasticsearch.index.engine.EngineFactory; import org.elasticsearch.index.engine.InternalEngineFactory; +import org.elasticsearch.index.fielddata.ShardFieldData; +import org.elasticsearch.index.gateway.IndexShardGateway; +import org.elasticsearch.index.gateway.IndexShardGatewayService; +import org.elasticsearch.index.get.ShardGetService; +import org.elasticsearch.index.indexing.ShardIndexingService; +import org.elasticsearch.index.indexing.slowlog.ShardSlowLogIndexingService; +import org.elasticsearch.index.percolator.PercolatorQueriesRegistry; +import org.elasticsearch.index.percolator.stats.ShardPercolateService; +import org.elasticsearch.index.search.slowlog.ShardSlowLogSearchService; +import org.elasticsearch.index.search.stats.ShardSearchService; +import org.elasticsearch.index.snapshots.IndexShardSnapshotAndRestoreService; +import org.elasticsearch.index.store.DirectoryService; +import org.elasticsearch.index.store.Store; +import org.elasticsearch.index.suggest.stats.ShardSuggestService; +import org.elasticsearch.index.termvectors.ShardTermVectorsService; import org.elasticsearch.index.translog.TranslogService; import org.elasticsearch.index.warmer.ShardIndexWarmerService; @@ -43,9 +62,11 @@ public class IndexShardModule extends AbstractModule { private final ShardId shardId; private final Settings settings; private final boolean primary; + private final ShardFilterCache shardFilterCache; - public IndexShardModule(ShardId shardId, boolean primary, Settings settings) { + public IndexShardModule(ShardId shardId, boolean primary, Settings settings, ShardFilterCache shardFilterCache) { this.settings = settings; + this.shardFilterCache = shardFilterCache; this.shardId = shardId; this.primary = primary; if (settings.get("index.translog.type") != null) { @@ -69,7 +90,25 @@ public class IndexShardModule extends AbstractModule { } bind(EngineFactory.class).to(settings.getAsClass(ENGINE_FACTORY, DEFAULT_ENGINE_FACTORY_CLASS, ENGINE_PREFIX, ENGINE_SUFFIX)); + bind(ShardIndexWarmerService.class).asEagerSingleton(); + bind(ShardIndexingService.class).asEagerSingleton(); + bind(ShardSlowLogIndexingService.class).asEagerSingleton(); + bind(ShardSearchService.class).asEagerSingleton(); + bind(ShardSlowLogSearchService.class).asEagerSingleton(); + bind(ShardGetService.class).asEagerSingleton(); + bind(ShardFilterCache.class).toInstance(shardFilterCache); + bind(ShardQueryCache.class).asEagerSingleton(); + bind(ShardBitsetFilterCache.class).asEagerSingleton(); + bind(ShardFieldData.class).asEagerSingleton(); + bind(IndexShardGateway.class).asEagerSingleton(); + bind(IndexShardGatewayService.class).asEagerSingleton(); + bind(PercolatorQueriesRegistry.class).asEagerSingleton(); + bind(ShardPercolateService.class).asEagerSingleton(); + bind(ShardTermVectorsService.class).asEagerSingleton(); + bind(IndexShardSnapshotAndRestoreService.class).asEagerSingleton(); + bind(ShardSuggestService.class).asEagerSingleton(); } + } \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/index/snapshots/IndexShardSnapshotModule.java b/src/main/java/org/elasticsearch/index/snapshots/IndexShardSnapshotModule.java deleted file mode 100644 index c0cf9788400..00000000000 --- a/src/main/java/org/elasticsearch/index/snapshots/IndexShardSnapshotModule.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.snapshots; - -import org.elasticsearch.common.inject.AbstractModule; - -/** - * This shard-level module configures {@link IndexShardSnapshotAndRestoreService} - */ -public class IndexShardSnapshotModule extends AbstractModule { - - @Override - protected void configure() { - bind(IndexShardSnapshotAndRestoreService.class).asEagerSingleton(); - } -} \ No newline at end of file diff --git a/src/main/java/org/elasticsearch/index/store/StoreModule.java b/src/main/java/org/elasticsearch/index/store/StoreModule.java index fe0e314ba16..fccd2de2e43 100644 --- a/src/main/java/org/elasticsearch/index/store/StoreModule.java +++ b/src/main/java/org/elasticsearch/index/store/StoreModule.java @@ -27,8 +27,6 @@ import org.elasticsearch.index.shard.ShardPath; * */ public class StoreModule extends AbstractModule { - - private final ShardLock lock; private final Store.OnClose closeCallback; private final ShardPath path; diff --git a/src/main/java/org/elasticsearch/index/termvectors/ShardTermVectorsModule.java b/src/main/java/org/elasticsearch/index/termvectors/ShardTermVectorsModule.java deleted file mode 100644 index 45a7d14b703..00000000000 --- a/src/main/java/org/elasticsearch/index/termvectors/ShardTermVectorsModule.java +++ /dev/null @@ -1,32 +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.termvectors; - -import org.elasticsearch.common.inject.AbstractModule; - -/** - * - */ -public class ShardTermVectorsModule extends AbstractModule { - - @Override - protected void configure() { - bind(ShardTermVectorsService.class).asEagerSingleton(); - } -} diff --git a/src/test/java/org/elasticsearch/index/shard/IndexShardModuleTests.java b/src/test/java/org/elasticsearch/index/shard/IndexShardModuleTests.java index b5ac0cce405..8238c159df2 100644 --- a/src/test/java/org/elasticsearch/index/shard/IndexShardModuleTests.java +++ b/src/test/java/org/elasticsearch/index/shard/IndexShardModuleTests.java @@ -41,10 +41,10 @@ public class IndexShardModuleTests extends ElasticsearchTestCase { .put(IndexMetaData.SETTING_SHADOW_REPLICAS, true) .build(); - IndexShardModule ism1 = new IndexShardModule(shardId, true, regularSettings); - IndexShardModule ism2 = new IndexShardModule(shardId, false, regularSettings); - IndexShardModule ism3 = new IndexShardModule(shardId, true, shadowSettings); - IndexShardModule ism4 = new IndexShardModule(shardId, false, shadowSettings); + IndexShardModule ism1 = new IndexShardModule(shardId, true, regularSettings, null); + IndexShardModule ism2 = new IndexShardModule(shardId, false, regularSettings, null); + IndexShardModule ism3 = new IndexShardModule(shardId, true, shadowSettings, null); + IndexShardModule ism4 = new IndexShardModule(shardId, false, shadowSettings, null); assertFalse("no shadow replicas for normal settings", ism1.useShadowEngine()); assertFalse("no shadow replicas for normal settings", ism2.useShadowEngine());