mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-24 17:09:48 +00:00
remove private so won't create access$ calls
This commit is contained in:
parent
9d9fa53ba9
commit
9df339f23b
@ -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<QueryFetchSearchResult>() {
|
||||
@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;
|
||||
|
@ -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<QuerySearchResult>() {
|
||||
@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<SearchShardTarget, ExtTIntArrayList> 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<FetchSearchResult>() {
|
||||
@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) {
|
||||
|
@ -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<FetchSearchResult>() {
|
||||
@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) {
|
||||
|
@ -187,11 +187,11 @@ public abstract class TransportSearchTypeAction extends BaseAction<SearchRequest
|
||||
}
|
||||
}
|
||||
|
||||
private void performFirstPhase(final ShardIterator shardIt) {
|
||||
void performFirstPhase(final ShardIterator shardIt) {
|
||||
performFirstPhase(shardIt, shardIt.nextOrNull());
|
||||
}
|
||||
|
||||
private void performFirstPhase(final ShardIterator shardIt, final ShardRouting shard) {
|
||||
void performFirstPhase(final ShardIterator shardIt, final ShardRouting shard) {
|
||||
if (shard == null) {
|
||||
// no more active shards... (we should not really get here, but just for safety)
|
||||
onFirstPhaseResult(null, shardIt, null);
|
||||
@ -214,7 +214,7 @@ public abstract class TransportSearchTypeAction extends BaseAction<SearchRequest
|
||||
}
|
||||
}
|
||||
|
||||
private void onFirstPhaseResult(ShardRouting shard, FirstResult result, ShardIterator shardIt) {
|
||||
void onFirstPhaseResult(ShardRouting shard, FirstResult result, ShardIterator shardIt) {
|
||||
result.shardTarget(new SearchShardTarget(shard.currentNodeId(), shard.index(), shard.id()));
|
||||
processFirstPhaseResult(shard, result);
|
||||
// increment all the "future" shards to update the total ops since we some may work and some may not...
|
||||
@ -233,7 +233,7 @@ public abstract class TransportSearchTypeAction extends BaseAction<SearchRequest
|
||||
}
|
||||
}
|
||||
|
||||
private void onFirstPhaseResult(@Nullable ShardRouting shard, final ShardIterator shardIt, Throwable t) {
|
||||
void onFirstPhaseResult(@Nullable ShardRouting shard, final ShardIterator shardIt, Throwable t) {
|
||||
if (totalOps.incrementAndGet() == expectedTotalOps) {
|
||||
// e is null when there is no next active....
|
||||
if (logger.isDebugEnabled()) {
|
||||
|
@ -201,11 +201,11 @@ public abstract class TransportBroadcastOperationAction<Request extends Broadcas
|
||||
}
|
||||
}
|
||||
|
||||
private void performOperation(final ShardIterator shardIt, boolean localAsync) {
|
||||
void performOperation(final ShardIterator shardIt, boolean localAsync) {
|
||||
performOperation(shardIt, shardIt.nextOrNull(), localAsync);
|
||||
}
|
||||
|
||||
private void performOperation(final ShardIterator shardIt, final ShardRouting shard, boolean localAsync) {
|
||||
void performOperation(final ShardIterator shardIt, final ShardRouting shard, boolean localAsync) {
|
||||
if (shard == null) {
|
||||
// no more active shards... (we should not really get here, just safety)
|
||||
onOperation(null, shardIt, null);
|
||||
@ -257,16 +257,14 @@ public abstract class TransportBroadcastOperationAction<Request extends Broadcas
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
private void onOperation(ShardRouting shard, ShardResponse response) {
|
||||
@SuppressWarnings({"unchecked"}) void onOperation(ShardRouting shard, ShardResponse response) {
|
||||
shardsResponses.set(indexCounter.getAndIncrement(), response);
|
||||
if (expectedOps == counterOps.incrementAndGet()) {
|
||||
finishHim();
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
private void onOperation(@Nullable ShardRouting shard, final ShardIterator shardIt, Throwable t) {
|
||||
@SuppressWarnings({"unchecked"}) void onOperation(@Nullable ShardRouting shard, final ShardIterator shardIt, Throwable t) {
|
||||
ShardRouting nextShard = shardIt.nextOrNull();
|
||||
if (nextShard != null) {
|
||||
// trace log this exception
|
||||
@ -313,7 +311,7 @@ public abstract class TransportBroadcastOperationAction<Request extends Broadcas
|
||||
}
|
||||
}
|
||||
|
||||
private void finishHim() {
|
||||
void finishHim() {
|
||||
listener.onResponse(newResponse(request, shardsResponses, clusterState));
|
||||
}
|
||||
}
|
||||
|
@ -384,7 +384,7 @@ public abstract class TransportShardReplicationOperationAction<Request extends S
|
||||
return true;
|
||||
}
|
||||
|
||||
private void retry(boolean fromClusterEvent, final ShardId shardId) {
|
||||
void retry(boolean fromClusterEvent, final ShardId shardId) {
|
||||
if (!fromClusterEvent) {
|
||||
// make it threaded operation so we fork on the discovery listener thread
|
||||
request.beforeLocalFork();
|
||||
@ -423,7 +423,7 @@ public abstract class TransportShardReplicationOperationAction<Request extends S
|
||||
}
|
||||
}
|
||||
|
||||
private void performOnPrimary(int primaryShardId, boolean fromDiscoveryListener, final ShardRouting shard, ClusterState clusterState) {
|
||||
void performOnPrimary(int primaryShardId, boolean fromDiscoveryListener, final ShardRouting shard, ClusterState clusterState) {
|
||||
try {
|
||||
PrimaryResponse<Response> response = shardOperationOnPrimary(clusterState, new ShardOperationRequest(primaryShardId, request));
|
||||
performReplicas(response);
|
||||
@ -442,7 +442,7 @@ public abstract class TransportShardReplicationOperationAction<Request extends S
|
||||
}
|
||||
}
|
||||
|
||||
private void performReplicas(final PrimaryResponse<Response> response) {
|
||||
void performReplicas(final PrimaryResponse<Response> response) {
|
||||
if (ignoreReplicas() || shardIt.size() == 1 /* no replicas */) {
|
||||
postPrimaryOperation(request, response);
|
||||
listener.onResponse(response.response());
|
||||
@ -507,7 +507,7 @@ public abstract class TransportShardReplicationOperationAction<Request extends S
|
||||
}
|
||||
}
|
||||
|
||||
private void performOnReplica(final PrimaryResponse<Response> response, final AtomicInteger counter, final ShardRouting shard, String nodeId) {
|
||||
void performOnReplica(final PrimaryResponse<Response> 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<Request extends S
|
||||
/**
|
||||
* Should an exception be ignored when the operation is performed on the replica.
|
||||
*/
|
||||
private boolean ignoreReplicaException(Throwable e) {
|
||||
boolean ignoreReplicaException(Throwable e) {
|
||||
Throwable cause = ExceptionsHelper.unwrapCause(e);
|
||||
if (cause instanceof IllegalIndexShardStateException) {
|
||||
return true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user