SOLR-9867: fixing JvmMetricsTest broken earlier, bring back testTechproductsExample()

and single SDF.cores assignment.
This commit is contained in:
Mikhail Khludnev 2017-05-04 17:18:24 +03:00
parent 1534b6219f
commit 5eb4a8d71b
2 changed files with 8 additions and 9 deletions

View File

@ -172,7 +172,7 @@ public class SolrDispatchFilter extends BaseSolrFilter {
coresInit = createCoreContainer(solrHome == null ? SolrResourceLoader.locateSolrHome() : Paths.get(solrHome),
extraProperties);
this.httpClient = coresInit.getUpdateShardHandler().getHttpClient();
setupJvmMetrics();
setupJvmMetrics(coresInit);
log.debug("user.dir=" + System.getProperty("user.dir"));
}
catch( Throwable t ) {
@ -190,9 +190,9 @@ public class SolrDispatchFilter extends BaseSolrFilter {
}
}
private void setupJvmMetrics() {
SolrMetricManager metricManager = cores.getMetricManager();
final Set<String> hiddenSysProps = cores.getConfig().getHiddenSysProps();
private void setupJvmMetrics(CoreContainer coresInit) {
SolrMetricManager metricManager = coresInit.getMetricManager();
final Set<String> hiddenSysProps = coresInit.getConfig().getHiddenSysProps();
try {
String registry = SolrMetricManager.getRegistryName(SolrInfoBean.Group.jvm);
metricManager.registerAll(registry, new AltBufferPoolMetricSet(), true, "buffers");
@ -247,9 +247,9 @@ public class SolrDispatchFilter extends BaseSolrFilter {
*/
protected CoreContainer createCoreContainer(Path solrHome, Properties extraProperties) {
NodeConfig nodeConfig = loadNodeConfig(solrHome, extraProperties);
cores = new CoreContainer(nodeConfig, extraProperties, true);
cores.load();
return cores;
final CoreContainer coreContainer = new CoreContainer(nodeConfig, extraProperties, true);
coreContainer.load();
return coreContainer;
}
/**

View File

@ -50,7 +50,6 @@ import org.apache.solr.common.SolrInputDocument;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -297,7 +296,7 @@ public class TestSolrCLIRunExample extends SolrTestCaseJ4 {
closeables = null;
}
}
@Ignore
@Test
public void testTechproductsExample() throws Exception {
testExample("techproducts");