Skip to content

Commit

Permalink
Pass the task to broadcast actions (#29672)
Browse files Browse the repository at this point in the history
Since the task is required as per line 292, give the opportunity to broadcast actions to handle tasks.
  • Loading branch information
scampi authored and bleskes committed May 9, 2018
1 parent f1658ff commit 56ebdba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ protected ValidateQueryResponse newResponse(ValidateQueryRequest request, Atomic
}

@Override
protected ShardValidateQueryResponse shardOperation(ShardValidateQueryRequest request) throws IOException {
protected ShardValidateQueryResponse shardOperation(ShardValidateQueryRequest request, Task task) throws IOException {
boolean valid;
String explanation = null;
String error = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,7 @@ protected final void doExecute(Request request, ActionListener<Response> listene

protected abstract ShardResponse newShardResponse();

protected abstract ShardResponse shardOperation(ShardRequest request) throws IOException;

protected ShardResponse shardOperation(ShardRequest request, Task task) throws IOException {
return shardOperation(request);
}
protected abstract ShardResponse shardOperation(ShardRequest request, Task task) throws IOException;

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

@Override
public void messageReceived(ShardRequest request, TransportChannel channel, Task task) throws Exception {
channel.sendResponse(shardOperation(request));
channel.sendResponse(shardOperation(request, task));
}

@Override
Expand Down

0 comments on commit 56ebdba

Please sign in to comment.