Skip to content

Commit

Permalink
Changed default operation_threading from single_thread to thread_per_…
Browse files Browse the repository at this point in the history
…shard.

Closes #3483
  • Loading branch information
martijnvg committed Aug 12, 2013
1 parent 8a48e2f commit 4b25e6b
Show file tree
Hide file tree
Showing 14 changed files with 9 additions and 24 deletions.
Expand Up @@ -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;

Expand All @@ -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() {
Expand Down
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}

/**
Expand Down
Expand Up @@ -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;

Expand Down Expand Up @@ -67,8 +66,6 @@ public static final class Defaults {
*/
public OptimizeRequest(String... indices) {
super(indices);
// we want to do the optimize in parallel on local shards...
operationThreading(BroadcastOperationThreading.THREAD_PER_SHARD);
}

public OptimizeRequest() {
Expand Down
Expand Up @@ -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;

Expand All @@ -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() {
Expand Down
Expand Up @@ -23,7 +23,6 @@
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;
Expand Down Expand Up @@ -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) {
Expand Down
Expand Up @@ -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() {
Expand Down
Expand Up @@ -87,7 +87,7 @@ public void handleRequest(final RestRequest request, final RestChannel channel)
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;
Expand Down
Expand Up @@ -61,7 +61,7 @@ public void handleRequest(final RestRequest request, final RestChannel channel)
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;
Expand Down
Expand Up @@ -69,7 +69,7 @@ public void handleRequest(final RestRequest request, final RestChannel channel)
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;
Expand Down
Expand Up @@ -61,7 +61,7 @@ public void handleRequest(final RestRequest request, final RestChannel channel)
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;
Expand Down
Expand Up @@ -56,7 +56,7 @@ public void handleRequest(final RestRequest request, final RestChannel channel)
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;
Expand Down
Expand Up @@ -65,7 +65,7 @@ public void handleRequest(final RestRequest request, final RestChannel channel)
}
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;
Expand Down
Expand Up @@ -67,7 +67,7 @@ public void handleRequest(final RestRequest request, final RestChannel channel)
}
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;
Expand Down
Expand Up @@ -64,7 +64,7 @@ public void handleRequest(final RestRequest request, final RestChannel channel)
}
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;
Expand Down

0 comments on commit 4b25e6b

Please sign in to comment.