mirror of https://github.com/apache/lucene.git
SOLR-8621: SolrIndexConfig.toMap() fix to distinguish mergePolicyInfo and mergePolicyFactoryInfo, associated SolrIndexConfigTest and TestConfig tweaks.
This commit is contained in:
parent
159ace1b7c
commit
77558a649f
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -154,7 +154,14 @@ public class SolrIndexConfigTest extends SolrTestCaseJ4 {
|
|||
}
|
||||
|
||||
++mSizeExpected; assertTrue(m.get("mergeScheduler") 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);
|
||||
|
|
Loading…
Reference in New Issue