Skip to content

Commit 23de533

Browse files
Remove unused parameter from AbstractSearchAsyncAction.onShardResult (#121887)
Recent cleanups made the shard iterator unused on this method.
1 parent cbcdd0a commit 23de533

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

server/src/main/java/org/elasticsearch/action/search/AbstractSearchAsyncAction.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ private void doPerformPhaseOnShard(int shardIndex, SearchShardIterator shardIt,
300300
public void innerOnResponse(Result result) {
301301
try {
302302
releasable.close();
303-
onShardResult(result, shardIt);
303+
onShardResult(result);
304304
} catch (Exception exc) {
305305
onShardFailure(shardIndex, shard, shardIt, exc);
306306
}
@@ -526,9 +526,8 @@ private static boolean isTaskCancelledException(Exception e) {
526526
/**
527527
* Executed once for every successful shard level request.
528528
* @param result the result returned form the shard
529-
* @param shardIt the shard iterator
530529
*/
531-
protected void onShardResult(Result result, SearchShardIterator shardIt) {
530+
protected void onShardResult(Result result) {
532531
assert result.getShardIndex() != -1 : "shard index is not set";
533532
assert result.getSearchShardTarget() != null : "search shard target must not be null";
534533
hasShardResponse.set(true);
@@ -732,7 +731,7 @@ void sendReleaseSearchContext(ShardSearchContextId contextId, Transport.Connecti
732731
/**
733732
* Executed once all shard results have been received and processed
734733
* @see #onShardFailure(int, SearchShardTarget, Exception)
735-
* @see #onShardResult(SearchPhaseResult, SearchShardIterator)
734+
* @see #onShardResult(SearchPhaseResult)
736735
*/
737736
private void onPhaseDone() { // as a tribute to @kimchy aka. finishHim()
738737
executeNextPhase(getName(), this::getNextPhase);

server/src/main/java/org/elasticsearch/action/search/SearchQueryThenFetchAsyncAction.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ protected void onShardGroupFailure(int shardIndex, SearchShardTarget shardTarget
104104
}
105105

106106
@Override
107-
protected void onShardResult(SearchPhaseResult result, SearchShardIterator shardIt) {
107+
protected void onShardResult(SearchPhaseResult result) {
108108
QuerySearchResult queryResult = result.queryResult();
109109
if (queryResult.isNull() == false
110110
// disable sort optims for scroll requests because they keep track of the last bottom doc locally (per shard)
@@ -123,7 +123,7 @@ && getRequest().scroll() == null
123123
}
124124
bottomSortCollector.consumeTopDocs(topDocs, queryResult.sortValueFormats());
125125
}
126-
super.onShardResult(result, shardIt);
126+
super.onShardResult(result);
127127
}
128128

129129
static SearchPhase nextPhase(

server/src/test/java/org/elasticsearch/action/search/MockSearchPhaseContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ protected void executePhaseOnShard(
151151
SearchActionListener<SearchPhaseResult> listener
152152
) {
153153
onShardResult(new SearchPhaseResult() {
154-
}, shardIt);
154+
});
155155
}
156156

157157
@Override

0 commit comments

Comments
 (0)