Examples of consistencyLevel()


Examples of org.elasticsearch.action.bulk.BulkRequest.consistencyLevel()

        if (replicationType != null) {
            bulkRequest.replicationType(ReplicationType.fromString(replicationType));
        }
        String consistencyLevel = request.param("consistency");
        if (consistencyLevel != null) {
            bulkRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
        }
        bulkRequest.refresh(request.paramAsBoolean("refresh", bulkRequest.refresh()));
        try {
            bulkRequest.add(request.contentByteArray(), request.contentByteArrayOffset(), request.contentLength(), request.contentUnsafe());
        } catch (Exception e) {
View Full Code Here

Examples of org.elasticsearch.action.bulk.BulkRequest.consistencyLevel()

        if (replicationType != null) {
            bulkRequest.replicationType(ReplicationType.fromString(replicationType));
        }
        String consistencyLevel = request.param("consistency");
        if (consistencyLevel != null) {
            bulkRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
        }
        bulkRequest.timeout(request.paramAsTime("timeout", BulkShardRequest.DEFAULT_TIMEOUT));
        bulkRequest.refresh(request.paramAsBoolean("refresh", bulkRequest.refresh()));
        bulkRequest.add(request.content(), request.contentUnsafe(), defaultIndex, defaultType, defaultRouting, null, allowExplicitIndex);
View Full Code Here

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

        if (replicationType != null) {
            deleteRequest.replicationType(ReplicationType.fromString(replicationType));
        }
        String consistencyLevel = request.param("consistency");
        if (consistencyLevel != null) {
            deleteRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
        }

        client.delete(deleteRequest, new ActionListener<DeleteResponse>() {
            @Override public void onResponse(DeleteResponse result) {
                try {
View Full Code Here

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

        if (replicationType != null) {
            deleteRequest.replicationType(ReplicationType.fromString(replicationType));
        }
        String consistencyLevel = request.param("consistency");
        if (consistencyLevel != null) {
            deleteRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
        }

        client.delete(deleteRequest, new RestBuilderListener<DeleteResponse>(channel) {
            @Override
            public RestResponse buildResponse(DeleteResponse result, XContentBuilder builder) throws Exception {
View Full Code Here

Examples of org.elasticsearch.action.deletebyquery.DeleteByQueryRequest.consistencyLevel()

            if (replicationType != null) {
                deleteByQueryRequest.replicationType(ReplicationType.fromString(replicationType));
            }
            String consistencyLevel = request.param("consistency");
            if (consistencyLevel != null) {
                deleteByQueryRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
            }
        } catch (Exception e) {
            try {
                XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
                channel.sendResponse(new XContentRestResponse(request, PRECONDITION_FAILED, builder.startObject().field("error", e.getMessage()).endObject()));
View Full Code Here

Examples of org.elasticsearch.action.deletebyquery.DeleteByQueryRequest.consistencyLevel()

        if (replicationType != null) {
            deleteByQueryRequest.replicationType(ReplicationType.fromString(replicationType));
        }
        String consistencyLevel = request.param("consistency");
        if (consistencyLevel != null) {
            deleteByQueryRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
        }
        deleteByQueryRequest.indicesOptions(IndicesOptions.fromRequest(request, deleteByQueryRequest.indicesOptions()));
        client.deleteByQuery(deleteByQueryRequest, new RestBuilderListener<DeleteByQueryResponse>(channel) {
            @Override
            public RestResponse buildResponse(DeleteByQueryResponse result, XContentBuilder builder) throws Exception {
View Full Code Here

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

            indexRequest.replicationType(ReplicationType.fromString(replicationType));
        }

        String consistencyLevel = request.param("consistency");
        if (consistencyLevel != null) {
            indexRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
        }

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

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

        if (replicationType != null) {
            indexRequest.replicationType(ReplicationType.fromString(replicationType));
        }
        String consistencyLevel = request.param("consistency");
        if (consistencyLevel != null) {
            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);
View Full Code Here

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

      indexRequest.replicationType(ReplicationType.fromString(replicationType));
    }

    String consistencyLevel = request.param("consistency");
    if (consistencyLevel != null) {
      indexRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
    }

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

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

        if (replicationType != null) {
            indexRequest.replicationType(ReplicationType.fromString(replicationType));
        }
        String consistencyLevel = request.param("consistency");
        if (consistencyLevel != null) {
            indexRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
        }
        client.index(indexRequest, new RestBuilderListener<IndexResponse>(channel) {
            @Override
            public RestResponse buildResponse(IndexResponse response, XContentBuilder builder) throws Exception {
                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.