Package org.elasticsearch.action.admin.indices.segments

Examples of org.elasticsearch.action.admin.indices.segments.IndicesSegmentsRequest


    public static IndicesStatusRequest indicesStatusRequest(String... indices) {
        return new IndicesStatusRequest(indices);
    }

    public static IndicesSegmentsRequest indicesSegmentsRequest(String... indices) {
        return new IndicesSegmentsRequest(indices);
    }
View Full Code Here


* @author kimchy (shay.banon)
*/
public class IndicesSegmentsRequestBuilder extends BaseIndicesRequestBuilder<IndicesSegmentsRequest, IndicesSegmentResponse> {

    public IndicesSegmentsRequestBuilder(IndicesAdminClient indicesClient) {
        super(indicesClient, new IndicesSegmentsRequest());
    }
View Full Code Here

        controller.registerHandler(GET, "/_segments", this);
        controller.registerHandler(GET, "/{index}/_segments", this);
    }

    @Override public void handleRequest(final RestRequest request, final RestChannel channel) {
        IndicesSegmentsRequest indicesSegmentsRequest = new IndicesSegmentsRequest(splitIndices(request.param("index")));
        // we just send back a response, no need to fork a listener
        indicesSegmentsRequest.listenerThreaded(false);
        BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operation_threading"), BroadcastOperationThreading.SINGLE_THREAD);
        if (operationThreading == BroadcastOperationThreading.NO_THREADS) {
            // since we don't spawn, don't allow no_threads, but change it to a single thread
            operationThreading = BroadcastOperationThreading.SINGLE_THREAD;
        }
        indicesSegmentsRequest.operationThreading(operationThreading);
        client.admin().indices().segments(indicesSegmentsRequest, new ActionListener<IndicesSegmentResponse>() {
            @Override public void onResponse(IndicesSegmentResponse response) {
                try {
                    XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
                    builder.startObject();
View Full Code Here

*/
@SuppressWarnings("unused")
public class SegmentsRequestBuilder<JsonInput, JsonOutput> extends AbstractRequestBuilderJsonOutput<IndicesSegmentsRequest, IndicesSegmentResponse, JsonInput, JsonOutput> {

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

    public static SearchScrollRequest searchScrollRequest(String scrollId) {
        return new SearchScrollRequest(scrollId);
    }

    public static IndicesSegmentsRequest indicesSegmentsRequest(String... indices) {
        return new IndicesSegmentsRequest(indices);
    }
View Full Code Here

        controller.registerHandler(GET, "/{index}/_segments", this);
    }

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        IndicesSegmentsRequest indicesSegmentsRequest = new IndicesSegmentsRequest(Strings.splitStringByCommaToArray(request.param("index")));
        indicesSegmentsRequest.listenerThreaded(false);
        indicesSegmentsRequest.indicesOptions(IndicesOptions.fromRequest(request, indicesSegmentsRequest.indicesOptions()));
        client.admin().indices().segments(indicesSegmentsRequest, new RestBuilderListener<IndicesSegmentResponse>(channel) {
            @Override
            public RestResponse buildResponse(IndicesSegmentResponse response, XContentBuilder builder) throws Exception {
                builder.startObject();
                buildBroadcastShardsHeader(builder, response);
View Full Code Here

    @Test
    public void testSegments() {
        String segmentsAction = IndicesSegmentsAction.NAME + "[s]";
        interceptTransportActions(segmentsAction);

        IndicesSegmentsRequest segmentsRequest = new IndicesSegmentsRequest(randomIndicesOrAliases());
        internalCluster().clientNodeClient().admin().indices().segments(segmentsRequest).actionGet();

        clearInterceptedActions();
        assertSameIndices(segmentsRequest, segmentsAction);
    }
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.admin.indices.segments.IndicesSegmentsRequest

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.