Search in sources :

Example 1 with MetricsConfig

use of org.apache.solr.core.MetricsConfig in project lucene-solr by apache.

the class TestHarness method buildTestNodeConfig.

public static NodeConfig buildTestNodeConfig(SolrResourceLoader loader) {
    CloudConfig cloudConfig = new CloudConfig.CloudConfigBuilder(System.getProperty("host"), Integer.getInteger("hostPort", 8983), System.getProperty("hostContext", "")).setZkClientTimeout(Integer.getInteger("zkClientTimeout", 30000)).build();
    if (System.getProperty("zkHost") == null)
        cloudConfig = null;
    UpdateShardHandlerConfig updateShardHandlerConfig = new UpdateShardHandlerConfig(UpdateShardHandlerConfig.DEFAULT_MAXUPDATECONNECTIONS, UpdateShardHandlerConfig.DEFAULT_MAXUPDATECONNECTIONSPERHOST, 30000, 30000, UpdateShardHandlerConfig.DEFAULT_METRICNAMESTRATEGY, UpdateShardHandlerConfig.DEFAULT_MAXRECOVERYTHREADS);
    // universal default metric reporter
    Map<String, Object> attributes = new HashMap<>();
    attributes.put("name", "default");
    attributes.put("class", SolrJmxReporter.class.getName());
    PluginInfo defaultPlugin = new PluginInfo("reporter", attributes);
    MetricsConfig metricsConfig = new MetricsConfig.MetricsConfigBuilder().setMetricReporterPlugins(new PluginInfo[] { defaultPlugin }).build();
    return new NodeConfig.NodeConfigBuilder("testNode", loader).setUseSchemaCache(Boolean.getBoolean("shareSchema")).setCloudConfig(cloudConfig).setUpdateShardHandlerConfig(updateShardHandlerConfig).setMetricsConfig(metricsConfig).build();
}
Also used : HashMap(java.util.HashMap) CloudConfig(org.apache.solr.core.CloudConfig) MetricsConfig(org.apache.solr.core.MetricsConfig) UpdateShardHandlerConfig(org.apache.solr.update.UpdateShardHandlerConfig) PluginInfo(org.apache.solr.core.PluginInfo) SolrJmxReporter(org.apache.solr.metrics.reporters.SolrJmxReporter) NodeConfig(org.apache.solr.core.NodeConfig)

Aggregations

HashMap (java.util.HashMap)1 CloudConfig (org.apache.solr.core.CloudConfig)1 MetricsConfig (org.apache.solr.core.MetricsConfig)1 NodeConfig (org.apache.solr.core.NodeConfig)1 PluginInfo (org.apache.solr.core.PluginInfo)1 SolrJmxReporter (org.apache.solr.metrics.reporters.SolrJmxReporter)1 UpdateShardHandlerConfig (org.apache.solr.update.UpdateShardHandlerConfig)1