Package org.elasticsearch.action.admin.cluster.node.restart

Examples of org.elasticsearch.action.admin.cluster.node.restart.NodesRestartRequest


    /**
     * Restarts all nodes in the cluster.
     */
    public static NodesRestartRequest nodesRestartRequest() {
        return new NodesRestartRequest();
    }
View Full Code Here


     * @param nodesIds The nodes ids to restart
     * @return The nodes info request
     * @see org.elasticsearch.client.ClusterAdminClient#nodesRestart(org.elasticsearch.action.admin.cluster.node.restart.NodesRestartRequest)
     */
    public static NodesRestartRequest nodesRestartRequest(String... nodesIds) {
        return new NodesRestartRequest(nodesIds);
    }
View Full Code Here

        controller.registerHandler(RestRequest.Method.POST, "/_cluster/nodes/{nodeId}/_restart", this);
    }

    @Override public void handleRequest(final RestRequest request, final RestChannel channel) {
        String[] nodesIds = RestActions.splitNodes(request.param("nodeId"));
        NodesRestartRequest nodesRestartRequest = new NodesRestartRequest(nodesIds);
        nodesRestartRequest.listenerThreaded(false);
        nodesRestartRequest.delay(request.paramAsTime("delay", nodesRestartRequest.delay()));
        client.admin().cluster().nodesRestart(nodesRestartRequest, new ActionListener<NodesRestartResponse>() {
            @Override public void onResponse(NodesRestartResponse result) {
                try {
                    XContentBuilder builder = restContentBuilder(request);
                    builder.startObject();
View Full Code Here

* @author kimchy (shay.banon)
*/
public class NodesRestartRequestBuilder extends BaseClusterRequestBuilder<NodesRestartRequest, NodesRestartResponse> {

    public NodesRestartRequestBuilder(ClusterAdminClient clusterClient) {
        super(clusterClient, new NodesRestartRequest());
    }
View Full Code Here

*/
@SuppressWarnings("unused")
public class NodesRestartRequestBuilder<JsonInput, JsonOutput> extends AbstractRequestBuilderJsonOutput<NodesRestartRequest, NodesRestartResponse, JsonInput, JsonOutput> {

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

    /**
     * Restarts all nodes in the cluster.
     */
    public static NodesRestartRequest nodesRestartRequest() {
        return new NodesRestartRequest();
    }
View Full Code Here

     * @param nodesIds The nodes ids to restart
     * @return The nodes info request
     * @see org.elasticsearch.client.ClusterAdminClient#nodesRestart(org.elasticsearch.action.admin.cluster.node.restart.NodesRestartRequest)
     */
    public static NodesRestartRequest nodesRestartRequest(String... nodesIds) {
        return new NodesRestartRequest(nodesIds);
    }
View Full Code Here

    }

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        String[] nodesIds = Strings.splitStringByCommaToArray(request.param("nodeId"));
        NodesRestartRequest nodesRestartRequest = new NodesRestartRequest(nodesIds);
        nodesRestartRequest.listenerThreaded(false);
        nodesRestartRequest.delay(request.paramAsTime("delay", nodesRestartRequest.delay()));
        client.admin().cluster().nodesRestart(nodesRestartRequest, new RestBuilderListener<NodesRestartResponse>(channel) {
            @Override
            public RestResponse buildResponse(NodesRestartResponse result, XContentBuilder builder) throws Exception {
                builder.startObject();
                builder.field("cluster_name", result.getClusterName().value());
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.admin.cluster.node.restart.NodesRestartRequest

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.