Search in sources :

Example 1 with ForceMerge

use of io.searchbox.indices.ForceMerge in project graylog2-server by Graylog2.

the class IndicesAdapterES6 method optimizeIndex.

@Override
public void optimizeIndex(String index, int maxNumSegments, Duration timeout) {
    final RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(Ints.saturatedCast(timeout.toMilliseconds())).build();
    final ForceMerge request = new ForceMerge.Builder().addIndex(index).maxNumSegments(maxNumSegments).flush(true).onlyExpungeDeletes(false).build();
    JestUtils.execute(jestClient, requestConfig, request, () -> "Couldn't force merge index " + index);
}
Also used : RequestConfig(org.apache.http.client.config.RequestConfig) ForceMerge(io.searchbox.indices.ForceMerge)

Aggregations

ForceMerge (io.searchbox.indices.ForceMerge)1 RequestConfig (org.apache.http.client.config.RequestConfig)1