Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ private class TransportHandler implements TransportRequestHandler<Request> {
@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<Response>() {
@Override
public void onResponse(Response result) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<GetResponse>(){

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
}

Expand All @@ -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")));
}
}
Expand Down
22 changes: 0 additions & 22 deletions docs/java-api/docs/delete.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
22 changes: 0 additions & 22 deletions docs/java-api/docs/get.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
--------------------------------------------------
13 changes: 0 additions & 13 deletions docs/java-api/docs/index_.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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.