remove unused indices service
This commit is contained in:
parent
a4eea0aeaa
commit
1235358848
|
@ -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<BroadcastPingRequest, BroadcastPingResponse, BroadcastShardPingRequest, BroadcastShardPingResponse> {
|
||||
|
||||
@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() {
|
||||
|
|
|
@ -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<ClearIndicesCacheRequest, ClearIndicesCacheResponse, ShardClearIndicesCacheRequest, ShardClearIndicesCacheResponse> {
|
||||
|
||||
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());
|
||||
}
|
||||
|
||||
|
|
|
@ -49,8 +49,11 @@ import static org.elasticsearch.common.collect.Lists.*;
|
|||
*/
|
||||
public class TransportFlushAction extends TransportBroadcastOperationAction<FlushRequest, FlushResponse, ShardFlushRequest, ShardFlushResponse> {
|
||||
|
||||
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() {
|
||||
|
|
|
@ -45,9 +45,12 @@ import java.util.concurrent.atomic.AtomicReferenceArray;
|
|||
*/
|
||||
public class TransportGatewaySnapshotAction extends TransportBroadcastOperationAction<GatewaySnapshotRequest, GatewaySnapshotResponse, ShardGatewaySnapshotRequest, ShardGatewaySnapshotResponse> {
|
||||
|
||||
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() {
|
||||
|
|
|
@ -49,9 +49,12 @@ import static org.elasticsearch.common.collect.Lists.*;
|
|||
*/
|
||||
public class TransportOptimizeAction extends TransportBroadcastOperationAction<OptimizeRequest, OptimizeResponse, ShardOptimizeRequest, ShardOptimizeResponse> {
|
||||
|
||||
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() {
|
||||
|
|
|
@ -49,9 +49,12 @@ import static org.elasticsearch.common.collect.Lists.*;
|
|||
*/
|
||||
public class TransportRefreshAction extends TransportBroadcastOperationAction<RefreshRequest, RefreshResponse, ShardRefreshRequest, ShardRefreshResponse> {
|
||||
|
||||
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() {
|
||||
|
|
|
@ -56,12 +56,15 @@ import static org.elasticsearch.common.collect.Lists.*;
|
|||
*/
|
||||
public class TransportIndicesStatusAction extends TransportBroadcastOperationAction<IndicesStatusRequest, IndicesStatusResponse, TransportIndicesStatusAction.IndexShardStatusRequest, ShardStatus> {
|
||||
|
||||
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() {
|
||||
|
|
|
@ -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<BulkRequest, BulkResponse> {
|
|||
|
||||
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;
|
||||
|
||||
|
|
|
@ -47,8 +47,11 @@ import static org.elasticsearch.common.collect.Lists.*;
|
|||
*/
|
||||
public class TransportCountAction extends TransportBroadcastOperationAction<CountRequest, CountResponse, ShardCountRequest, ShardCountResponse> {
|
||||
|
||||
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() {
|
||||
|
|
|
@ -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<IndexDeleteByQueryRequest, IndexDeleteByQueryResponse, ShardDeleteByQueryRequest, ShardDeleteByQueryResponse> {
|
||||
|
||||
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() {
|
||||
|
|
|
@ -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<SearchResponse> listener) {
|
||||
|
|
|
@ -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<SearchResponse> listener) {
|
||||
|
|
|
@ -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<SearchResponse> listener) {
|
||||
|
|
|
@ -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<SearchResponse> listener) {
|
||||
|
|
|
@ -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<SearchRequest
|
|||
|
||||
protected final ClusterService clusterService;
|
||||
|
||||
protected final IndicesService indicesService;
|
||||
|
||||
protected final SearchServiceTransportAction searchService;
|
||||
|
||||
protected final SearchPhaseController searchPhaseController;
|
||||
|
||||
protected final TransportSearchCache searchCache;
|
||||
|
||||
public TransportSearchTypeAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, IndicesService indicesService,
|
||||
public TransportSearchTypeAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportSearchCache searchCache, SearchServiceTransportAction searchService, SearchPhaseController searchPhaseController) {
|
||||
super(settings);
|
||||
this.threadPool = threadPool;
|
||||
this.clusterService = clusterService;
|
||||
this.searchCache = searchCache;
|
||||
this.indicesService = indicesService;
|
||||
this.searchService = searchService;
|
||||
this.searchPhaseController = searchPhaseController;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,6 @@ import org.elasticsearch.common.io.stream.StreamOutput;
|
|||
import org.elasticsearch.common.io.stream.Streamable;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.*;
|
||||
|
||||
|
@ -58,16 +57,13 @@ public abstract class TransportBroadcastOperationAction<Request extends Broadcas
|
|||
|
||||
protected final TransportService transportService;
|
||||
|
||||
protected final IndicesService indicesService;
|
||||
|
||||
protected final ThreadPool threadPool;
|
||||
|
||||
protected TransportBroadcastOperationAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService, IndicesService indicesService) {
|
||||
protected TransportBroadcastOperationAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService) {
|
||||
super(settings);
|
||||
this.clusterService = clusterService;
|
||||
this.transportService = transportService;
|
||||
this.threadPool = threadPool;
|
||||
this.indicesService = indicesService;
|
||||
|
||||
transportService.registerHandler(transportAction(), new TransportHandler());
|
||||
transportService.registerHandler(transportShardAction(), new ShardTransportHandler());
|
||||
|
|
Loading…
Reference in New Issue