Examples of timeOut()


Examples of org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest.timeout()

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) throws Exception {
        final ClusterUpdateSettingsRequest clusterUpdateSettingsRequest = Requests.clusterUpdateSettingsRequest();
        clusterUpdateSettingsRequest.listenerThreaded(false);
        clusterUpdateSettingsRequest.timeout(request.paramAsTime("timeout", clusterUpdateSettingsRequest.timeout()));
        clusterUpdateSettingsRequest.masterNodeTimeout(request.paramAsTime("master_timeout", clusterUpdateSettingsRequest.masterNodeTimeout()));
        Map<String, Object> source = XContentFactory.xContent(request.content()).createParser(request.content()).mapAndClose();
        if (source.containsKey("transient")) {
            clusterUpdateSettingsRequest.transientSettings((Map) source.get("transient"));
        }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest.timeout()

            //     actions : [
            //         { add : { index : "test1", alias : "alias1", filter : {"user" : "kimchy"} } }
            //         { remove : { index : "test1", alias : "alias1" } }
            //     ]
            // }
            indicesAliasesRequest.timeout(request.paramAsTime("timeout", timeValueSeconds(10)));
            XContentParser parser = XContentFactory.xContent(request.contentByteArray(), request.contentByteArrayOffset(), request.contentLength())
                    .createParser(request.contentByteArray(), request.contentByteArrayOffset(), request.contentLength());
            XContentParser.Token token = parser.nextToken();
            if (token == null) {
                throw new ElasticSearchIllegalArgumentException("No action is specified");
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.close.CloseIndexRequest.timeout()

        controller.registerHandler(RestRequest.Method.POST, "/{index}/_close", this);
    }

    @Override public void handleRequest(final RestRequest request, final RestChannel channel) {
        CloseIndexRequest closeIndexRequest = new CloseIndexRequest(request.param("index"));
        closeIndexRequest.timeout(request.paramAsTime("timeout", timeValueSeconds(10)));
        client.admin().indices().close(closeIndexRequest, new ActionListener<CloseIndexResponse>() {
            @Override public void onResponse(CloseIndexResponse response) {
                try {
                    XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
                    builder.startObject()
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.create.CreateIndexRequest.timeout()

                    }
                }
            }
        }

        createIndexRequest.timeout(request.paramAsTime("timeout", timeValueSeconds(10)));

        client.admin().indices().create(createIndexRequest, new ActionListener<CreateIndexResponse>() {
            @Override public void onResponse(CreateIndexResponse response) {
                try {
                    XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest.timeout()

        controller.registerHandler(RestRequest.Method.DELETE, "/{index}", this);
    }

    @Override public void handleRequest(final RestRequest request, final RestChannel channel) {
        DeleteIndexRequest deleteIndexRequest = new DeleteIndexRequest(splitIndices(request.param("index")));
        deleteIndexRequest.timeout(request.paramAsTime("timeout", timeValueSeconds(10)));
        client.admin().indices().delete(deleteIndexRequest, new ActionListener<DeleteIndexResponse>() {
            @Override public void onResponse(DeleteIndexResponse response) {
                try {
                    XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
                    builder.startObject()
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.mapping.delete.DeleteMappingRequest.timeout()

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        DeleteMappingRequest deleteMappingRequest = deleteMappingRequest(Strings.splitStringByCommaToArray(request.param("index")));
        deleteMappingRequest.listenerThreaded(false);
        deleteMappingRequest.types(Strings.splitStringByCommaToArray(request.param("type")));
        deleteMappingRequest.timeout(request.paramAsTime("timeout", deleteMappingRequest.timeout()));
        deleteMappingRequest.masterNodeTimeout(request.paramAsTime("master_timeout", deleteMappingRequest.masterNodeTimeout()));
        deleteMappingRequest.indicesOptions(IndicesOptions.fromRequest(request, deleteMappingRequest.indicesOptions()));
        client.admin().indices().deleteMapping(deleteMappingRequest, new AcknowledgedRestListener<DeleteMappingResponse>(channel));
    }
}
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest.timeout()

    @Override public void handleRequest(final RestRequest request, final RestChannel channel) {
        PutMappingRequest putMappingRequest = putMappingRequest(splitIndices(request.param("index")));
        putMappingRequest.type(request.param("type"));
        putMappingRequest.source(request.contentAsString());
        putMappingRequest.timeout(request.paramAsTime("timeout", timeValueSeconds(10)));
        putMappingRequest.ignoreConflicts(request.paramAsBoolean("ignore_conflicts", putMappingRequest.ignoreConflicts()));
        client.admin().indices().putMapping(putMappingRequest, new ActionListener<PutMappingResponse>() {
            @Override public void onResponse(PutMappingResponse response) {
                try {
                    XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.open.OpenIndexRequest.timeout()

        controller.registerHandler(RestRequest.Method.POST, "/{index}/_open", this);
    }

    @Override public void handleRequest(final RestRequest request, final RestChannel channel) {
        OpenIndexRequest openIndexRequest = new OpenIndexRequest(request.param("index"));
        openIndexRequest.timeout(request.paramAsTime("timeout", timeValueSeconds(10)));
        client.admin().indices().open(openIndexRequest, new ActionListener<OpenIndexResponse>() {
            @Override public void onResponse(OpenIndexResponse response) {
                try {
                    XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
                    builder.startObject()
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest.timeout()

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        UpdateSettingsRequest updateSettingsRequest = updateSettingsRequest(Strings.splitStringByCommaToArray(request.param("index")));
        updateSettingsRequest.listenerThreaded(false);
        updateSettingsRequest.timeout(request.paramAsTime("timeout", updateSettingsRequest.timeout()));
        updateSettingsRequest.masterNodeTimeout(request.paramAsTime("master_timeout", updateSettingsRequest.masterNodeTimeout()));
        updateSettingsRequest.indicesOptions(IndicesOptions.fromRequest(request, updateSettingsRequest.indicesOptions()));

        ImmutableSettings.Builder updateSettings = ImmutableSettings.settingsBuilder();
        String bodySettingsStr = request.content().toUtf8();
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateRequest.timeout()

        controller.registerHandler(RestRequest.Method.DELETE, "/_template/{name}", this);
    }

    @Override public void handleRequest(final RestRequest request, final RestChannel channel) {
        DeleteIndexTemplateRequest deleteIndexTemplateRequest = new DeleteIndexTemplateRequest(request.param("name"));
        deleteIndexTemplateRequest.timeout(request.paramAsTime("timeout", timeValueSeconds(10)));
        client.admin().indices().deleteTemplate(deleteIndexTemplateRequest, new ActionListener<DeleteIndexTemplateResponse>() {
            @Override public void onResponse(DeleteIndexTemplateResponse 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.