Changed default operation_threading from single_thread to thread_per_shard.

Closes #3483
This commit is contained in:
Martijn van Groningen 2013-08-12 15:30:09 +02:00
parent 8a48e2f969
commit 4b25e6b63e
14 changed files with 9 additions and 24 deletions

View File

@ -20,7 +20,6 @@
package org.elasticsearch.action.admin.indices.cache.clear;
import org.elasticsearch.action.support.broadcast.BroadcastOperationRequest;
import org.elasticsearch.action.support.broadcast.BroadcastOperationThreading;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
@ -44,8 +43,6 @@ public class ClearIndicesCacheRequest extends BroadcastOperationRequest<ClearInd
public ClearIndicesCacheRequest(String... indices) {
super(indices);
// we want to do the refresh in parallel on local shards...
operationThreading(BroadcastOperationThreading.THREAD_PER_SHARD);
}
public boolean filterCache() {

View File

@ -20,7 +20,6 @@
package org.elasticsearch.action.admin.indices.flush;
import org.elasticsearch.action.support.broadcast.BroadcastOperationRequest;
import org.elasticsearch.action.support.broadcast.BroadcastOperationThreading;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
@ -55,8 +54,6 @@ public class FlushRequest extends BroadcastOperationRequest<FlushRequest> {
*/
public FlushRequest(String... indices) {
super(indices);
// we want to do the refresh in parallel on local shards...
operationThreading(BroadcastOperationThreading.THREAD_PER_SHARD);
}
/**

View File

@ -20,7 +20,6 @@
package org.elasticsearch.action.admin.indices.optimize;
import org.elasticsearch.action.support.broadcast.BroadcastOperationRequest;
import org.elasticsearch.action.support.broadcast.BroadcastOperationThreading;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
@ -67,8 +66,6 @@ public class OptimizeRequest extends BroadcastOperationRequest<OptimizeRequest>
*/
public OptimizeRequest(String... indices) {
super(indices);
// we want to do the optimize in parallel on local shards...
operationThreading(BroadcastOperationThreading.THREAD_PER_SHARD);
}
public OptimizeRequest() {

View File

@ -20,7 +20,6 @@
package org.elasticsearch.action.admin.indices.refresh;
import org.elasticsearch.action.support.broadcast.BroadcastOperationRequest;
import org.elasticsearch.action.support.broadcast.BroadcastOperationThreading;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
@ -44,8 +43,6 @@ public class RefreshRequest extends BroadcastOperationRequest<RefreshRequest> {
public RefreshRequest(String... indices) {
super(indices);
// we want to do the refresh in parallel on local shards...
operationThreading(BroadcastOperationThreading.THREAD_PER_SHARD);
}
public boolean waitForOperations() {

View File

@ -23,7 +23,6 @@ import org.elasticsearch.ElasticSearchGenerationException;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.get.GetRequest;
import org.elasticsearch.action.support.broadcast.BroadcastOperationRequest;
import org.elasticsearch.action.support.broadcast.BroadcastOperationThreading;
import org.elasticsearch.client.Requests;
import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.bytes.BytesReference;
@ -61,8 +60,6 @@ public class PercolateRequest extends BroadcastOperationRequest<PercolateRequest
long startTime;
public PercolateRequest() {
// we want to do the percolate in parallel on all the local shards
operationThreading(BroadcastOperationThreading.THREAD_PER_SHARD);
}
public PercolateRequest(PercolateRequest request, BytesReference docSource) {

View File

@ -34,7 +34,7 @@ public abstract class BroadcastOperationRequest<T extends BroadcastOperationRequ
protected String[] indices;
private BroadcastOperationThreading operationThreading = BroadcastOperationThreading.SINGLE_THREAD;
private BroadcastOperationThreading operationThreading = BroadcastOperationThreading.THREAD_PER_SHARD;
private IgnoreIndices ignoreIndices = IgnoreIndices.NONE;
protected BroadcastOperationRequest() {

View File

@ -87,7 +87,7 @@ public class RestClearIndicesCacheAction extends BaseRestHandler {
clearIndicesCacheRequest.fields(request.paramAsStringArray("fields", clearIndicesCacheRequest.fields()));
clearIndicesCacheRequest.filterKeys(request.paramAsStringArray("filter_keys", clearIndicesCacheRequest.filterKeys()));
BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operationThreading"), BroadcastOperationThreading.SINGLE_THREAD);
BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operationThreading"), BroadcastOperationThreading.THREAD_PER_SHARD);
if (operationThreading == BroadcastOperationThreading.NO_THREADS) {
// since we don't spawn, don't allow no_threads, but change it to a single thread
operationThreading = BroadcastOperationThreading.THREAD_PER_SHARD;

View File

@ -61,7 +61,7 @@ public class RestFlushAction extends BaseRestHandler {
if (request.hasParam("ignore_indices")) {
flushRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
}
BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operationThreading"), BroadcastOperationThreading.SINGLE_THREAD);
BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operationThreading"), BroadcastOperationThreading.THREAD_PER_SHARD);
if (operationThreading == BroadcastOperationThreading.NO_THREADS) {
// since we don't spawn, don't allow no_threads, but change it to a single thread
operationThreading = BroadcastOperationThreading.THREAD_PER_SHARD;

View File

@ -69,7 +69,7 @@ public class RestOptimizeAction extends BaseRestHandler {
optimizeRequest.flush(request.paramAsBoolean("flush", optimizeRequest.flush()));
optimizeRequest.refresh(request.paramAsBoolean("refresh", optimizeRequest.refresh()));
BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operation_threading"), BroadcastOperationThreading.SINGLE_THREAD);
BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operation_threading"), BroadcastOperationThreading.THREAD_PER_SHARD);
if (operationThreading == BroadcastOperationThreading.NO_THREADS) {
// since we don't spawn, don't allow no_threads, but change it to a single thread
operationThreading = BroadcastOperationThreading.THREAD_PER_SHARD;

View File

@ -61,7 +61,7 @@ public class RestRefreshAction extends BaseRestHandler {
if (request.hasParam("ignore_indices")) {
refreshRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
}
BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operation_threading"), BroadcastOperationThreading.SINGLE_THREAD);
BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operation_threading"), BroadcastOperationThreading.THREAD_PER_SHARD);
if (operationThreading == BroadcastOperationThreading.NO_THREADS) {
// since we don't spawn, don't allow no_threads, but change it to a single thread
operationThreading = BroadcastOperationThreading.THREAD_PER_SHARD;

View File

@ -56,7 +56,7 @@ public class RestIndicesSegmentsAction extends BaseRestHandler {
if (request.hasParam("ignore_indices")) {
indicesSegmentsRequest.ignoreIndices(IgnoreIndices.fromString(request.param("ignore_indices")));
}
BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operation_threading"), BroadcastOperationThreading.SINGLE_THREAD);
BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operation_threading"), BroadcastOperationThreading.THREAD_PER_SHARD);
if (operationThreading == BroadcastOperationThreading.NO_THREADS) {
// since we don't spawn, don't allow no_threads, but change it to a single thread
operationThreading = BroadcastOperationThreading.SINGLE_THREAD;

View File

@ -65,7 +65,7 @@ public class RestIndicesStatusAction extends BaseRestHandler {
}
indicesStatusRequest.recovery(request.paramAsBoolean("recovery", indicesStatusRequest.recovery()));
indicesStatusRequest.snapshot(request.paramAsBoolean("snapshot", indicesStatusRequest.snapshot()));
BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operation_threading"), BroadcastOperationThreading.SINGLE_THREAD);
BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operation_threading"), BroadcastOperationThreading.THREAD_PER_SHARD);
if (operationThreading == BroadcastOperationThreading.NO_THREADS) {
// since we don't spawn, don't allow no_threads, but change it to a single thread
operationThreading = BroadcastOperationThreading.SINGLE_THREAD;

View File

@ -67,7 +67,7 @@ public class RestCountAction extends BaseRestHandler {
}
countRequest.listenerThreaded(false);
try {
BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operation_threading"), BroadcastOperationThreading.SINGLE_THREAD);
BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operation_threading"), BroadcastOperationThreading.THREAD_PER_SHARD);
if (operationThreading == BroadcastOperationThreading.NO_THREADS) {
// since we don't spawn, don't allow no_threads, but change it to a single thread
operationThreading = BroadcastOperationThreading.SINGLE_THREAD;

View File

@ -64,7 +64,7 @@ public class RestSuggestAction extends BaseRestHandler {
}
suggestRequest.listenerThreaded(false);
try {
BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operation_threading"), BroadcastOperationThreading.SINGLE_THREAD);
BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operation_threading"), BroadcastOperationThreading.THREAD_PER_SHARD);
if (operationThreading == BroadcastOperationThreading.NO_THREADS) {
// since we don't spawn, don't allow no_threads, but change it to a single thread
operationThreading = BroadcastOperationThreading.SINGLE_THREAD;