SOLR-12365: Fix compilation failure in prometheus-exporter

This commit is contained in:
Shalin Shekhar Mangar 2019-01-06 09:34:22 +05:30
parent 84264c7410
commit 46592e981f
3 changed files with 9 additions and 9 deletions

View File

@ -18,7 +18,7 @@ package org.apache.solr.prometheus.collector;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.solr.core.Config;
import org.apache.solr.core.XmlConfigFile;
import org.apache.solr.prometheus.scraper.SolrScraper;
import io.prometheus.client.Collector;
import org.apache.solr.client.solrj.SolrClient;
@ -57,7 +57,7 @@ public class SolrCollector extends Collector implements Collector.Describable {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
private SolrClient solrClient;
private Config config;
private XmlConfigFile config;
private int numThreads;
private ExecutorService executorService;
private static ObjectMapper om = new ObjectMapper();
@ -65,7 +65,7 @@ public class SolrCollector extends Collector implements Collector.Describable {
/**
* Constructor.
*/
public SolrCollector(SolrClient solrClient, Config config, int numThreads) {
public SolrCollector(SolrClient solrClient, XmlConfigFile config, int numThreads) {
this.solrClient = solrClient;
this.config = config;
this.numThreads = numThreads;

View File

@ -29,7 +29,7 @@ import org.apache.solr.client.solrj.SolrClient;
import org.apache.solr.client.solrj.impl.CloudSolrClient;
import org.apache.solr.client.solrj.impl.HttpSolrClient;
import org.apache.solr.client.solrj.impl.NoOpResponseParser;
import org.apache.solr.core.Config;
import org.apache.solr.core.XmlConfigFile;
import org.apache.solr.core.SolrResourceLoader;
import org.apache.solr.prometheus.collector.SolrCollector;
import org.slf4j.Logger;
@ -84,7 +84,7 @@ public class SolrExporter {
private int port;
private SolrClient solrClient;
private Config config;
private XmlConfigFile config;
private int numThreads;
CollectorRegistry registry = new CollectorRegistry();
@ -115,7 +115,7 @@ public class SolrExporter {
this.port = port;
this.solrClient = solrClient;
this.config = new Config(this.loader, configPath.getFileName().toString());
this.config = new XmlConfigFile(this.loader, configPath.getFileName().toString());
this.numThreads = numThreads;
}

View File

@ -16,8 +16,8 @@
*/
package org.apache.solr.prometheus.collector;
import org.apache.solr.core.Config;
import org.apache.solr.core.SolrResourceLoader;
import org.apache.solr.core.XmlConfigFile;
import org.apache.solr.prometheus.exporter.SolrExporter;
import org.apache.solr.prometheus.exporter.SolrExporterTestBase;
import io.prometheus.client.CollectorRegistry;
@ -52,7 +52,7 @@ public class SolrCollectorTest extends SolrExporterTestBase {
public void testSolrCollector() throws Exception {
String name = "solr-exporter-config.xml";
SolrResourceLoader loader = new SolrResourceLoader(getFile("conf/").toPath());
Config config = new Config(loader, name);
XmlConfigFile config = new XmlConfigFile(loader, name);
CloudSolrClient cloudSolrClient = cluster.getSolrClient();
@ -65,7 +65,7 @@ public class SolrCollectorTest extends SolrExporterTestBase {
public void testCollect() throws Exception {
String name = "solr-exporter-config.xml";
SolrResourceLoader loader = new SolrResourceLoader(getFile("conf/").toPath());
Config config = new Config(loader, name);
XmlConfigFile config = new XmlConfigFile(loader, name);
CloudSolrClient cloudSolrClient = cluster.getSolrClient();