Search in sources :

Example 1 with SolrClusterReporter

use of org.apache.solr.metrics.reporters.solr.SolrClusterReporter in project lucene-solr by apache.

the class SolrMetricManager method loadClusterReporters.

public void loadClusterReporters(PluginInfo[] pluginInfos, CoreContainer cc) {
    // don't load for non-cloud instances
    if (!cc.isZooKeeperAware()) {
        return;
    }
    Map<String, String> attrs = new HashMap<>();
    attrs.put("name", "clusterDefault");
    attrs.put("group", SolrInfoBean.Group.cluster.toString());
    Map<String, Object> initArgs = new HashMap<>();
    initArgs.put("period", DEFAULT_CLOUD_REPORTER_PERIOD);
    List<PluginInfo> infos = prepareCloudPlugins(pluginInfos, SolrInfoBean.Group.cluster.toString(), SolrClusterReporter.class.getName(), attrs, initArgs, null);
    String registryName = getRegistryName(SolrInfoBean.Group.cluster);
    for (PluginInfo info : infos) {
        try {
            SolrMetricReporter reporter = loadReporter(registryName, cc.getResourceLoader(), info, null);
            ((SolrClusterReporter) reporter).setCoreContainer(cc);
        } catch (Exception e) {
            log.warn("Could not load node reporter, pluginInfo=" + info, e);
        }
    }
}
Also used : HashMap(java.util.HashMap) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) PluginInfo(org.apache.solr.core.PluginInfo) SolrClusterReporter(org.apache.solr.metrics.reporters.solr.SolrClusterReporter) PatternSyntaxException(java.util.regex.PatternSyntaxException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 PatternSyntaxException (java.util.regex.PatternSyntaxException)1 PluginInfo (org.apache.solr.core.PluginInfo)1 SolrClusterReporter (org.apache.solr.metrics.reporters.solr.SolrClusterReporter)1