org.elasticsearch.client.IndicesAdminClient.open()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(86)

本文整理了Java中org.elasticsearch.client.IndicesAdminClient.open()方法的一些代码示例,展示了IndicesAdminClient.open()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IndicesAdminClient.open()方法的具体详情如下:
包路径:org.elasticsearch.client.IndicesAdminClient
类名称:IndicesAdminClient
方法名:open

IndicesAdminClient.open介绍

[英]Open an index based on the index name.
[中]根据索引名称打开索引。

代码示例

代码示例来源:origin: org.elasticsearch/elasticsearch

@Override
  public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
    OpenIndexRequest openIndexRequest = new OpenIndexRequest(Strings.splitStringByCommaToArray(request.param("index")));
    openIndexRequest.timeout(request.paramAsTime("timeout", openIndexRequest.timeout()));
    openIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", openIndexRequest.masterNodeTimeout()));
    openIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, openIndexRequest.indicesOptions()));
    String waitForActiveShards = request.param("wait_for_active_shards");
    if (waitForActiveShards != null) {
      openIndexRequest.waitForActiveShards(ActiveShardCount.parseString(waitForActiveShards));
    }
    return channel -> client.admin().indices().open(openIndexRequest, new RestToXContentListener<>(channel));
  }
}

代码示例来源:origin: javanna/elasticshell

@Override
protected ActionFuture<OpenIndexResponse> doExecute(OpenIndexRequest request) {
  return client.admin().indices().open(request);
}

代码示例来源:origin: hopshadoop/hopsworks

/**
 * Boots up a previously closed index
 */
private void bootIndices(Client client) {
 client.admin().indices().open(new OpenIndexRequest(
   Settings.META_INDEX));
}

代码示例来源:origin: harbby/presto-connectors

@Override
  public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
    OpenIndexRequest openIndexRequest = new OpenIndexRequest(Strings.splitStringByCommaToArray(request.param("index")));
    openIndexRequest.timeout(request.paramAsTime("timeout", openIndexRequest.timeout()));
    openIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", openIndexRequest.masterNodeTimeout()));
    openIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, openIndexRequest.indicesOptions()));
    client.admin().indices().open(openIndexRequest, new AcknowledgedRestListener<OpenIndexResponse>(channel));
  }
}

代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch

@Override
  public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
    OpenIndexRequest openIndexRequest = new OpenIndexRequest(Strings.splitStringByCommaToArray(request.param("index")));
    openIndexRequest.timeout(request.paramAsTime("timeout", openIndexRequest.timeout()));
    openIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", openIndexRequest.masterNodeTimeout()));
    openIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, openIndexRequest.indicesOptions()));
    return channel -> client.admin().indices().open(openIndexRequest, new AcknowledgedRestListener<OpenIndexResponse>(channel));
  }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch

@Override
  public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
    OpenIndexRequest openIndexRequest = new OpenIndexRequest(Strings.splitStringByCommaToArray(request.param("index")));
    openIndexRequest.timeout(request.paramAsTime("timeout", openIndexRequest.timeout()));
    openIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", openIndexRequest.masterNodeTimeout()));
    openIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, openIndexRequest.indicesOptions()));
    String waitForActiveShards = request.param("wait_for_active_shards");
    if (waitForActiveShards != null) {
      openIndexRequest.waitForActiveShards(ActiveShardCount.parseString(waitForActiveShards));
    }
    return channel -> client.admin().indices().open(openIndexRequest, new RestToXContentListener<>(channel));
  }
}

代码示例来源:origin: apache/servicemix-bundles

@Override
  public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
    OpenIndexRequest openIndexRequest = new OpenIndexRequest(Strings.splitStringByCommaToArray(request.param("index")));
    openIndexRequest.timeout(request.paramAsTime("timeout", openIndexRequest.timeout()));
    openIndexRequest.masterNodeTimeout(request.paramAsTime("master_timeout", openIndexRequest.masterNodeTimeout()));
    openIndexRequest.indicesOptions(IndicesOptions.fromRequest(request, openIndexRequest.indicesOptions()));
    String waitForActiveShards = request.param("wait_for_active_shards");
    if (waitForActiveShards != null) {
      openIndexRequest.waitForActiveShards(ActiveShardCount.parseString(waitForActiveShards));
    }
    return channel -> client.admin().indices().open(openIndexRequest, new RestToXContentListener<>(channel));
  }
}

相关文章

微信公众号

最新文章

更多

IndicesAdminClient类方法