Examples of FlushRequest


Examples of org.elasticsearch.action.admin.indices.flush.FlushRequest

        c.admin().indices().updateSettings(new UpdateSettingsRequest(index).settings(sb.build())).actionGet();
    }

    public void flush(String index) {
        FlushRequest flush = new FlushRequest(index);
        flush.force(true); // Just flushes. Even if it is not necessary.
        flush.full(false);

        c.admin().indices().flush(new FlushRequest(index).force(true)).actionGet();
    }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.flush.FlushRequest

     * @param indices The indices to flush. Use <tt>null</tt> or <tt>_all</tt> to execute against all indices
     * @return The flush request
     * @see org.elasticsearch.client.IndicesAdminClient#flush(org.elasticsearch.action.admin.indices.flush.FlushRequest)
     */
    public static FlushRequest flushRequest(String... indices) {
        return new FlushRequest(indices);
    }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.flush.FlushRequest

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

    @Override public void handleRequest(final RestRequest request, final RestChannel channel) {
        FlushRequest flushRequest = new FlushRequest(RestActions.splitIndices(request.param("index")));
        // we just send back a response, no need to fork a listener
        flushRequest.listenerThreaded(false);
        BroadcastOperationThreading operationThreading = BroadcastOperationThreading.fromString(request.param("operationThreading"), 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.THREAD_PER_SHARD;
        }
        flushRequest.operationThreading(operationThreading);
        flushRequest.refresh(request.paramAsBoolean("refresh", flushRequest.refresh()));
        flushRequest.full(request.paramAsBoolean("full", flushRequest.full()));
        client.admin().indices().flush(flushRequest, new ActionListener<FlushResponse>() {
            @Override public void onResponse(FlushResponse response) {
                try {
                    XContentBuilder builder = RestXContentBuilder.restContentBuilder(request);
                    builder.startObject();
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.flush.FlushRequest

* @author kimchy (shay.banon)
*/
public class FlushRequestBuilder extends BaseIndicesRequestBuilder<FlushRequest, FlushResponse> {

    public FlushRequestBuilder(IndicesAdminClient indicesClient) {
        super(indicesClient, new FlushRequest());
    }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.flush.FlushRequest

*/
@SuppressWarnings("unused")
public class FlushRequestBuilder<JsonInput, JsonOutput> extends AbstractRequestBuilderJsonOutput<FlushRequest, FlushResponse, JsonInput, JsonOutput> {

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

Examples of org.elasticsearch.action.admin.indices.flush.FlushRequest

                break;
            queryWatch.stop();
            StopWatch updateWatch = new StopWatch().start();
            failed += bulkUpdate(res, newIndex, newType, withVersion).size();
            if (flushEnabled)
                client.admin().indices().flush(new FlushRequest(newIndex)).actionGet();

            updateWatch.stop();
            collectedResults += currentResults;
            logger.debug("Progress " + collectedResults + "/" + total
                    + ". Time of update:" + updateWatch.totalTime().getSeconds() + " query:"
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.flush.FlushRequest

        return Collections.emptyList();
    }

    public void flush(String... indices) {
        client.admin().indices().flush(new FlushRequest(indices)).actionGet();
    }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.flush.FlushRequest

    /**
     * Flush an index
     * @param indexName
     */
    public static void flush(String indexName) {
        IndexClient.client.admin().indices().flush(new FlushRequest(indexName)).actionGet();
    }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.flush.FlushRequest

     * @param indices The indices to flush. Use <tt>null</tt> or <tt>_all</tt> to execute against all indices
     * @return The flush request
     * @see org.elasticsearch.client.IndicesAdminClient#flush(org.elasticsearch.action.admin.indices.flush.FlushRequest)
     */
    public static FlushRequest flushRequest(String... indices) {
        return new FlushRequest(indices);
    }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.flush.FlushRequest

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

    @Override
    public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
        FlushRequest flushRequest = new FlushRequest(Strings.splitStringByCommaToArray(request.param("index")));
        flushRequest.listenerThreaded(false);
        flushRequest.indicesOptions(IndicesOptions.fromRequest(request, flushRequest.indicesOptions()));
        flushRequest.full(request.paramAsBoolean("full", flushRequest.full()));
        flushRequest.force(request.paramAsBoolean("force", flushRequest.force()));
        flushRequest.waitIfOngoing(request.paramAsBoolean("wait_if_ongoing", flushRequest.waitIfOngoing()));
        client.admin().indices().flush(flushRequest, new RestBuilderListener<FlushResponse>(channel) {
            @Override
            public RestResponse buildResponse(FlushResponse response, XContentBuilder builder) throws Exception {
                builder.startObject();
                buildBroadcastShardsHeader(builder, response);
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.