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.
This commit is contained in:
parent
9f5fe49cec
commit
39623402fc
|
@ -184,7 +184,7 @@ public class TransportValidateQueryAction extends TransportBroadcastAction<Valid
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected ShardValidateQueryResponse shardOperation(ShardValidateQueryRequest request) throws IOException {
|
protected ShardValidateQueryResponse shardOperation(ShardValidateQueryRequest request, Task task) throws IOException {
|
||||||
boolean valid;
|
boolean valid;
|
||||||
String explanation = null;
|
String explanation = null;
|
||||||
String error = null;
|
String error = null;
|
||||||
|
|
|
@ -84,11 +84,7 @@ public abstract class TransportBroadcastAction<Request extends BroadcastRequest<
|
||||||
|
|
||||||
protected abstract ShardResponse newShardResponse();
|
protected abstract ShardResponse newShardResponse();
|
||||||
|
|
||||||
protected abstract ShardResponse shardOperation(ShardRequest request) throws IOException;
|
protected abstract ShardResponse shardOperation(ShardRequest request, Task task) throws IOException;
|
||||||
|
|
||||||
protected ShardResponse shardOperation(ShardRequest request, Task task) throws IOException {
|
|
||||||
return shardOperation(request);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines the shards this operation will be executed on. The operation is executed once per shard iterator, typically
|
* Determines the shards this operation will be executed on. The operation is executed once per shard iterator, typically
|
||||||
|
@ -284,7 +280,7 @@ public abstract class TransportBroadcastAction<Request extends BroadcastRequest<
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void messageReceived(ShardRequest request, TransportChannel channel, Task task) throws Exception {
|
public void messageReceived(ShardRequest request, TransportChannel channel, Task task) throws Exception {
|
||||||
channel.sendResponse(shardOperation(request));
|
channel.sendResponse(shardOperation(request, task));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue