Skip to content

Commit 56ebdba

Browse files
scampibleskes
authored andcommitted
Pass the task to broadcast actions (#29672)
Since the task is required as per line 292, give the opportunity to broadcast actions to handle tasks.
1 parent f1658ff commit 56ebdba

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

server/src/main/java/org/elasticsearch/action/admin/indices/validate/query/TransportValidateQueryAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ protected ValidateQueryResponse newResponse(ValidateQueryRequest request, Atomic
184184
}
185185

186186
@Override
187-
protected ShardValidateQueryResponse shardOperation(ShardValidateQueryRequest request) throws IOException {
187+
protected ShardValidateQueryResponse shardOperation(ShardValidateQueryRequest request, Task task) throws IOException {
188188
boolean valid;
189189
String explanation = null;
190190
String error = null;

server/src/main/java/org/elasticsearch/action/support/broadcast/TransportBroadcastAction.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,7 @@ protected final void doExecute(Request request, ActionListener<Response> listene
8484

8585
protected abstract ShardResponse newShardResponse();
8686

87-
protected abstract ShardResponse shardOperation(ShardRequest request) throws IOException;
88-
89-
protected ShardResponse shardOperation(ShardRequest request, Task task) throws IOException {
90-
return shardOperation(request);
91-
}
87+
protected abstract ShardResponse shardOperation(ShardRequest request, Task task) throws IOException;
9288

9389
/**
9490
* Determines the shards this operation will be executed on. The operation is executed once per shard iterator, typically
@@ -284,7 +280,7 @@ class ShardTransportHandler implements TransportRequestHandler<ShardRequest> {
284280

285281
@Override
286282
public void messageReceived(ShardRequest request, TransportChannel channel, Task task) throws Exception {
287-
channel.sendResponse(shardOperation(request));
283+
channel.sendResponse(shardOperation(request, task));
288284
}
289285

290286
@Override

0 commit comments

Comments
 (0)