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


Java SolrInfoMBean.Category方法代码示例

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


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

示例1: getMBeanInfo

import org.apache.solr.core.SolrInfoMBean; //导入方法依赖的package包/类
protected NamedList<NamedList<NamedList<Object>>> getMBeanInfo(SolrQueryRequest req) {

    NamedList<NamedList<NamedList<Object>>> cats = new NamedList<>();
    
    String[] requestedCats = req.getParams().getParams("cat");
    if (null == requestedCats || 0 == requestedCats.length) {
      for (SolrInfoMBean.Category cat : SolrInfoMBean.Category.values()) {
        cats.add(cat.name(), new SimpleOrderedMap<NamedList<Object>>());
      }
    } else {
      for (String catName : requestedCats) {
        cats.add(catName,new SimpleOrderedMap<NamedList<Object>>());
      }
    }
         
    Set<String> requestedKeys = arrayToSet(req.getParams().getParams("key"));
    
    Map<String, SolrInfoMBean> reg = req.getCore().getInfoRegistry();
    for (Map.Entry<String, SolrInfoMBean> entry : reg.entrySet()) {
      addMBean(req, cats, requestedKeys, entry.getKey(),entry.getValue());
    }

    for (SolrInfoMBean infoMBean : req.getCore().getCoreDescriptor().getCoreContainer().getResourceLoader().getInfoMBeans()) {
      addMBean(req,cats,requestedKeys,infoMBean.getName(),infoMBean);
    }
    return cats;
  }
 
开发者ID:europeana,项目名称:search,代码行数:28,代码来源:SolrInfoMBeanHandler.java

示例2: getSolrInfoBeans

import org.apache.solr.core.SolrInfoMBean; //导入方法依赖的package包/类
private static SimpleOrderedMap<Object> getSolrInfoBeans( SolrCore core, boolean stats )
{
  SimpleOrderedMap<Object> list = new SimpleOrderedMap<>();
  for (SolrInfoMBean.Category cat : SolrInfoMBean.Category.values()) 
  {
    SimpleOrderedMap<Object> category = new SimpleOrderedMap<>();
    list.add( cat.name(), category );
    Map<String, SolrInfoMBean> reg = core.getInfoRegistry();
    for (Map.Entry<String,SolrInfoMBean> entry : reg.entrySet()) {
      SolrInfoMBean m = entry.getValue();
      if (m.getCategory() != cat) continue;

      String na = "Not Declared";
      SimpleOrderedMap<Object> info = new SimpleOrderedMap<>();
      category.add( entry.getKey(), info );

      info.add( "name",        (m.getName()       !=null ? m.getName()        : na) );
      info.add( "version",     (m.getVersion()    !=null ? m.getVersion()     : na) );
      info.add( "description", (m.getDescription()!=null ? m.getDescription() : na) );
      info.add( "source",      (m.getSource()     !=null ? m.getSource()      : na) );

      URL[] urls = m.getDocs();
      if ((urls != null) && (urls.length > 0)) {
        ArrayList<String> docs = new ArrayList<>(urls.length);
        for( URL u : urls ) {
          docs.add( u.toExternalForm() );
        }
        info.add( "docs", docs );
      }

      if( stats ) {
        info.add( "stats", m.getStatistics() );
      }
    }
  }
  return list;
}
 
开发者ID:europeana,项目名称:search,代码行数:38,代码来源:PluginInfoHandler.java

示例3: getSolrInfoBeans

import org.apache.solr.core.SolrInfoMBean; //导入方法依赖的package包/类
private static SimpleOrderedMap<Object> getSolrInfoBeans( SolrCore core, boolean stats )
{
  SimpleOrderedMap<Object> list = new SimpleOrderedMap<Object>();
  for (SolrInfoMBean.Category cat : SolrInfoMBean.Category.values()) 
  {
    SimpleOrderedMap<Object> category = new SimpleOrderedMap<Object>();
    list.add( cat.name(), category );
    Map<String, SolrInfoMBean> reg = core.getInfoRegistry();
    for (Map.Entry<String,SolrInfoMBean> entry : reg.entrySet()) {
      SolrInfoMBean m = entry.getValue();
      if (m.getCategory() != cat) continue;

      String na = "Not Declared";
      SimpleOrderedMap<Object> info = new SimpleOrderedMap<Object>();
      category.add( entry.getKey(), info );

      info.add( "name",        (m.getName()       !=null ? m.getName()        : na) );
      info.add( "version",     (m.getVersion()    !=null ? m.getVersion()     : na) );
      info.add( "description", (m.getDescription()!=null ? m.getDescription() : na) );
      info.add( "source",      (m.getSource()     !=null ? m.getSource()      : na) );

      URL[] urls = m.getDocs();
      if ((urls != null) && (urls.length > 0)) {
        ArrayList<String> docs = new ArrayList<String>(urls.length);
        for( URL u : urls ) {
          docs.add( u.toExternalForm() );
        }
        info.add( "docs", docs );
      }

      if( stats ) {
        info.add( "stats", m.getStatistics() );
      }
    }
  }
  return list;
}
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:38,代码来源:PluginInfoHandler.java

示例4: getMBeanInfo

import org.apache.solr.core.SolrInfoMBean; //导入方法依赖的package包/类
protected NamedList<NamedList<NamedList<Object>>> getMBeanInfo(SolrQueryRequest req) {

    NamedList<NamedList<NamedList<Object>>> cats = new NamedList<NamedList<NamedList<Object>>>();
    
    String[] requestedCats = req.getParams().getParams("cat");
    if (null == requestedCats || 0 == requestedCats.length) {
      for (SolrInfoMBean.Category cat : SolrInfoMBean.Category.values()) {
        cats.add(cat.name(), new SimpleOrderedMap<NamedList<Object>>());
      }
    } else {
      for (String catName : requestedCats) {
        cats.add(catName,new SimpleOrderedMap<NamedList<Object>>());
      }
    }
         
    Set<String> requestedKeys = arrayToSet(req.getParams().getParams("key"));
    
    Map<String, SolrInfoMBean> reg = req.getCore().getInfoRegistry();
    for (Map.Entry<String, SolrInfoMBean> entry : reg.entrySet()) {
      String key = entry.getKey();
      SolrInfoMBean m = entry.getValue();

      if ( ! ( requestedKeys.isEmpty() || requestedKeys.contains(key) ) ) continue;

      NamedList<NamedList<Object>> catInfo = cats.get(m.getCategory().name());
      if ( null == catInfo ) continue;

      NamedList<Object> mBeanInfo = new SimpleOrderedMap<Object>();
      mBeanInfo.add("class", m.getName());
      mBeanInfo.add("version", m.getVersion());
      mBeanInfo.add("description", m.getDescription());
      mBeanInfo.add("src", m.getSource());
      
      // Use an external form
      URL[] urls = m.getDocs();
      if(urls!=null) {
        List<String> docs = new ArrayList<String>(urls.length);
        for(URL url : urls) {
          docs.add(url.toExternalForm());
        }
        mBeanInfo.add("docs", docs);
      }
      
      if (req.getParams().getFieldBool(key, "stats", false))
        mBeanInfo.add("stats", m.getStatistics());
      
      catInfo.add(key, mBeanInfo);
    }
    return cats;
  }
 
开发者ID:pkarmstr,项目名称:NYBC,代码行数:51,代码来源:SolrInfoMBeanHandler.java


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