From 12353588483779f6515ee458a01f83b64315538e Mon Sep 17 00:00:00 2001 From: kimchy Date: Tue, 19 Oct 2010 19:50:12 +0200 Subject: [PATCH] remove unused indices service --- .../broadcast/TransportBroadcastPingAction.java | 5 ++--- .../clear/TransportClearIndicesCacheAction.java | 15 +++++++++------ .../admin/indices/flush/TransportFlushAction.java | 5 ++++- .../snapshot/TransportGatewaySnapshotAction.java | 5 ++++- .../indices/optimize/TransportOptimizeAction.java | 5 ++++- .../indices/refresh/TransportRefreshAction.java | 5 ++++- .../status/TransportIndicesStatusAction.java | 5 ++++- .../action/bulk/TransportBulkAction.java | 6 +----- .../action/count/TransportCountAction.java | 5 ++++- .../TransportIndexDeleteByQueryAction.java | 6 +----- .../TransportSearchDfsQueryAndFetchAction.java | 5 ++--- .../TransportSearchDfsQueryThenFetchAction.java | 5 ++--- .../type/TransportSearchQueryAndFetchAction.java | 5 ++--- .../type/TransportSearchQueryThenFetchAction.java | 5 ++--- .../search/type/TransportSearchTypeAction.java | 6 +----- .../TransportBroadcastOperationAction.java | 6 +----- 16 files changed, 47 insertions(+), 47 deletions(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/cluster/ping/broadcast/TransportBroadcastPingAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/cluster/ping/broadcast/TransportBroadcastPingAction.java index b3b638fad80..f568ee58bdf 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/cluster/ping/broadcast/TransportBroadcastPingAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/cluster/ping/broadcast/TransportBroadcastPingAction.java @@ -31,7 +31,6 @@ import org.elasticsearch.cluster.routing.GroupShardsIterator; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.indices.IndicesService; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; @@ -45,8 +44,8 @@ import static org.elasticsearch.common.collect.Lists.*; */ public class TransportBroadcastPingAction extends TransportBroadcastOperationAction { - @Inject public TransportBroadcastPingAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, IndicesService indicesService) { - super(settings, threadPool, clusterService, transportService, indicesService); + @Inject public TransportBroadcastPingAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService) { + super(settings, threadPool, clusterService, transportService); } @Override protected String transportAction() { diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/TransportClearIndicesCacheAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/TransportClearIndicesCacheAction.java index 08f79c2904e..f46f32bf60c 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/TransportClearIndicesCacheAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/cache/clear/TransportClearIndicesCacheAction.java @@ -32,7 +32,7 @@ import org.elasticsearch.cluster.routing.GroupShardsIterator; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.index.cache.IndexCache; +import org.elasticsearch.index.service.IndexService; import org.elasticsearch.indices.IndicesService; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; @@ -49,12 +49,15 @@ import static org.elasticsearch.common.collect.Lists.*; */ public class TransportClearIndicesCacheAction extends TransportBroadcastOperationAction { + private final IndicesService indicesService; + private final QueryParserCache queryParserCache; @Inject public TransportClearIndicesCacheAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, IndicesService indicesService, QueryParserCache queryParserCache) { - super(settings, threadPool, clusterService, transportService, indicesService); + super(settings, threadPool, clusterService, transportService); this.queryParserCache = queryParserCache; + this.indicesService = indicesService; } @Override protected String transportAction() { @@ -109,11 +112,11 @@ public class TransportClearIndicesCacheAction extends TransportBroadcastOperatio @Override protected ShardClearIndicesCacheResponse shardOperation(ShardClearIndicesCacheRequest request) throws ElasticSearchException { // TODO we can optimize to go to a single node where the index exists - IndexCache cache = indicesService.indexServiceSafe(request.index()).cache(); - queryParserCache.clear(); - if (request.filterCache()) { - cache.filter().clear(); + IndexService service = indicesService.indexService(request.index()); + if (service != null) { + service.cache().clear(); } + queryParserCache.clear(); return new ShardClearIndicesCacheResponse(request.index(), request.shardId()); } diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/flush/TransportFlushAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/flush/TransportFlushAction.java index 76e7d485292..9279e542db8 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/flush/TransportFlushAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/flush/TransportFlushAction.java @@ -49,8 +49,11 @@ import static org.elasticsearch.common.collect.Lists.*; */ public class TransportFlushAction extends TransportBroadcastOperationAction { + private final IndicesService indicesService; + @Inject public TransportFlushAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, IndicesService indicesService) { - super(settings, threadPool, clusterService, transportService, indicesService); + super(settings, threadPool, clusterService, transportService); + this.indicesService = indicesService; } @Override protected String transportAction() { diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/gateway/snapshot/TransportGatewaySnapshotAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/gateway/snapshot/TransportGatewaySnapshotAction.java index 20235e43662..c1fc9dc392f 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/gateway/snapshot/TransportGatewaySnapshotAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/gateway/snapshot/TransportGatewaySnapshotAction.java @@ -45,9 +45,12 @@ import java.util.concurrent.atomic.AtomicReferenceArray; */ public class TransportGatewaySnapshotAction extends TransportBroadcastOperationAction { + private final IndicesService indicesService; + @Inject public TransportGatewaySnapshotAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, IndicesService indicesService) { - super(settings, threadPool, clusterService, transportService, indicesService); + super(settings, threadPool, clusterService, transportService); + this.indicesService = indicesService; } @Override protected String transportAction() { diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/optimize/TransportOptimizeAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/optimize/TransportOptimizeAction.java index a0b23656baf..fff1cee23d9 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/optimize/TransportOptimizeAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/optimize/TransportOptimizeAction.java @@ -49,9 +49,12 @@ import static org.elasticsearch.common.collect.Lists.*; */ public class TransportOptimizeAction extends TransportBroadcastOperationAction { + private final IndicesService indicesService; + @Inject public TransportOptimizeAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, IndicesService indicesService) { - super(settings, threadPool, clusterService, transportService, indicesService); + super(settings, threadPool, clusterService, transportService); + this.indicesService = indicesService; } @Override protected String transportAction() { diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/refresh/TransportRefreshAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/refresh/TransportRefreshAction.java index e1cea0edde3..02900793578 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/refresh/TransportRefreshAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/refresh/TransportRefreshAction.java @@ -49,9 +49,12 @@ import static org.elasticsearch.common.collect.Lists.*; */ public class TransportRefreshAction extends TransportBroadcastOperationAction { + private final IndicesService indicesService; + @Inject public TransportRefreshAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, IndicesService indicesService) { - super(settings, threadPool, clusterService, transportService, indicesService); + super(settings, threadPool, clusterService, transportService); + this.indicesService = indicesService; } @Override protected String transportAction() { diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/status/TransportIndicesStatusAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/status/TransportIndicesStatusAction.java index 2666a9df7ad..d20440b12c8 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/status/TransportIndicesStatusAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/status/TransportIndicesStatusAction.java @@ -56,12 +56,15 @@ import static org.elasticsearch.common.collect.Lists.*; */ public class TransportIndicesStatusAction extends TransportBroadcastOperationAction { + private final IndicesService indicesService; + private final RecoveryTarget peerRecoveryTarget; @Inject public TransportIndicesStatusAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, IndicesService indicesService, RecoveryTarget peerRecoveryTarget) { - super(settings, threadPool, clusterService, transportService, indicesService); + super(settings, threadPool, clusterService, transportService); this.peerRecoveryTarget = peerRecoveryTarget; + this.indicesService = indicesService; } @Override protected String transportAction() { diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java index a41061b0212..a14c3c0e677 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/bulk/TransportBulkAction.java @@ -39,7 +39,6 @@ import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.indices.IndexAlreadyExistsException; -import org.elasticsearch.indices.IndicesService; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.BaseTransportRequestHandler; import org.elasticsearch.transport.TransportChannel; @@ -64,18 +63,15 @@ public class TransportBulkAction extends BaseAction { private final ClusterService clusterService; - private final IndicesService indicesService; - private final TransportShardBulkAction shardBulkAction; private final TransportCreateIndexAction createIndexAction; - @Inject public TransportBulkAction(Settings settings, ThreadPool threadPool, TransportService transportService, ClusterService clusterService, IndicesService indicesService, + @Inject public TransportBulkAction(Settings settings, ThreadPool threadPool, TransportService transportService, ClusterService clusterService, TransportShardBulkAction shardBulkAction, TransportCreateIndexAction createIndexAction) { super(settings); this.threadPool = threadPool; this.clusterService = clusterService; - this.indicesService = indicesService; this.shardBulkAction = shardBulkAction; this.createIndexAction = createIndexAction; diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/count/TransportCountAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/count/TransportCountAction.java index 91b117ffb71..d5af267b820 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/count/TransportCountAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/count/TransportCountAction.java @@ -47,8 +47,11 @@ import static org.elasticsearch.common.collect.Lists.*; */ public class TransportCountAction extends TransportBroadcastOperationAction { + private final IndicesService indicesService; + @Inject public TransportCountAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, IndicesService indicesService) { - super(settings, threadPool, clusterService, transportService, indicesService); + super(settings, threadPool, clusterService, transportService); + this.indicesService = indicesService; } @Override protected String transportAction() { diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/deletebyquery/TransportIndexDeleteByQueryAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/deletebyquery/TransportIndexDeleteByQueryAction.java index d161a2a39a5..7978175f4d6 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/deletebyquery/TransportIndexDeleteByQueryAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/deletebyquery/TransportIndexDeleteByQueryAction.java @@ -26,7 +26,6 @@ import org.elasticsearch.cluster.block.ClusterBlockLevel; import org.elasticsearch.cluster.routing.GroupShardsIterator; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.indices.IndicesService; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.transport.TransportService; @@ -37,12 +36,9 @@ import java.util.concurrent.atomic.AtomicReferenceArray; */ public class TransportIndexDeleteByQueryAction extends TransportIndexReplicationOperationAction { - private final IndicesService indicesService; - - @Inject public TransportIndexDeleteByQueryAction(Settings settings, ClusterService clusterService, TransportService transportService, IndicesService indicesService, + @Inject public TransportIndexDeleteByQueryAction(Settings settings, ClusterService clusterService, TransportService transportService, ThreadPool threadPool, TransportShardDeleteByQueryAction shardDeleteByQueryAction) { super(settings, transportService, clusterService, threadPool, shardDeleteByQueryAction); - this.indicesService = indicesService; } @Override protected IndexDeleteByQueryRequest newRequestInstance() { diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchDfsQueryAndFetchAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchDfsQueryAndFetchAction.java index 458bb3602db..1e0e73519a6 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchDfsQueryAndFetchAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchDfsQueryAndFetchAction.java @@ -26,7 +26,6 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.indices.IndicesService; import org.elasticsearch.search.SearchShardTarget; import org.elasticsearch.search.action.SearchServiceListener; import org.elasticsearch.search.action.SearchServiceTransportAction; @@ -50,9 +49,9 @@ import static org.elasticsearch.action.search.type.TransportSearchHelper.*; */ public class TransportSearchDfsQueryAndFetchAction extends TransportSearchTypeAction { - @Inject public TransportSearchDfsQueryAndFetchAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, IndicesService indicesService, + @Inject public TransportSearchDfsQueryAndFetchAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportSearchCache transportSearchCache, SearchServiceTransportAction searchService, SearchPhaseController searchPhaseController) { - super(settings, threadPool, clusterService, indicesService, transportSearchCache, searchService, searchPhaseController); + super(settings, threadPool, clusterService, transportSearchCache, searchService, searchPhaseController); } @Override protected void doExecute(SearchRequest searchRequest, ActionListener listener) { diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchDfsQueryThenFetchAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchDfsQueryThenFetchAction.java index 2bac8d7a81a..a020daf39c3 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchDfsQueryThenFetchAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchDfsQueryThenFetchAction.java @@ -27,7 +27,6 @@ import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.trove.ExtTIntArrayList; -import org.elasticsearch.indices.IndicesService; import org.elasticsearch.search.SearchShardTarget; import org.elasticsearch.search.action.SearchServiceListener; import org.elasticsearch.search.action.SearchServiceTransportAction; @@ -52,9 +51,9 @@ import java.util.concurrent.atomic.AtomicInteger; */ public class TransportSearchDfsQueryThenFetchAction extends TransportSearchTypeAction { - @Inject public TransportSearchDfsQueryThenFetchAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, IndicesService indicesService, + @Inject public TransportSearchDfsQueryThenFetchAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportSearchCache transportSearchCache, SearchServiceTransportAction searchService, SearchPhaseController searchPhaseController) { - super(settings, threadPool, clusterService, indicesService, transportSearchCache, searchService, searchPhaseController); + super(settings, threadPool, clusterService, transportSearchCache, searchService, searchPhaseController); } @Override protected void doExecute(SearchRequest searchRequest, ActionListener listener) { diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchQueryAndFetchAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchQueryAndFetchAction.java index 4ac8f9074ab..cf3343dfb44 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchQueryAndFetchAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchQueryAndFetchAction.java @@ -27,7 +27,6 @@ import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.indices.IndicesService; import org.elasticsearch.search.SearchShardTarget; import org.elasticsearch.search.action.SearchServiceListener; import org.elasticsearch.search.action.SearchServiceTransportAction; @@ -46,9 +45,9 @@ import static org.elasticsearch.action.search.type.TransportSearchHelper.*; */ public class TransportSearchQueryAndFetchAction extends TransportSearchTypeAction { - @Inject public TransportSearchQueryAndFetchAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, IndicesService indicesService, + @Inject public TransportSearchQueryAndFetchAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportSearchCache transportSearchCache, SearchServiceTransportAction searchService, SearchPhaseController searchPhaseController) { - super(settings, threadPool, clusterService, indicesService, transportSearchCache, searchService, searchPhaseController); + super(settings, threadPool, clusterService, transportSearchCache, searchService, searchPhaseController); } @Override protected void doExecute(SearchRequest searchRequest, ActionListener listener) { diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchQueryThenFetchAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchQueryThenFetchAction.java index e8479abc624..4c3519b5317 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchQueryThenFetchAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchQueryThenFetchAction.java @@ -27,7 +27,6 @@ import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.trove.ExtTIntArrayList; -import org.elasticsearch.indices.IndicesService; import org.elasticsearch.search.SearchShardTarget; import org.elasticsearch.search.action.SearchServiceListener; import org.elasticsearch.search.action.SearchServiceTransportAction; @@ -48,9 +47,9 @@ import java.util.concurrent.atomic.AtomicInteger; */ public class TransportSearchQueryThenFetchAction extends TransportSearchTypeAction { - @Inject public TransportSearchQueryThenFetchAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, IndicesService indicesService, + @Inject public TransportSearchQueryThenFetchAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportSearchCache transportSearchCache, SearchServiceTransportAction searchService, SearchPhaseController searchPhaseController) { - super(settings, threadPool, clusterService, indicesService, transportSearchCache, searchService, searchPhaseController); + super(settings, threadPool, clusterService, transportSearchCache, searchService, searchPhaseController); } @Override protected void doExecute(SearchRequest searchRequest, ActionListener listener) { diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchTypeAction.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchTypeAction.java index 1f3bb2ce79b..f59d75d951a 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchTypeAction.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchTypeAction.java @@ -32,7 +32,6 @@ import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.ShardsIterator; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.trove.ExtTIntArrayList; -import org.elasticsearch.indices.IndicesService; import org.elasticsearch.search.SearchPhaseResult; import org.elasticsearch.search.SearchShardTarget; import org.elasticsearch.search.action.SearchServiceListener; @@ -59,21 +58,18 @@ public abstract class TransportSearchTypeAction extends BaseAction