Examples of operationThreaded()


Examples of org.elasticsearch.action.admin.cluster.ping.single.SinglePingRequest.operationThreaded()

    @Override public void handleRequest(final RestRequest request, final RestChannel channel) {
        SinglePingRequest singlePingRequest = new SinglePingRequest(request.param("index"), request.param("type"), request.param("id"));
        // no need to have a threaded listener since we just send back a response
        singlePingRequest.listenerThreaded(false);
        // if we have a local operation, execute it on a thread since we don't spawn
        singlePingRequest.operationThreaded(true);
        client.admin().cluster().ping(singlePingRequest, new ActionListener<SinglePingResponse>() {
            @Override public void onResponse(SinglePingResponse result) {
                try {
                    XContentBuilder generator = RestXContentBuilder.restContentBuilder(request);
                    generator.startObject().field("ok", true).endObject();
View Full Code Here

Examples of org.elasticsearch.action.delete.DeleteRequest.operationThreaded()

        deleteRequest.refresh(request.paramAsBoolean("refresh", deleteRequest.refresh()));
        deleteRequest.version(RestActions.parseVersion(request));
        // we just send a response, no need to fork
        deleteRequest.listenerThreaded(false);
        // we don't spawn, then fork if local
        deleteRequest.operationThreaded(true);

        String replicationType = request.param("replication");
        if (replicationType != null) {
            deleteRequest.replicationType(ReplicationType.fromString(replicationType));
        }
View Full Code Here

Examples of org.elasticsearch.action.delete.DeleteRequest.operationThreaded()

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        DeleteRequest deleteRequest = new DeleteRequest(request.param("index"), request.param("type"), request.param("id"));

        deleteRequest.listenerThreaded(false);
        deleteRequest.operationThreaded(true);

        deleteRequest.routing(request.param("routing"));
        deleteRequest.parent(request.param("parent")); // order is important, set it after routing, so it will set the routing
        deleteRequest.timeout(request.paramAsTime("timeout", DeleteRequest.DEFAULT_TIMEOUT));
        deleteRequest.refresh(request.paramAsBoolean("refresh", deleteRequest.refresh()));
View Full Code Here

Examples of org.elasticsearch.action.delete.DeleteRequest.operationThreaded()

            return new Result(indexRequest, Operation.INDEX, updatedSourceAsMap, updateSourceContentType);
        } else if ("delete".equals(operation)) {
            DeleteRequest deleteRequest = Requests.deleteRequest(request.index()).type(request.type()).id(request.id()).routing(routing).parent(parent)
                    .version(updateVersion).versionType(request.versionType())
                    .replicationType(request.replicationType()).consistencyLevel(request.consistencyLevel());
            deleteRequest.operationThreaded(false);
            return new Result(deleteRequest, Operation.DELETE, updatedSourceAsMap, updateSourceContentType);
        } else if ("none".equals(operation)) {
            UpdateResponse update = new UpdateResponse(getResult.getIndex(), getResult.getType(), getResult.getId(), getResult.getVersion(), false);
            update.setGetResult(extractGetResult(request, indexShard.indexService().index().name(), getResult.getVersion(), updatedSourceAsMap, updateSourceContentType, getResult.internalSourceRef()));
            return new Result(update, Operation.NONE, updatedSourceAsMap, updateSourceContentType);
View Full Code Here

Examples of org.elasticsearch.action.get.GetRequest.operationThreaded()

    @Override public void handleRequest(final RestRequest request, final RestChannel channel) {
        final GetRequest getRequest = new GetRequest(request.param("index"), request.param("type"), request.param("id"));
        // no need to have a threaded listener since we just send back a response
        getRequest.listenerThreaded(false);
        // if we have a local operation, execute it on a thread since we don't spawn
        getRequest.operationThreaded(true);
        getRequest.refresh(request.paramAsBoolean("refresh", getRequest.refresh()));
        getRequest.routing(request.param("routing"));
        getRequest.preference(request.param("preference"));
        getRequest.realtime(request.paramAsBoolean("realtime", null));
View Full Code Here

Examples of org.elasticsearch.action.get.GetRequest.operationThreaded()

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        final GetRequest getRequest = new GetRequest(request.param("index"), request.param("type"), request.param("id"));
        getRequest.listenerThreaded(false);
        getRequest.operationThreaded(true);
        getRequest.refresh(request.paramAsBoolean("refresh", getRequest.refresh()));
        getRequest.routing(request.param("routing"))// order is important, set it after routing, so it will set the routing
        getRequest.parent(request.param("parent"));
        getRequest.preference(request.param("preference"));
        getRequest.realtime(request.paramAsBoolean("realtime", null));
View Full Code Here

Examples of org.elasticsearch.action.get.GetRequest.operationThreaded()

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        final GetRequest getRequest = new GetRequest(request.param("index"), request.param("type"), request.param("id"));
        getRequest.listenerThreaded(false);
        getRequest.operationThreaded(true);
        getRequest.refresh(request.paramAsBoolean("refresh", getRequest.refresh()));
        getRequest.routing(request.param("routing"))// order is important, set it after routing, so it will set the routing
        getRequest.parent(request.param("parent"));
        getRequest.preference(request.param("preference"));
        getRequest.realtime(request.paramAsBoolean("realtime", null));
View Full Code Here

Examples of org.elasticsearch.action.get.GetRequest.operationThreaded()

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        final GetRequest getRequest = new GetRequest(request.param("index"), request.param("type"), request.param("id"));
        getRequest.listenerThreaded(false);
        getRequest.operationThreaded(true);
        getRequest.refresh(request.paramAsBoolean("refresh", getRequest.refresh()));
        getRequest.routing(request.param("routing"))// order is important, set it after routing, so it will set the routing
        getRequest.parent(request.param("parent"));
        getRequest.preference(request.param("preference"));
        getRequest.realtime(request.paramAsBoolean("realtime", null));
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequest.operationThreaded()

        // we just send a response, no need to fork
        indexRequest.listenerThreaded(true);

        // we don't spawn, then fork if local
        indexRequest.operationThreaded(true);

        return indexRequest;
    }

    /**
 
View Full Code Here

Examples of org.elasticsearch.action.index.IndexRequest.operationThreaded()

            indexRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
        }
        // we just send a response, no need to fork
        indexRequest.listenerThreaded(false);
        // we don't spawn, then fork if local
        indexRequest.operationThreaded(true);
        client.index(indexRequest, new ActionListener<IndexResponse>() {
            @Override public void onResponse(IndexResponse response) {
                try {
                    XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
                    builder.startObject()
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.