當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。