use of org.apache.solr.metrics.reporters.solr.SolrShardReporter in project lucene-solr by apache.
the class SolrMetricManager method loadShardReporters.
public void loadShardReporters(PluginInfo[] pluginInfos, SolrCore core) {
// don't load for non-cloud cores
if (core.getCoreDescriptor().getCloudDescriptor() == null) {
return;
}
// prepare default plugin if none present in the config
Map<String, String> attrs = new HashMap<>();
attrs.put("name", "shardDefault");
attrs.put("group", SolrInfoBean.Group.shard.toString());
Map<String, Object> initArgs = new HashMap<>();
initArgs.put("period", DEFAULT_CLOUD_REPORTER_PERIOD);
String registryName = core.getCoreMetricManager().getRegistryName();
// collect infos and normalize
List<PluginInfo> infos = prepareCloudPlugins(pluginInfos, SolrInfoBean.Group.shard.toString(), SolrShardReporter.class.getName(), attrs, initArgs, null);
for (PluginInfo info : infos) {
try {
SolrMetricReporter reporter = loadReporter(registryName, core.getResourceLoader(), info, String.valueOf(core.hashCode()));
((SolrShardReporter) reporter).setCore(core);
} catch (Exception e) {
log.warn("Could not load shard reporter, pluginInfo=" + info, e);
}
}
}
Aggregations