change the default opereationThreading on delete/index to true

This commit is contained in:
kimchy 2010-03-20 03:15:57 +02:00
parent 315cc90560
commit 2551fb9fce
4 changed files with 15 additions and 5 deletions

View File

@ -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) {
super.operationThreaded(threadedOperation);

View File

@ -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) {
super.operationThreaded(threadedOperation);

View File

@ -42,7 +42,7 @@ public abstract class ShardReplicationOperationRequest implements ActionRequest
protected String index;
private boolean threadedListener = false;
private boolean threadedOperation = false;
private boolean threadedOperation = true;
public TimeValue 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) {
this.threadedOperation = threadedOperation;

View File

@ -55,7 +55,7 @@ import java.util.concurrent.atomic.AtomicInteger;
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> {
@ -160,6 +160,13 @@ public abstract class TransportShardReplicationOperationAction<Request extends S
shardOperationOnBackup(request);
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 {