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

Examples of org.elasticsearch.action.admin.cluster.node.shutdown.NodesShutdownRequest


    /**
     * Shuts down all nodes in the cluster.
     */
    public static NodesShutdownRequest nodesShutdownRequest() {
        return new NodesShutdownRequest();
    }
View Full Code Here


     * @param nodesIds The nodes ids to get the status for
     * @return The nodes info request
     * @see org.elasticsearch.client.ClusterAdminClient#nodesShutdown(org.elasticsearch.action.admin.cluster.node.shutdown.NodesShutdownRequest)
     */
    public static NodesShutdownRequest nodesShutdownRequest(String... nodesIds) {
        return new NodesShutdownRequest(nodesIds);
    }
View Full Code Here

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

    @Override public void handleRequest(final RestRequest request, final RestChannel channel) {
        String[] nodesIds = RestActions.splitNodes(request.param("nodeId"));
        NodesShutdownRequest nodesShutdownRequest = new NodesShutdownRequest(nodesIds);
        nodesShutdownRequest.listenerThreaded(false);
        nodesShutdownRequest.delay(request.paramAsTime("delay", nodesShutdownRequest.delay()));
        nodesShutdownRequest.exit(request.paramAsBoolean("exit", nodesShutdownRequest.exit()));
        client.admin().cluster().nodesShutdown(nodesShutdownRequest, new ActionListener<NodesShutdownResponse>() {
            @Override public void onResponse(NodesShutdownResponse response) {
                try {
                    XContentBuilder builder = restContentBuilder(request);
                    builder.startObject();
View Full Code Here

* @author kimchy (shay.banon)
*/
public class NodesShutdownRequestBuilder extends BaseClusterRequestBuilder<NodesShutdownRequest, NodesShutdownResponse> {

    public NodesShutdownRequestBuilder(ClusterAdminClient clusterClient) {
        super(clusterClient, new NodesShutdownRequest());
    }
View Full Code Here

*/
@SuppressWarnings("unused")
public class NodesShutdownRequestBuilder<JsonInput, JsonOutput> extends AbstractRequestBuilderJsonOutput<NodesShutdownRequest, NodesShutdownResponse, JsonInput, JsonOutput> {

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

    /**
     * Shuts down all nodes in the cluster.
     */
    public static NodesShutdownRequest nodesShutdownRequest() {
        return new NodesShutdownRequest();
    }
View Full Code Here

     * @param nodesIds The nodes ids to get the status for
     * @return The nodes info request
     * @see org.elasticsearch.client.ClusterAdminClient#nodesShutdown(org.elasticsearch.action.admin.cluster.node.shutdown.NodesShutdownRequest)
     */
    public static NodesShutdownRequest nodesShutdownRequest(String... nodesIds) {
        return new NodesShutdownRequest(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"));
        NodesShutdownRequest nodesShutdownRequest = new NodesShutdownRequest(nodesIds);
        nodesShutdownRequest.listenerThreaded(false);
        nodesShutdownRequest.delay(request.paramAsTime("delay", nodesShutdownRequest.delay()));
        nodesShutdownRequest.exit(request.paramAsBoolean("exit", nodesShutdownRequest.exit()));
        client.admin().cluster().nodesShutdown(nodesShutdownRequest, new RestBuilderListener<NodesShutdownResponse>(channel) {
            @Override
            public RestResponse buildResponse(NodesShutdownResponse response, XContentBuilder builder) throws Exception {
                builder.startObject();
                builder.field("cluster_name", response.getClusterName().value());
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.admin.cluster.node.shutdown.NodesShutdownRequest

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.