当前位置: 首页>>代码示例>>Java>>正文


Java ForceMergeRequest类代码示例

本文整理汇总了Java中org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest的典型用法代码示例。如果您正苦于以下问题:Java ForceMergeRequest类的具体用法?Java ForceMergeRequest怎么用?Java ForceMergeRequest使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

ForceMergeRequest类属于org.elasticsearch.action.admin.indices.forcemerge包,在下文中一共展示了ForceMergeRequest类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: prepareRequest

import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest; //导入依赖的package包/类
@Override
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
    ForceMergeRequest mergeRequest = new ForceMergeRequest(Strings.splitStringByCommaToArray(request.param("index")));
    mergeRequest.indicesOptions(IndicesOptions.fromRequest(request, mergeRequest.indicesOptions()));
    mergeRequest.maxNumSegments(request.paramAsInt("max_num_segments", mergeRequest.maxNumSegments()));
    mergeRequest.onlyExpungeDeletes(request.paramAsBoolean("only_expunge_deletes", mergeRequest.onlyExpungeDeletes()));
    mergeRequest.flush(request.paramAsBoolean("flush", mergeRequest.flush()));
    return channel -> client.admin().indices().forceMerge(mergeRequest, new RestBuilderListener<ForceMergeResponse>(channel) {
        @Override
        public RestResponse buildResponse(ForceMergeResponse response, XContentBuilder builder) throws Exception {
            builder.startObject();
            buildBroadcastShardsHeader(builder, request, response);
            builder.endObject();
            return new BytesRestResponse(OK, builder);
        }
    });
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:18,代码来源:RestForceMergeAction.java


示例2: handleRequest

import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest; //导入依赖的package包/类
@Override
public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
    ForceMergeRequest mergeRequest = new ForceMergeRequest(Strings.splitStringByCommaToArray(request.param("index")));
    mergeRequest.indicesOptions(IndicesOptions.fromRequest(request, mergeRequest.indicesOptions()));
    mergeRequest.maxNumSegments(request.paramAsInt("max_num_segments", mergeRequest.maxNumSegments()));
    mergeRequest.onlyExpungeDeletes(request.paramAsBoolean("only_expunge_deletes", mergeRequest.onlyExpungeDeletes()));
    mergeRequest.flush(request.paramAsBoolean("flush", mergeRequest.flush()));
    client.admin().indices().forceMerge(mergeRequest, new RestBuilderListener<ForceMergeResponse>(channel) {
        @Override
        public RestResponse buildResponse(ForceMergeResponse response, XContentBuilder builder) throws Exception {
            builder.startObject();
            buildBroadcastShardsHeader(builder, request, response);
            builder.endObject();
            return new BytesRestResponse(OK, builder);
        }
    });
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:18,代码来源:RestForceMergeAction.java


示例3: testForceMerge

import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest; //导入依赖的package包/类
public void testForceMerge() {
    String mergeShardAction = ForceMergeAction.NAME + "[n]";
    interceptTransportActions(mergeShardAction);

    ForceMergeRequest mergeRequest = new ForceMergeRequest(randomIndicesOrAliases());
    internalCluster().coordOnlyNodeClient().admin().indices().forceMerge(mergeRequest).actionGet();

    clearInterceptedActions();
    assertSameIndices(mergeRequest, mergeShardAction);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:IndicesRequestIT.java


示例4: forceMerge

import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest; //导入依赖的package包/类
@Override
public ActionFuture<ForceMergeResponse> forceMerge(final ForceMergeRequest request) {
    return execute(ForceMergeAction.INSTANCE, request);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:AbstractClient.java


示例5: forceMerge

import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest; //导入依赖的package包/类
/**
 * Explicitly force merge one or more indices into a the number of segments.
 *
 * @param request The optimize request
 * @return A result future
 * @see org.elasticsearch.client.Requests#forceMergeRequest(String...)
 */
ActionFuture<ForceMergeResponse> forceMerge(ForceMergeRequest request);
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:IndicesAdminClient.java


示例6: forceMergeRequest

import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest; //导入依赖的package包/类
/**
 * Creates a force merge request.
 *
 * @param indices The indices to force merge. Use <tt>null</tt> or <tt>_all</tt> to execute against all indices
 * @return The force merge request
 * @see org.elasticsearch.client.IndicesAdminClient#forceMerge(org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest)
 */
public static ForceMergeRequest forceMergeRequest(String... indices) {
    return new ForceMergeRequest(indices);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:Requests.java



注:本文中的org.elasticsearch.action.admin.indices.forcemerge.ForceMergeRequest类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。