SOLR-4952: use solrconfig.snippet.randomindexconfig.xml in solrconfig.xml and crazy-path-to-config.xml; this included removing some unneccessary checks for indexConfig settings that already have their own explicit tests

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1510802 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris M. Hostetter 2013-08-05 23:17:39 +00:00
parent 26a914558b
commit 6c8e6e00f3
5 changed files with 11 additions and 50 deletions

View File

@ -49,20 +49,8 @@
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion> <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
<indexConfig> <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
<writeLockTimeout>1000</writeLockTimeout>
<mergeFactor>8</mergeFactor>
<useCompoundFile>${useCompoundFile:false}</useCompoundFile>
<!-- for better multi-segment testing, we are using slower
indexing properties of maxBufferedDocs=10 and LogDocMergePolicy.
-->
<maxBufferedDocs>10</maxBufferedDocs>
<mergePolicy class="org.apache.lucene.index.LogDocMergePolicy"/>
<lockType>native</lockType>
<unlockOnStartup>true</unlockOnStartup>
</indexConfig>
<updateHandler class="solr.DirectUpdateHandler2"> <updateHandler class="solr.DirectUpdateHandler2">
<!-- autocommit pending docs if certain criteria are met <!-- autocommit pending docs if certain criteria are met

View File

@ -24,10 +24,7 @@
<config> <config>
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion> <luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
<indexConfig> <xi:include href="collection1/conf/solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<useCompoundFile>${useCompoundFile:false}</useCompoundFile>
<lockType>single</lockType>
</indexConfig>
<updateHandler class="solr.DirectUpdateHandler2"> <updateHandler class="solr.DirectUpdateHandler2">
<commitIntervalLowerBound>0</commitIntervalLowerBound> <commitIntervalLowerBound>0</commitIntervalLowerBound>

View File

@ -31,7 +31,6 @@ import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.lucene.document.Field; import org.apache.lucene.document.Field;
import org.apache.lucene.document.LazyDocument; import org.apache.lucene.document.LazyDocument;
import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.LogMergePolicy;
import org.apache.lucene.index.StorableField; import org.apache.lucene.index.StorableField;
import org.apache.lucene.index.StoredDocument; import org.apache.lucene.index.StoredDocument;
import org.apache.lucene.store.Directory; import org.apache.lucene.store.Directory;
@ -127,30 +126,11 @@ public class BasicFunctionalityTest extends SolrTestCaseJ4 {
public void testSomeStuff() throws Exception { public void testSomeStuff() throws Exception {
clearIndex(); clearIndex();
// test merge factor picked up
// and for rate limited settings
SolrCore core = h.getCore(); SolrCore core = h.getCore();
RefCounted<IndexWriter> iwr = ((DirectUpdateHandler2) core // test that we got the expected config, not just hardcoded defaults
.getUpdateHandler()).getSolrCoreState().getIndexWriter(core); assertNotNull(core.getRequestHandler("mock"));
try {
IndexWriter iw = iwr.get();
assertEquals("Mergefactor was not picked up", 8, ((LogMergePolicy) iw.getConfig().getMergePolicy()).getMergeFactor());
Directory dir = iw.getDirectory();
if (dir instanceof MockDirectoryWrapper) {
dir = ((MockDirectoryWrapper)dir).getDelegate();
}
assertTrue(dir.getClass().getName(), dir instanceof RateLimitedDirectoryWrapper);
assertEquals(Double.valueOf(1000000), ((RateLimitedDirectoryWrapper)dir).getMaxWriteMBPerSec(Context.DEFAULT));
assertEquals(Double.valueOf(2000000), ((RateLimitedDirectoryWrapper)dir).getMaxWriteMBPerSec(Context.FLUSH));
assertEquals(Double.valueOf(3000000), ((RateLimitedDirectoryWrapper)dir).getMaxWriteMBPerSec(Context.MERGE));
assertEquals(Double.valueOf(4000000), ((RateLimitedDirectoryWrapper)dir).getMaxWriteMBPerSec(Context.READ));
} finally {
iwr.decref();
}
// test stats call // test stats call
NamedList stats = core.getStatistics(); NamedList stats = core.getStatistics();
assertEquals("collection1", stats.get("coreName")); assertEquals("collection1", stats.get("coreName"));

View File

@ -18,7 +18,6 @@ package org.apache.solr.cloud;
*/ */
import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.index.LogMergePolicy;
import org.apache.lucene.util.LuceneTestCase.Slow; import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.solr.SolrTestCaseJ4; import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.SolrException; import org.apache.solr.common.SolrException;
@ -58,16 +57,12 @@ public class BasicZkTest extends AbstractZkTestCase {
h.getCoreContainer().getZkController().getZkStateReader().getLeaderUrl("collection1", "shard1", 30000); h.getCoreContainer().getZkController().getZkStateReader().getLeaderUrl("collection1", "shard1", 30000);
ZkController zkController = h.getCoreContainer().getZkController(); ZkController zkController = h.getCoreContainer().getZkController();
// test merge factor picked up
SolrCore core = h.getCore(); SolrCore core = h.getCore();
RefCounted<IndexWriter> iw = ((DirectUpdateHandler2)core.getUpdateHandler()).getSolrCoreState().getIndexWriter(core); // test that we got the expected config, not just hardcoded defaults
try { assertNotNull(core.getRequestHandler("mock"));
assertEquals("Mergefactor was not picked up", 8, ((LogMergePolicy)iw.get().getConfig().getMergePolicy()).getMergeFactor());
} finally {
iw.decref();
}
lrf.args.put(CommonParams.VERSION, "2.2"); lrf.args.put(CommonParams.VERSION, "2.2");
assertQ("test query on empty index", request("qlkciyopsbgzyvkylsjhchghjrdf"), assertQ("test query on empty index", request("qlkciyopsbgzyvkylsjhchghjrdf"),
"//result[@numFound='0']"); "//result[@numFound='0']");

View File

@ -105,6 +105,7 @@ public abstract class AbstractZkTestCase extends SolrTestCaseJ4 {
putConfig(zkClient, solrhome, config, "solrconfig.xml"); putConfig(zkClient, solrhome, config, "solrconfig.xml");
putConfig(zkClient, solrhome, schema, "schema.xml"); putConfig(zkClient, solrhome, schema, "schema.xml");
putConfig(zkClient, solrhome, "solrconfig.snippet.randomindexconfig.xml");
putConfig(zkClient, solrhome, "stopwords.txt"); putConfig(zkClient, solrhome, "stopwords.txt");
putConfig(zkClient, solrhome, "protwords.txt"); putConfig(zkClient, solrhome, "protwords.txt");
putConfig(zkClient, solrhome, "currency.xml"); putConfig(zkClient, solrhome, "currency.xml");