change the default opereationThreading on delete/index to true
This commit is contained in:
parent
315cc90560
commit
2551fb9fce
|
@ -91,7 +91,8 @@ public class DeleteRequest extends ShardReplicationOperationRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Controls if the operation will be executed on a separate thread when executed locally.
|
* Controls if the operation will be executed on a separate thread when executed locally. Defaults
|
||||||
|
* to <tt>true</tt> when running in embedded mode.
|
||||||
*/
|
*/
|
||||||
@Override public DeleteRequest operationThreaded(boolean threadedOperation) {
|
@Override public DeleteRequest operationThreaded(boolean threadedOperation) {
|
||||||
super.operationThreaded(threadedOperation);
|
super.operationThreaded(threadedOperation);
|
||||||
|
|
|
@ -150,7 +150,8 @@ public class IndexRequest extends ShardReplicationOperationRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Controls if the operation will be executed on a separate thread when executed locally.
|
* Controls if the operation will be executed on a separate thread when executed locally. Defaults
|
||||||
|
* to <tt>true</tt> when running in embedded mode.
|
||||||
*/
|
*/
|
||||||
@Override public IndexRequest operationThreaded(boolean threadedOperation) {
|
@Override public IndexRequest operationThreaded(boolean threadedOperation) {
|
||||||
super.operationThreaded(threadedOperation);
|
super.operationThreaded(threadedOperation);
|
||||||
|
|
|
@ -42,7 +42,7 @@ public abstract class ShardReplicationOperationRequest implements ActionRequest
|
||||||
protected String index;
|
protected String index;
|
||||||
|
|
||||||
private boolean threadedListener = false;
|
private boolean threadedListener = false;
|
||||||
private boolean threadedOperation = false;
|
private boolean threadedOperation = true;
|
||||||
|
|
||||||
public TimeValue timeout() {
|
public TimeValue timeout() {
|
||||||
return timeout;
|
return timeout;
|
||||||
|
@ -76,7 +76,8 @@ public abstract class ShardReplicationOperationRequest implements ActionRequest
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Controls if the operation will be executed on a separate thread when executed locally.
|
* Controls if the operation will be executed on a separate thread when executed locally. Defaults
|
||||||
|
* to <tt>true</tt> when running in embedded mode.
|
||||||
*/
|
*/
|
||||||
public ShardReplicationOperationRequest operationThreaded(boolean threadedOperation) {
|
public ShardReplicationOperationRequest operationThreaded(boolean threadedOperation) {
|
||||||
this.threadedOperation = threadedOperation;
|
this.threadedOperation = threadedOperation;
|
||||||
|
|
|
@ -55,7 +55,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import static org.elasticsearch.ExceptionsHelper.*;
|
import static org.elasticsearch.ExceptionsHelper.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author kimchy (Shay Banon)
|
* @author kimchy (shay.banon)
|
||||||
*/
|
*/
|
||||||
public abstract class TransportShardReplicationOperationAction<Request extends ShardReplicationOperationRequest, Response extends ActionResponse> extends BaseAction<Request, Response> {
|
public abstract class TransportShardReplicationOperationAction<Request extends ShardReplicationOperationRequest, Response extends ActionResponse> extends BaseAction<Request, Response> {
|
||||||
|
|
||||||
|
@ -160,6 +160,13 @@ public abstract class TransportShardReplicationOperationAction<Request extends S
|
||||||
shardOperationOnBackup(request);
|
shardOperationOnBackup(request);
|
||||||
channel.sendResponse(VoidStreamable.INSTANCE);
|
channel.sendResponse(VoidStreamable.INSTANCE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* We spawn, since we want to perform the operation on the backup on a different thread.
|
||||||
|
*/
|
||||||
|
@Override public boolean spawn() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected class ShardOperationRequest implements Streamable {
|
protected class ShardOperationRequest implements Streamable {
|
||||||
|
|
Loading…
Reference in New Issue