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


Java CoreContainer.isZooKeeperAware方法代码示例

本文整理汇总了Java中org.apache.solr.core.CoreContainer.isZooKeeperAware方法的典型用法代码示例。如果您正苦于以下问题:Java CoreContainer.isZooKeeperAware方法的具体用法?Java CoreContainer.isZooKeeperAware怎么用?Java CoreContainer.isZooKeeperAware使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.solr.core.CoreContainer的用法示例。


在下文中一共展示了CoreContainer.isZooKeeperAware方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAndPrepShardHandler

import org.apache.solr.core.CoreContainer; //导入方法依赖的package包/类
private ShardHandler getAndPrepShardHandler(SolrQueryRequest req, ResponseBuilder rb, ShardHandlerFactory shardHandlerFactory) {
  ShardHandler shardHandler = null;

  boolean isZkAware = false;
  CoreContainer cc = null;
  if (req.getCore() != null) {
    cc = req.getCore().getCoreContainer();
    isZkAware = cc.isZooKeeperAware();
  } 
  
  rb.isDistrib = req.getParams().getBool("distrib", isZkAware);
  if (!rb.isDistrib) {
    // for back compat, a shards param with URLs like localhost:8983/solr will mean that this
    // search is distributed.
    final String shards = req.getParams().get(ShardParams.SHARDS);
    rb.isDistrib = ((shards != null) && (shards.indexOf('/') > 0));
  }
  
  if (rb.isDistrib) {
    shardHandler = shardHandlerFactory.getShardHandler();
    shardHandler.prepDistributed(rb);
    if (!rb.isDistrib) {
      shardHandler = null; // request is not distributed after all and so the shard handler is not needed
    }
  }

  if(isZkAware) {
    ZkController zkController = cc.getZkController();
    NamedList<Object> headers = rb.rsp.getResponseHeader();
    if(headers != null) {
      headers.add("zkConnected", 
          zkController != null 
        ? !zkController.getZkClient().getConnectionManager().isLikelyExpired() 
        : false);
    }
    
  }

  return shardHandler;
}
 
开发者ID:sematext,项目名称:solr-researcher,代码行数:41,代码来源:ReSearcherHandler.java

示例2: handleRequestBody

import org.apache.solr.core.CoreContainer; //导入方法依赖的package包/类
@Override
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp)
    throws InterruptedException, KeeperException, IOException {

  CoreContainer coreContainer = req.getCore().getCoreDescriptor().getCoreContainer();
  if (coreContainer.isZooKeeperAware()) {
    showFromZooKeeper(req, rsp, coreContainer);
  } else {
    showFromFileSystem(req, rsp);
  }
}
 
开发者ID:europeana,项目名称:search,代码行数:12,代码来源:ShowFileRequestHandler.java

示例3: getZkClient

import org.apache.solr.core.CoreContainer; //导入方法依赖的package包/类
public SolrZkClient getZkClient() {
  SolrZkClient client = null;
  if(getCore() != null) {
    CoreContainer container = getCore().getCoreDescriptor().getCoreContainer();
    if(container.isZooKeeperAware()) {
      client = container.getZkController().getZkClient();
    }
  }
  return client;
}
 
开发者ID:lucidworks,项目名称:solr-couchbase-plugin,代码行数:11,代码来源:CouchbaseRequestHandler.java

示例4: handleRequestBody

import org.apache.solr.core.CoreContainer; //导入方法依赖的package包/类
@Override
public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws IOException, KeeperException, InterruptedException 
{
  CoreContainer coreContainer = req.getCore().getCoreDescriptor().getCoreContainer();
  if (coreContainer.isZooKeeperAware()) {
    showFromZooKeeper(req, rsp, coreContainer);
  } else {
    showFromFileSystem(req, rsp);
  }
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:11,代码来源:ShowFileRequestHandler.java


注:本文中的org.apache.solr.core.CoreContainer.isZooKeeperAware方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。