org.elasticsearch.indices.IndicesService.loadIntoContext()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(164)

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

IndicesService.loadIntoContext介绍

[英]Loads the cache result, computing it if needed by executing the query phase and otherwise deserializing the cached value into the SearchContext#queryResult(). The combination of load + compute allows to have a single load operation that will cause other requests with the same key to wait till its loaded an reuse the same cache.
[中]加载缓存结果,如果需要,通过执行查询阶段并将缓存值反序列化到SearchContext#queryResult()中来计算缓存结果。load+compute的组合允许有一个加载操作,该操作将导致具有相同密钥的其他请求等待,直到其加载并重用相同的缓存。

代码示例

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

/**
 * Try to load the query results from the cache or execute the query phase directly if the cache cannot be used.
 */
private void loadOrExecuteQueryPhase(final ShardSearchRequest request, final SearchContext context) throws Exception {
  final boolean canCache = indicesService.canCache(request, context);
  context.getQueryShardContext().freezeContext();
  if (canCache) {
    indicesService.loadIntoContext(request, context, queryPhase);
  } else {
    queryPhase.execute(context);
  }
}

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

/**
 * Try to load the query results from the cache or execute the query phase directly if the cache cannot be used.
 */
private void loadOrExecuteQueryPhase(final ShardSearchRequest request, final SearchContext context) throws Exception {
  final boolean canCache = indicesService.canCache(request, context);
  context.getQueryShardContext().freezeContext();
  if (canCache) {
    indicesService.loadIntoContext(request, context, queryPhase);
  } else {
    queryPhase.execute(context);
  }
}

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

/**
 * Try to load the query results from the cache or execute the query phase directly if the cache cannot be used.
 */
private void loadOrExecuteQueryPhase(final ShardSearchRequest request, final SearchContext context) throws Exception {
  final boolean canCache = indicesService.canCache(request, context);
  context.getQueryShardContext().freezeContext();
  if (canCache) {
    indicesService.loadIntoContext(request, context, queryPhase);
  } else {
    queryPhase.execute(context);
  }
}

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

/**
 * Try to load the query results from the cache or execute the query phase directly if the cache cannot be used.
 */
private void loadOrExecuteQueryPhase(final ShardSearchRequest request, final SearchContext context) throws Exception {
  final boolean canCache = indicesService.canCache(request, context);
  context.getQueryShardContext().freezeContext();
  if (canCache) {
    indicesService.loadIntoContext(request, context, queryPhase);
  } else {
    queryPhase.execute(context);
  }
}

相关文章

微信公众号

最新文章

更多