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


Java SolrCore.isReloaded方法代码示例

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


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

示例1: checkRecovery

import org.apache.solr.core.SolrCore; //导入方法依赖的package包/类
/**
 * Returns whether or not a recovery was started
 */
private boolean checkRecovery(String coreName, final CoreDescriptor desc,
    boolean recoverReloadedCores, final boolean isLeader,
    final CloudDescriptor cloudDesc, final String collection,
    final String shardZkNodeName, String shardId, ZkNodeProps leaderProps,
    SolrCore core, CoreContainer cc) {
  if (SKIP_AUTO_RECOVERY) {
    log.warn("Skipping recovery according to sys prop solrcloud.skip.autorecovery");
    return false;
  }
  boolean doRecovery = true;
  if (!isLeader) {
    
    if (core.isReloaded() && !recoverReloadedCores) {
      doRecovery = false;
    }
    
    if (doRecovery) {
      log.info("Core needs to recover:" + core.getName());
      core.getUpdateHandler().getSolrCoreState().doRecovery(cc, core.getCoreDescriptor());
      return true;
    }
    
    // see if the leader told us to recover
    String lirState = getLeaderInitiatedRecoveryState(collection, shardId,
        core.getCoreDescriptor().getCloudDescriptor().getCoreNodeName());
    if (ZkStateReader.DOWN.equals(lirState)) {
      log.info("Leader marked core "+core.getName()+" down; starting recovery process");
      core.getUpdateHandler().getSolrCoreState().doRecovery(cc, core.getCoreDescriptor());
      return true;        
    }
  } else {
    log.info("I am the leader, no recovery necessary");
  }
  
  return false;
}
 
开发者ID:europeana,项目名称:search,代码行数:40,代码来源:ZkController.java

示例2: UpdateHandler

import org.apache.solr.core.SolrCore; //导入方法依赖的package包/类
public UpdateHandler(SolrCore core, UpdateLog updateLog)  {
  this.core=core;
  idField = core.getLatestSchema().getUniqueKeyField();
  idFieldType = idField!=null ? idField.getType() : null;
  parseEventListeners();
  PluginInfo ulogPluginInfo = core.getSolrConfig().getPluginInfo(UpdateLog.class.getName());
  

  if (updateLog == null && ulogPluginInfo != null && ulogPluginInfo.isEnabled()) {
    String dataDir = (String)ulogPluginInfo.initArgs.get("dir");
    
    String ulogDir = core.getCoreDescriptor().getUlogDir();
    if (ulogDir != null) {
      dataDir = ulogDir;
    }
    if (dataDir == null || dataDir.length()==0) {
      dataDir = core.getDataDir();
    }
         
    if (dataDir != null && dataDir.startsWith("hdfs:/")) {
      DirectoryFactory dirFactory = core.getDirectoryFactory();
      if (dirFactory instanceof HdfsDirectoryFactory) {
        ulog = new HdfsUpdateLog(((HdfsDirectoryFactory)dirFactory).getConfDir());
      } else {
        ulog = new HdfsUpdateLog();
      }
      
    } else {
      ulog = new UpdateLog();
    }
    
    if (!core.isReloaded() && !core.getDirectoryFactory().isPersistent()) {
      ulog.clearLog(core, ulogPluginInfo);
    }
    
    ulog.init(ulogPluginInfo);

    ulog.init(this, core);
  } else {
    ulog = updateLog;
  }
  // ulog.init() when reusing an existing log is deferred (currently at the end of the DUH2 constructor

}
 
开发者ID:europeana,项目名称:search,代码行数:45,代码来源:UpdateHandler.java


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