diff --git a/core/src/main/java/org/elasticsearch/action/support/single/shard/SingleShardOperationRequestBuilder.java b/core/src/main/java/org/elasticsearch/action/support/single/shard/SingleShardOperationRequestBuilder.java index 03d4fb6343d6c..af6ee2287f212 100644 --- a/core/src/main/java/org/elasticsearch/action/support/single/shard/SingleShardOperationRequestBuilder.java +++ b/core/src/main/java/org/elasticsearch/action/support/single/shard/SingleShardOperationRequestBuilder.java @@ -39,13 +39,4 @@ public final RequestBuilder setIndex(String index) { request.index(index); return (RequestBuilder) this; } - - /** - * Controls if the operation will be executed on a separate thread when executed locally. - */ - @SuppressWarnings("unchecked") - public final RequestBuilder setOperationThreaded(boolean threadedOperation) { - request.operationThreaded(threadedOperation); - return (RequestBuilder) this; - } } diff --git a/core/src/main/java/org/elasticsearch/action/support/single/shard/SingleShardRequest.java b/core/src/main/java/org/elasticsearch/action/support/single/shard/SingleShardRequest.java index 18f054bb82ed3..88c65381e7ad8 100644 --- a/core/src/main/java/org/elasticsearch/action/support/single/shard/SingleShardRequest.java +++ b/core/src/main/java/org/elasticsearch/action/support/single/shard/SingleShardRequest.java @@ -94,22 +94,6 @@ public IndicesOptions indicesOptions() { return INDICES_OPTIONS; } - /** - * Controls if the operation will be executed on a separate thread when executed locally. - */ - public boolean operationThreaded() { - return threadedOperation; - } - - /** - * Controls if the operation will be executed on a separate thread when executed locally. - */ - @SuppressWarnings("unchecked") - public final Request operationThreaded(boolean threadedOperation) { - this.threadedOperation = threadedOperation; - return (Request) this; - } - @Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); diff --git a/core/src/main/java/org/elasticsearch/action/support/single/shard/TransportSingleShardAction.java b/core/src/main/java/org/elasticsearch/action/support/single/shard/TransportSingleShardAction.java index f2b2090dc286e..528eacac3dafb 100644 --- a/core/src/main/java/org/elasticsearch/action/support/single/shard/TransportSingleShardAction.java +++ b/core/src/main/java/org/elasticsearch/action/support/single/shard/TransportSingleShardAction.java @@ -277,7 +277,6 @@ private class TransportHandler implements TransportRequestHandler { @Override public void messageReceived(Request request, final TransportChannel channel) throws Exception { // if we have a local operation, execute it on a thread since we don't spawn - request.operationThreaded(true); execute(request, new ActionListener() { @Override public void onResponse(Response result) { diff --git a/core/src/main/java/org/elasticsearch/index/query/GeoShapeQueryBuilder.java b/core/src/main/java/org/elasticsearch/index/query/GeoShapeQueryBuilder.java index 0f9006ed7da25..c4a6f7fa6b7f1 100644 --- a/core/src/main/java/org/elasticsearch/index/query/GeoShapeQueryBuilder.java +++ b/core/src/main/java/org/elasticsearch/index/query/GeoShapeQueryBuilder.java @@ -383,7 +383,6 @@ private void fetch(Client client, GetRequest getRequest, String path, ActionList throw new IllegalStateException("JTS not available"); } getRequest.preference("_local"); - getRequest.operationThreaded(false); client.get(getRequest, new ActionListener(){ @Override diff --git a/core/src/main/java/org/elasticsearch/rest/action/document/RestGetAction.java b/core/src/main/java/org/elasticsearch/rest/action/document/RestGetAction.java index 3265a59692b61..8f86d9ae600a9 100644 --- a/core/src/main/java/org/elasticsearch/rest/action/document/RestGetAction.java +++ b/core/src/main/java/org/elasticsearch/rest/action/document/RestGetAction.java @@ -56,7 +56,6 @@ public String getName() { @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { final GetRequest getRequest = new GetRequest(request.param("index"), request.param("type"), request.param("id")); - getRequest.operationThreaded(true); getRequest.refresh(request.paramAsBoolean("refresh", getRequest.refresh())); getRequest.routing(request.param("routing")); getRequest.parent(request.param("parent")); diff --git a/core/src/main/java/org/elasticsearch/rest/action/document/RestGetSourceAction.java b/core/src/main/java/org/elasticsearch/rest/action/document/RestGetSourceAction.java index fead47db744c1..ca1d20da77740 100644 --- a/core/src/main/java/org/elasticsearch/rest/action/document/RestGetSourceAction.java +++ b/core/src/main/java/org/elasticsearch/rest/action/document/RestGetSourceAction.java @@ -59,7 +59,6 @@ public String getName() { @Override public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { final GetRequest getRequest = new GetRequest(request.param("index"), request.param("type"), request.param("id")); - getRequest.operationThreaded(true); getRequest.refresh(request.paramAsBoolean("refresh", getRequest.refresh())); getRequest.routing(request.param("routing")); getRequest.parent(request.param("parent")); diff --git a/core/src/test/java/org/elasticsearch/document/DocumentActionsIT.java b/core/src/test/java/org/elasticsearch/document/DocumentActionsIT.java index c0011f79026bd..88bab97a1f3ff 100644 --- a/core/src/test/java/org/elasticsearch/document/DocumentActionsIT.java +++ b/core/src/test/java/org/elasticsearch/document/DocumentActionsIT.java @@ -95,11 +95,11 @@ public void testIndexActions() throws Exception { logger.info("Get [type1/1]"); for (int i = 0; i < 5; i++) { - getResult = client().prepareGet("test", "type1", "1").setOperationThreaded(false).execute().actionGet(); + getResult = client().prepareGet("test", "type1", "1").execute().actionGet(); assertThat(getResult.getIndex(), equalTo(getConcreteIndexName())); assertThat("cycle #" + i, getResult.getSourceAsString(), equalTo(source("1", "test").string())); assertThat("cycle(map) #" + i, (String) getResult.getSourceAsMap().get("name"), equalTo("test")); - getResult = client().get(getRequest("test").type("type1").id("1").operationThreaded(true)).actionGet(); + getResult = client().get(getRequest("test").type("type1").id("1")).actionGet(); assertThat("cycle #" + i, getResult.getSourceAsString(), equalTo(source("1", "test").string())); assertThat(getResult.getIndex(), equalTo(getConcreteIndexName())); } diff --git a/core/src/test/java/org/elasticsearch/recovery/SimpleRecoveryIT.java b/core/src/test/java/org/elasticsearch/recovery/SimpleRecoveryIT.java index bf8bce8ae6334..3096c7b9e4f13 100644 --- a/core/src/test/java/org/elasticsearch/recovery/SimpleRecoveryIT.java +++ b/core/src/test/java/org/elasticsearch/recovery/SimpleRecoveryIT.java @@ -72,13 +72,13 @@ public void testSimpleRecovery() throws Exception { GetResponse getResult; for (int i = 0; i < 5; i++) { - getResult = client().get(getRequest("test").type("type1").id("1").operationThreaded(false)).actionGet(); + getResult = client().get(getRequest("test").type("type1").id("1")).actionGet(); assertThat(getResult.getSourceAsString(), equalTo(source("1", "test"))); - getResult = client().get(getRequest("test").type("type1").id("1").operationThreaded(false)).actionGet(); + getResult = client().get(getRequest("test").type("type1").id("1")).actionGet(); assertThat(getResult.getSourceAsString(), equalTo(source("1", "test"))); - getResult = client().get(getRequest("test").type("type1").id("2").operationThreaded(true)).actionGet(); + getResult = client().get(getRequest("test").type("type1").id("2")).actionGet(); assertThat(getResult.getSourceAsString(), equalTo(source("2", "test"))); - getResult = client().get(getRequest("test").type("type1").id("2").operationThreaded(true)).actionGet(); + getResult = client().get(getRequest("test").type("type1").id("2")).actionGet(); assertThat(getResult.getSourceAsString(), equalTo(source("2", "test"))); } @@ -95,11 +95,11 @@ public void testSimpleRecovery() throws Exception { assertThat(getResult.getSourceAsString(), equalTo(source("1", "test"))); getResult = client().get(getRequest("test").type("type1").id("1")).actionGet(); assertThat(getResult.getSourceAsString(), equalTo(source("1", "test"))); - getResult = client().get(getRequest("test").type("type1").id("2").operationThreaded(true)).actionGet(); + getResult = client().get(getRequest("test").type("type1").id("2")).actionGet(); assertThat(getResult.getSourceAsString(), equalTo(source("2", "test"))); - getResult = client().get(getRequest("test").type("type1").id("2").operationThreaded(true)).actionGet(); + getResult = client().get(getRequest("test").type("type1").id("2")).actionGet(); assertThat(getResult.getSourceAsString(), equalTo(source("2", "test"))); - getResult = client().get(getRequest("test").type("type1").id("2").operationThreaded(true)).actionGet(); + getResult = client().get(getRequest("test").type("type1").id("2")).actionGet(); assertThat(getResult.getSourceAsString(), equalTo(source("2", "test"))); } } diff --git a/docs/java-api/docs/delete.asciidoc b/docs/java-api/docs/delete.asciidoc index 3e3788cda2472..218ea14553b4c 100644 --- a/docs/java-api/docs/delete.asciidoc +++ b/docs/java-api/docs/delete.asciidoc @@ -14,28 +14,6 @@ DeleteResponse response = client.prepareDelete("twitter", "tweet", "1").get(); For more information on the delete operation, check out the {ref}/docs-delete.html[delete API] docs. - -[[java-docs-delete-thread]] -==== Operation Threading - -The delete API allows to set the threading model the operation will be -performed when the actual execution of the API is performed on the same -node (the API is executed on a shard that is allocated on the same -server). - -The options are to execute the operation on a different thread, or to -execute it on the calling thread (note that the API is still async). By -default, `operationThreaded` is set to `true` which means the operation -is executed on a different thread. Here is an example that sets it to -`false`: - -[source,java] --------------------------------------------------- -DeleteResponse response = client.prepareDelete("twitter", "tweet", "1") - .setOperationThreaded(false) - .get(); --------------------------------------------------- - [[java-docs-delete-by-query]] === Delete By Query API diff --git a/docs/java-api/docs/get.asciidoc b/docs/java-api/docs/get.asciidoc index cde1b55a077cc..24f17e1c9ada3 100644 --- a/docs/java-api/docs/get.asciidoc +++ b/docs/java-api/docs/get.asciidoc @@ -12,25 +12,3 @@ GetResponse response = client.prepareGet("twitter", "tweet", "1").get(); For more information on the get operation, check out the REST {ref}/docs-get.html[get] docs. - - -[[java-docs-get-thread]] -==== Operation Threading - -The get API allows to set the threading model the operation will be -performed when the actual execution of the API is performed on the same -node (the API is executed on a shard that is allocated on the same -server). - -The options are to execute the operation on a different thread, or to -execute it on the calling thread (note that the API is still async). By -default, `operationThreaded` is set to `true` which means the operation -is executed on a different thread. Here is an example that sets it to -`false`: - -[source,java] --------------------------------------------------- -GetResponse response = client.prepareGet("twitter", "tweet", "1") - .setOperationThreaded(false) - .get(); --------------------------------------------------- diff --git a/docs/java-api/docs/index_.asciidoc b/docs/java-api/docs/index_.asciidoc index b32955d9d4f50..b455a7ab01ff3 100644 --- a/docs/java-api/docs/index_.asciidoc +++ b/docs/java-api/docs/index_.asciidoc @@ -163,16 +163,3 @@ RestStatus status = response.status(); For more information on the index operation, check out the REST {ref}/docs-index_.html[index] docs. - -[[java-docs-index-thread]] -==== Operation Threading - -The index API allows one to set the threading model the operation will be -performed when the actual execution of the API is performed on the same -node (the API is executed on a shard that is allocated on the same -server). - -The options are to execute the operation on a different thread, or to -execute it on the calling thread (note that the API is still asynchronous). By -default, `operationThreaded` is set to `true` which means the operation -is executed on a different thread.