Search in sources :

Example 1 with SwapAndDropIndexRequest

use of io.crate.execution.ddl.index.SwapAndDropIndexRequest in project crate by crate.

the class AlterTableOperation method swapAndDropIndex.

private CompletableFuture<Long> swapAndDropIndex(String source, String target) {
    SwapAndDropIndexRequest request = new SwapAndDropIndexRequest(source, target);
    FutureActionListener<AcknowledgedResponse, Long> listener = new FutureActionListener<>(response -> {
        if (!response.isAcknowledged()) {
            throw new RuntimeException("Publishing new cluster state during Shrink operation (rename phase) " + "has timed out");
        }
        return 0L;
    });
    transportSwapAndDropIndexNameAction.execute(request, listener);
    return listener;
}
Also used : SwapAndDropIndexRequest(io.crate.execution.ddl.index.SwapAndDropIndexRequest) AcknowledgedResponse(org.elasticsearch.action.support.master.AcknowledgedResponse) FutureActionListener(io.crate.action.FutureActionListener)

Aggregations

FutureActionListener (io.crate.action.FutureActionListener)1 SwapAndDropIndexRequest (io.crate.execution.ddl.index.SwapAndDropIndexRequest)1 AcknowledgedResponse (org.elasticsearch.action.support.master.AcknowledgedResponse)1