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 76a4b492493..115e51f96b6 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 @@ -20,7 +20,11 @@ package org.elasticsearch.action.search.type; import org.elasticsearch.action.ActionListener; -import org.elasticsearch.action.search.*; +import org.elasticsearch.action.search.ReduceSearchPhaseException; +import org.elasticsearch.action.search.SearchOperationThreading; +import org.elasticsearch.action.search.SearchRequest; +import org.elasticsearch.action.search.SearchResponse; +import org.elasticsearch.action.search.ShardSearchFailure; import org.elasticsearch.cluster.ClusterService; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.routing.ShardRouting; @@ -129,7 +133,7 @@ public class TransportSearchDfsQueryAndFetchAction extends TransportSearchTypeAc } } - private void executeSecondPhase(final DfsSearchResult dfsResult, final AtomicInteger counter, DiscoveryNode node, final QuerySearchRequest querySearchRequest) { + void executeSecondPhase(final DfsSearchResult dfsResult, final AtomicInteger counter, DiscoveryNode node, final QuerySearchRequest querySearchRequest) { searchService.sendExecuteFetch(node, querySearchRequest, new SearchServiceListener() { @Override public void onResult(QueryFetchSearchResult result) { result.shardTarget(dfsResult.shardTarget()); @@ -152,7 +156,7 @@ public class TransportSearchDfsQueryAndFetchAction extends TransportSearchTypeAc }); } - private void finishHim() { + void finishHim() { try { innerFinishHim(); } catch (Exception e) { @@ -167,7 +171,7 @@ public class TransportSearchDfsQueryAndFetchAction extends TransportSearchTypeAc } } - private void innerFinishHim() throws Exception { + void innerFinishHim() throws Exception { sortedShardList = searchPhaseController.sortDocs(queryFetchResults.values()); final InternalSearchResponse internalResponse = searchPhaseController.merge(sortedShardList, queryFetchResults, queryFetchResults); String scrollId = null; 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 12cae33de98..41858bb44eb 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 @@ -140,7 +140,7 @@ public class TransportSearchDfsQueryThenFetchAction extends TransportSearchTypeA } } - private void executeQuery(final DfsSearchResult dfsResult, final AtomicInteger counter, final QuerySearchRequest querySearchRequest, DiscoveryNode node) { + void executeQuery(final DfsSearchResult dfsResult, final AtomicInteger counter, final QuerySearchRequest querySearchRequest, DiscoveryNode node) { searchService.sendExecuteQuery(node, querySearchRequest, new SearchServiceListener() { @Override public void onResult(QuerySearchResult result) { result.shardTarget(dfsResult.shardTarget()); @@ -163,7 +163,7 @@ public class TransportSearchDfsQueryThenFetchAction extends TransportSearchTypeA }); } - private void executeFetchPhase() { + void executeFetchPhase() { try { innerExecuteFetchPhase(); } catch (Exception e) { @@ -171,7 +171,7 @@ public class TransportSearchDfsQueryThenFetchAction extends TransportSearchTypeA } } - private void innerExecuteFetchPhase() { + void innerExecuteFetchPhase() { sortedShardList = searchPhaseController.sortDocs(queryResults.values()); final Map docIdsToLoad = searchPhaseController.docIdsToLoad(sortedShardList); this.docIdsToLoad = docIdsToLoad; @@ -227,7 +227,7 @@ public class TransportSearchDfsQueryThenFetchAction extends TransportSearchTypeA } } - private void executeFetch(final SearchShardTarget shardTarget, final AtomicInteger counter, final FetchSearchRequest fetchSearchRequest, DiscoveryNode node) { + void executeFetch(final SearchShardTarget shardTarget, final AtomicInteger counter, final FetchSearchRequest fetchSearchRequest, DiscoveryNode node) { searchService.sendExecuteFetch(node, fetchSearchRequest, new SearchServiceListener() { @Override public void onResult(FetchSearchResult result) { result.shardTarget(shardTarget); @@ -250,7 +250,7 @@ public class TransportSearchDfsQueryThenFetchAction extends TransportSearchTypeA }); } - private void finishHim() { + void finishHim() { try { innerFinishHim(); } catch (Exception e) { @@ -267,7 +267,7 @@ public class TransportSearchDfsQueryThenFetchAction extends TransportSearchTypeA } } - private void innerFinishHim() throws Exception { + void innerFinishHim() throws Exception { final InternalSearchResponse internalResponse = searchPhaseController.merge(sortedShardList, queryResults, fetchResults); String scrollId = null; if (request.scroll() != null) { 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 7f1b5600538..67bf4377765 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 @@ -141,7 +141,7 @@ public class TransportSearchQueryThenFetchAction extends TransportSearchTypeActi } } - private void executeFetch(final SearchShardTarget shardTarget, final AtomicInteger counter, final FetchSearchRequest fetchSearchRequest, DiscoveryNode node) { + void executeFetch(final SearchShardTarget shardTarget, final AtomicInteger counter, final FetchSearchRequest fetchSearchRequest, DiscoveryNode node) { searchService.sendExecuteFetch(node, fetchSearchRequest, new SearchServiceListener() { @Override public void onResult(FetchSearchResult result) { result.shardTarget(shardTarget); @@ -164,7 +164,7 @@ public class TransportSearchQueryThenFetchAction extends TransportSearchTypeActi }); } - private void finishHim() { + void finishHim() { try { innerFinishHim(); } catch (Exception e) { @@ -180,7 +180,7 @@ public class TransportSearchQueryThenFetchAction extends TransportSearchTypeActi } } - private void innerFinishHim() throws Exception { + void innerFinishHim() throws Exception { InternalSearchResponse internalResponse = searchPhaseController.merge(sortedShardList, queryResults, fetchResults); String scrollId = null; if (request.scroll() != null) { 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 178374bbe74..7102986e08a 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 @@ -187,11 +187,11 @@ public abstract class TransportSearchTypeAction extends BaseAction response = shardOperationOnPrimary(clusterState, new ShardOperationRequest(primaryShardId, request)); performReplicas(response); @@ -442,7 +442,7 @@ public abstract class TransportShardReplicationOperationAction response) { + void performReplicas(final PrimaryResponse response) { if (ignoreReplicas() || shardIt.size() == 1 /* no replicas */) { postPrimaryOperation(request, response); listener.onResponse(response.response()); @@ -507,7 +507,7 @@ public abstract class TransportShardReplicationOperationAction response, final AtomicInteger counter, final ShardRouting shard, String nodeId) { + void performOnReplica(final PrimaryResponse response, final AtomicInteger counter, final ShardRouting shard, String nodeId) { // if we don't have that node, it means that it might have failed and will be created again, in // this case, we don't have to do the operation, and just let it failover if (!nodes.nodeExists(nodeId)) { @@ -576,7 +576,7 @@ public abstract class TransportShardReplicationOperationAction