本文整理了Java中org.elasticsearch.client.IndicesAdminClient.clearCache()
方法的一些代码示例,展示了IndicesAdminClient.clearCache()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IndicesAdminClient.clearCache()
方法的具体详情如下:
包路径:org.elasticsearch.client.IndicesAdminClient
类名称:IndicesAdminClient
方法名:clearCache
[英]Clear indices cache.
[中]清除索引缓存。
代码示例来源:origin: org.elasticsearch/elasticsearch
@Override
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
ClearIndicesCacheRequest clearIndicesCacheRequest = new ClearIndicesCacheRequest(
Strings.splitStringByCommaToArray(request.param("index")));
clearIndicesCacheRequest.indicesOptions(IndicesOptions.fromRequest(request, clearIndicesCacheRequest.indicesOptions()));
fromRequest(request, clearIndicesCacheRequest);
return channel -> client.admin().indices().clearCache(clearIndicesCacheRequest, new RestToXContentListener<>(channel));
}
代码示例来源:origin: javanna/elasticshell
@Override
protected ActionFuture<ClearIndicesCacheResponse> doExecute(ClearIndicesCacheRequest request) {
return client.admin().indices().clearCache(request);
}
代码示例来源:origin: hopshadoop/hopsworks
/**
* Shuts down the client and clears the cache
* <p/>
* @param client
*/
private void clientShutdown(Client client) {
client.admin().indices().clearCache(new ClearIndicesCacheRequest(
Settings.META_INDEX));
client.close();
}
代码示例来源:origin: harbby/presto-connectors
@Override
public void handleRequest(final RestRequest request, final RestChannel channel, final Client client) {
ClearIndicesCacheRequest clearIndicesCacheRequest = new ClearIndicesCacheRequest(Strings.splitStringByCommaToArray(request.param("index")));
clearIndicesCacheRequest.indicesOptions(IndicesOptions.fromRequest(request, clearIndicesCacheRequest.indicesOptions()));
fromRequest(request, clearIndicesCacheRequest, parseFieldMatcher);
client.admin().indices().clearCache(clearIndicesCacheRequest, new RestBuilderListener<ClearIndicesCacheResponse>(channel) {
@Override
public RestResponse buildResponse(ClearIndicesCacheResponse response, XContentBuilder builder) throws Exception {
builder.startObject();
buildBroadcastShardsHeader(builder, request, response);
builder.endObject();
return new BytesRestResponse(OK, builder);
}
});
}
代码示例来源:origin: apache/servicemix-bundles
@Override
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
ClearIndicesCacheRequest clearIndicesCacheRequest = new ClearIndicesCacheRequest(
Strings.splitStringByCommaToArray(request.param("index")));
clearIndicesCacheRequest.indicesOptions(IndicesOptions.fromRequest(request, clearIndicesCacheRequest.indicesOptions()));
fromRequest(request, clearIndicesCacheRequest);
return channel -> client.admin().indices().clearCache(clearIndicesCacheRequest, new RestToXContentListener<>(channel));
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.elasticsearch
@Override
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
ClearIndicesCacheRequest clearIndicesCacheRequest = new ClearIndicesCacheRequest(
Strings.splitStringByCommaToArray(request.param("index")));
clearIndicesCacheRequest.indicesOptions(IndicesOptions.fromRequest(request, clearIndicesCacheRequest.indicesOptions()));
fromRequest(request, clearIndicesCacheRequest);
return channel -> client.admin().indices().clearCache(clearIndicesCacheRequest, new RestToXContentListener<>(channel));
}
代码示例来源:origin: com.strapdata.elasticsearch/elasticsearch
@Override
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
ClearIndicesCacheRequest clearIndicesCacheRequest = new ClearIndicesCacheRequest(
Strings.splitStringByCommaToArray(request.param("index")));
clearIndicesCacheRequest.indicesOptions(IndicesOptions.fromRequest(request, clearIndicesCacheRequest.indicesOptions()));
fromRequest(request, clearIndicesCacheRequest);
return channel ->
client.admin().indices().clearCache(clearIndicesCacheRequest, new RestBuilderListener<ClearIndicesCacheResponse>(channel) {
@Override
public RestResponse buildResponse(ClearIndicesCacheResponse response, XContentBuilder builder) throws Exception {
builder.startObject();
buildBroadcastShardsHeader(builder, request, response);
builder.endObject();
return new BytesRestResponse(OK, builder);
}
});
}
代码示例来源:origin: bleskes/elasticfacets
.actionGet();
client.admin().indices().clearCache(new ClearIndicesCacheRequest()).actionGet();
内容来源于网络,如有侵权,请联系作者删除!