Package org.elasticsearch.action.admin.cluster.settings

Examples of org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest


*/
@SuppressWarnings("unused")
public class UpdateClusterSettingsRequestBuilder<JsonInput, JsonOutput> extends AbstractRequestBuilderJsonOutput<ClusterUpdateSettingsRequest, ClusterUpdateSettingsResponse, JsonInput, JsonOutput> {

    public UpdateClusterSettingsRequestBuilder(Client client, JsonToString<JsonInput> jsonToString, StringToJson<JsonOutput> stringToJson) {
        super(client, new ClusterUpdateSettingsRequest(), jsonToString, stringToJson);
    }
View Full Code Here


        this.transport = transport;

        final SettableFuture<TaskResult> result = SettableFuture.create();
        results = Arrays.<ListenableFuture<TaskResult>>asList(result);

        request = new ClusterUpdateSettingsRequest();
        request.persistentSettings(node.persistentSettings());
        request.transientSettings(node.transientSettings());
        if (node.persistentSettingsToRemove() != null) {
            request.persistentSettingsToRemove(node.persistentSettingsToRemove());
        }
View Full Code Here

    public static ClusterRerouteRequest clusterRerouteRequest() {
        return new ClusterRerouteRequest();
    }

    public static ClusterUpdateSettingsRequest clusterUpdateSettingsRequest() {
        return new ClusterUpdateSettingsRequest();
    }
View Full Code Here

        controller.registerHandler(RestRequest.Method.PUT, "/_cluster/settings", this);
    }

    @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"));
        }
        if (source.containsKey("persistent")) {
            clusterUpdateSettingsRequest.persistentSettings((Map) source.get("persistent"));
        }

        client.admin().cluster().updateSettings(clusterUpdateSettingsRequest, new AcknowledgedRestListener<ClusterUpdateSettingsResponse>(channel) {
            @Override
            protected void addCustomFields(XContentBuilder builder, ClusterUpdateSettingsResponse response) throws IOException {
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest

Copyright © 2018 www.massapicom. 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.