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


Java SolrPluginUtils.invokeSetters方法代码示例

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


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

示例1: buildMergeScheduler

import org.apache.solr.util.SolrPluginUtils; //导入方法依赖的package包/类
private MergeScheduler buildMergeScheduler(IndexSchema schema) {
  String msClassName = mergeSchedulerInfo == null ? SolrIndexConfig.DEFAULT_MERGE_SCHEDULER_CLASSNAME : mergeSchedulerInfo.className;
  MergeScheduler scheduler = schema.getResourceLoader().newInstance(msClassName, MergeScheduler.class);

  if (mergeSchedulerInfo != null) {
    // LUCENE-5080: these two setters are removed, so we have to invoke setMaxMergesAndThreads
    // if someone has them configured.
    if (scheduler instanceof ConcurrentMergeScheduler) {
      NamedList args = mergeSchedulerInfo.initArgs.clone();
      Integer maxMergeCount = (Integer) args.remove("maxMergeCount");
      if (maxMergeCount == null) {
        maxMergeCount = ((ConcurrentMergeScheduler) scheduler).getMaxMergeCount();
      }
      Integer maxThreadCount = (Integer) args.remove("maxThreadCount");
      if (maxThreadCount == null) {
        maxThreadCount = ((ConcurrentMergeScheduler) scheduler).getMaxThreadCount();
      }
      ((ConcurrentMergeScheduler)scheduler).setMaxMergesAndThreads(maxMergeCount, maxThreadCount);
      SolrPluginUtils.invokeSetters(scheduler, args);
    } else {
      SolrPluginUtils.invokeSetters(scheduler, mergeSchedulerInfo.initArgs);
    }
  }

  return scheduler;
}
 
开发者ID:europeana,项目名称:search,代码行数:27,代码来源:SolrIndexConfig.java

示例2: buildMergePolicy

import org.apache.solr.util.SolrPluginUtils; //导入方法依赖的package包/类
private MergePolicy buildMergePolicy(IndexSchema schema) {
  String mpClassName = mergePolicyInfo == null ? defaultMergePolicyClassName : mergePolicyInfo.className;

  MergePolicy policy = schema.getResourceLoader().newInstance(mpClassName, MergePolicy.class);

  if (policy instanceof LogMergePolicy) {
    LogMergePolicy logMergePolicy = (LogMergePolicy) policy;

    if (maxMergeDocs != -1)
      logMergePolicy.setMaxMergeDocs(maxMergeDocs);

    logMergePolicy.setUseCompoundFile(useCompoundFile);

    if (mergeFactor != -1)
      logMergePolicy.setMergeFactor(mergeFactor);
  } else if (policy instanceof TieredMergePolicy) {
    TieredMergePolicy tieredMergePolicy = (TieredMergePolicy) policy;
    
    tieredMergePolicy.setUseCompoundFile(useCompoundFile);
    
    if (mergeFactor != -1) {
      tieredMergePolicy.setMaxMergeAtOnce(mergeFactor);
      tieredMergePolicy.setSegmentsPerTier(mergeFactor);
    }
  } else {
    log.warn("Use of compound file format or mergefactor cannot be configured if merge policy is not an instance of LogMergePolicy or TieredMergePolicy. The configured policy's defaults will be used.");
  }

  if (mergePolicyInfo != null)
    SolrPluginUtils.invokeSetters(policy, mergePolicyInfo.initArgs);

  return policy;
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:34,代码来源:SolrIndexConfig.java

示例3: buildMergeScheduler

import org.apache.solr.util.SolrPluginUtils; //导入方法依赖的package包/类
private MergeScheduler buildMergeScheduler(IndexSchema schema) {
  String msClassName = mergeSchedulerInfo == null ? SolrIndexConfig.DEFAULT_MERGE_SCHEDULER_CLASSNAME : mergeSchedulerInfo.className;
  MergeScheduler scheduler = schema.getResourceLoader().newInstance(msClassName, MergeScheduler.class);

  if (mergeSchedulerInfo != null)
    SolrPluginUtils.invokeSetters(scheduler, mergeSchedulerInfo.initArgs);

  return scheduler;
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:10,代码来源:SolrIndexConfig.java

示例4: buildMergePolicy

import org.apache.solr.util.SolrPluginUtils; //导入方法依赖的package包/类
/**
 * Builds a MergePolicy, may also modify the value returned by
 * getUseCompoundFile() for use by the IndexWriterConfig if 
 * "useCompoundFile" is specified as an init arg for 
 * an out of the box MergePolicy that no longer supports it
 *
 * @see #fixUseCFMergePolicyInitArg
 * @see #getUseCompoundFile
 */
private MergePolicy buildMergePolicy(IndexSchema schema) {
  String mpClassName = mergePolicyInfo == null ? defaultMergePolicyClassName : mergePolicyInfo.className;

  MergePolicy policy = schema.getResourceLoader().newInstance(mpClassName, MergePolicy.class);

  if (policy instanceof LogMergePolicy) {
    LogMergePolicy logMergePolicy = (LogMergePolicy) policy;
    fixUseCFMergePolicyInitArg(LogMergePolicy.class);

    if (maxMergeDocs != -1)
      logMergePolicy.setMaxMergeDocs(maxMergeDocs);

    logMergePolicy.setNoCFSRatio(getUseCompoundFile() ? 1.0 : 0.0);

    if (mergeFactor != -1)
      logMergePolicy.setMergeFactor(mergeFactor);


  } else if (policy instanceof TieredMergePolicy) {
    TieredMergePolicy tieredMergePolicy = (TieredMergePolicy) policy;
    fixUseCFMergePolicyInitArg(TieredMergePolicy.class);
    
    tieredMergePolicy.setNoCFSRatio(getUseCompoundFile() ? 1.0 : 0.0);
    
    if (mergeFactor != -1) {
      tieredMergePolicy.setMaxMergeAtOnce(mergeFactor);
      tieredMergePolicy.setSegmentsPerTier(mergeFactor);
    }


  } else if (mergeFactor != -1) {
    log.warn("Use of <mergeFactor> cannot be configured if merge policy is not an instance of LogMergePolicy or TieredMergePolicy. The configured policy's defaults will be used.");
  }

  if (mergePolicyInfo != null)
    SolrPluginUtils.invokeSetters(policy, mergePolicyInfo.initArgs);

  return policy;
}
 
开发者ID:europeana,项目名称:search,代码行数:49,代码来源:SolrIndexConfig.java


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