SOLR-8621: SolrIndexConfig.toMap() fix to distinguish mergePolicyInfo and mergePolicyFactoryInfo, associated SolrIndexConfigTest and TestConfig tweaks.

This commit is contained in:
Christine Poerschke 2016-02-12 19:04:45 +00:00
parent 159ace1b7c
commit 77558a649f
3 changed files with 15 additions and 3 deletions

View File

@ -191,7 +191,7 @@ public class SolrIndexConfig implements MapSerializable {
if (mergePolicyInfo != null) {
m.put("mergePolicy", mergePolicyInfo.toMap());
} else if (mergePolicyFactoryInfo != null) {
m.put("mergePolicy", mergePolicyFactoryInfo.toMap());
m.put("mergePolicyFactory", mergePolicyFactoryInfo.toMap());
}
if(mergedSegmentWarmerInfo != null) m.put("mergedSegmentWarmer",mergedSegmentWarmerInfo.toMap());
return m;

View File

@ -127,7 +127,12 @@ public class TestConfig extends SolrTestCaseJ4 {
++numDefaultsTested; assertEquals("default infoStream", InfoStream.NO_OUTPUT, sic.infoStream);
++numDefaultsTested; ++numNullDefaults; assertNull("default mergePolicyInfo", sic.mergePolicyInfo);
// mergePolicyInfo and mergePolicyFactoryInfo are mutually exclusive
// so ++ count them only once for both instead of individually
++numDefaultsTested; ++numNullDefaults;
assertNull("default mergePolicyInfo", sic.mergePolicyInfo);
assertNull("default mergePolicyFactoryInfo", sic.mergePolicyFactoryInfo);
++numDefaultsTested; ++numNullDefaults; assertNull("default mergeSchedulerInfo", sic.mergeSchedulerInfo);
++numDefaultsTested; ++numNullDefaults; assertNull("default mergedSegmentWarmerInfo", sic.mergedSegmentWarmerInfo);

View File

@ -154,7 +154,14 @@ public class SolrIndexConfigTest extends SolrTestCaseJ4 {
}
++mSizeExpected; assertTrue(m.get("mergeScheduler") instanceof Map);
++mSizeExpected; assertTrue(m.get("mergePolicy") instanceof Map);
if (solrConfigFileName.equals(solrConfigFileNameTieredMergePolicyFactory) ||
solrConfigFileName.equals(solrConfigFileNameWarmerRandomMergePolicyFactory)) {
assertNull(m.get("mergePolicy"));
++mSizeExpected; assertTrue(m.get("mergePolicyFactory") instanceof Map);
} else {
++mSizeExpected; assertTrue(m.get("mergePolicy") instanceof Map);
assertNull(m.get("mergePolicyFactory"));
}
if (solrConfigFileName.equals(solrConfigFileNameWarmerRandomMergePolicy) ||
solrConfigFileName.equals(solrConfigFileNameWarmerRandomMergePolicyFactory)) {
++mSizeExpected; assertTrue(m.get("mergedSegmentWarmer") instanceof Map);