mirror of https://github.com/apache/lucene.git
SOLR-12365: Fix compilation failure in prometheus-exporter
This commit is contained in:
parent
84264c7410
commit
46592e981f
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue