You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by cm...@apache.org on 2013/08/11 14:19:39 UTC
svn commit: r1512909 [31/38] - in /lucene/dev/branches/lucene4956: ./
dev-tools/ dev-tools/eclipse/ dev-tools/idea/.idea/libraries/
dev-tools/idea/lucene/suggest/ dev-tools/idea/solr/contrib/dataimporthandler/
dev-tools/idea/solr/core/src/test/ dev-too...
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-querysender.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-querysender.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-querysender.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-querysender.xml Sun Aug 11 12:19:13 2013
@@ -19,6 +19,7 @@
<config>
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
+ <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<!-- The DirectoryFactory to use for indexes.
solr.StandardDirectoryFactory, the default, is filesystem based.
solr.RAMDirectoryFactory is memory based and not persistent. -->
@@ -47,7 +48,6 @@
<listener event="newSearcher"
class="org.apache.solr.core.MockEventListener" />
-
<!-- a firstSearcher event is fired whenever a new searcher is being
prepared but there is no current registered searcher to handle
requests or to gain prewarming data from. -->
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-repeater.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-repeater.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-repeater.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-repeater.xml Sun Aug 11 12:19:13 2013
@@ -22,9 +22,7 @@
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
<dataDir>${solr.data.dir:}</dataDir>
- <indexConfig>
- <lockType>single</lockType>
- </indexConfig>
+ <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<updateHandler class="solr.DirectUpdateHandler2">
</updateHandler>
@@ -54,7 +52,6 @@
</lst>
</requestHandler>
-
<!-- enable streaming for testing... -->
<requestDispatcher handleSelect="true">
<requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048"/>
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-response-log-component.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-response-log-component.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-response-log-component.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-response-log-component.xml Sun Aug 11 12:19:13 2013
@@ -19,6 +19,7 @@
<config>
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
+ <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<requestHandler name="standard"
class="solr.StandardRequestHandler"></requestHandler>
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-script-updateprocessor.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-script-updateprocessor.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-script-updateprocessor.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-script-updateprocessor.xml Sun Aug 11 12:19:13 2013
@@ -23,6 +23,7 @@
-->
<config>
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
+ <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<requestHandler name="standard" class="solr.StandardRequestHandler"></requestHandler>
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
@@ -34,7 +35,6 @@
<processor class="solr.RunUpdateProcessorFactory" />
</updateRequestProcessorChain>
-
<updateRequestProcessorChain name="run-no-scripts">
<!-- for bypassing all scripts -->
<processor class="solr.RunUpdateProcessorFactory" />
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-slave.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-slave.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-slave.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-slave.xml Sun Aug 11 12:19:13 2013
@@ -22,9 +22,7 @@
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
<dataDir>${solr.data.dir:}</dataDir>
- <indexConfig>
- <lockType>single</lockType>
- </indexConfig>
+ <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<updateHandler class="solr.DirectUpdateHandler2">
</updateHandler>
@@ -52,7 +50,6 @@
</lst>
</requestHandler>
-
<!-- enable streaming for testing... -->
<requestDispatcher handleSelect="true">
<requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048"/>
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-slave1.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-slave1.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-slave1.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-slave1.xml Sun Aug 11 12:19:13 2013
@@ -22,9 +22,7 @@
<dataDir>${solr.data.dir:}</dataDir>
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
- <indexConfig>
- <lockType>single</lockType>
- </indexConfig>
+ <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<updateHandler class="solr.DirectUpdateHandler2">
</updateHandler>
@@ -48,7 +46,6 @@
</requestHandler>
-
<!-- enable streaming for testing... -->
<requestDispatcher handleSelect="true">
<requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048"/>
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-solcoreproperties.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-solcoreproperties.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-solcoreproperties.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-solcoreproperties.xml Sun Aug 11 12:19:13 2013
@@ -28,6 +28,7 @@
<indexConfig>
<lockType>single</lockType>
+ <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
</indexConfig>
<updateHandler class="solr.DirectUpdateHandler2">
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml Sun Aug 11 12:19:13 2013
@@ -19,6 +19,7 @@
<config>
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
+ <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<requestHandler name="standard"
class="solr.StandardRequestHandler"></requestHandler>
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellchecker.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellchecker.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellchecker.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellchecker.xml Sun Aug 11 12:19:13 2013
@@ -17,6 +17,7 @@
-->
<config>
+ <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<!-- The DirectoryFactory to use for indexes.
solr.StandardDirectoryFactory, the default, is filesystem based.
solr.RAMDirectoryFactory is memory based and not persistent. -->
@@ -24,7 +25,6 @@
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
-
<updateHandler class="solr.DirectUpdateHandler2">
</updateHandler>
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-termindex.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-termindex.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-termindex.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-termindex.xml Sun Aug 11 12:19:13 2013
@@ -31,7 +31,7 @@
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
<indexConfig>
- <termIndexInterval>256</termIndexInterval>
+ <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
<mergePolicy class="org.apache.lucene.index.TieredMergePolicy"/>
<mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
</indexConfig>
@@ -39,9 +39,7 @@
<updateHandler class="solr.DirectUpdateHandler2">
</updateHandler>
- <indexReaderFactory name="IndexReaderFactory" class="org.apache.solr.core.StandardIndexReaderFactory">
- <int name="setTermIndexDivisor">12</int>
- </indexReaderFactory >
+ <indexReaderFactory name="IndexReaderFactory" class="org.apache.solr.core.StandardIndexReaderFactory"/>
<requestHandler name="standard" class="solr.StandardRequestHandler"></requestHandler>
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog-managed-schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog-managed-schema.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog-managed-schema.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog-managed-schema.xml Sun Aug 11 12:19:13 2013
@@ -35,6 +35,7 @@
<indexConfig>
<lockType>${solr.lock.type:native}</lockType>
+ <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
</indexConfig>
<!-- an update processor the explicitly excludes distrib to test
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog-mutable-managed-schema.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog-mutable-managed-schema.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog-mutable-managed-schema.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog-mutable-managed-schema.xml Sun Aug 11 12:19:13 2013
@@ -35,6 +35,7 @@
<indexConfig>
<lockType>${solr.lock.type:native}</lockType>
+ <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
</indexConfig>
<!-- an update processor the explicitly excludes distrib to test
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-tlog.xml Sun Aug 11 12:19:13 2013
@@ -24,13 +24,17 @@
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}">
<!-- used to keep RAM reqs down for HdfsDirectoryFactory -->
+ <bool name="solr.hdfs.blockcache.enabled">${solr.hdfs.blockcache.enabled:true}</bool>
<int name="solr.hdfs.blockcache.blocksperbank">${solr.hdfs.blockcache.blocksperbank:1024}</int>
+ <str name="solr.hdfs.home">${solr.hdfs.home:}</str>
+ <str name="solr.hdfs.confdir">${solr.hdfs.confdir:}</str>
</directoryFactory>
<dataDir>${solr.data.dir:}</dataDir>
<indexConfig>
<lockType>${solr.lock.type:native}</lockType>
+ <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
</indexConfig>
<!-- an update processor the explicitly excludes distrib to test
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-transformers.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-transformers.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-transformers.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-transformers.xml Sun Aug 11 12:19:13 2013
@@ -19,12 +19,12 @@
<config>
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
+ <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<!-- The DirectoryFactory to use for indexes.
solr.StandardDirectoryFactory, the default, is filesystem based.
solr.RAMDirectoryFactory is memory based and not persistent. -->
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
-
<updateRequestProcessorChain name="standard">
<processor class="solr.CustomUpdateRequestProcessorFactory" enable="false">
<!-- this processor is not enabled, so it won't be used at all -->
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-update-processor-chains.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-update-processor-chains.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-update-processor-chains.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-update-processor-chains.xml Sun Aug 11 12:19:13 2013
@@ -24,6 +24,7 @@
-->
<config>
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
+ <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<requestHandler name="standard" class="solr.StandardRequestHandler"></requestHandler>
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
@@ -53,7 +54,6 @@
<processor class="solr.RunUpdateProcessorFactory" />
</updateRequestProcessorChain>
-
<updateRequestProcessorChain name="trim-all">
<!-- no specific src field configs, so all fields should get trimmed -->
<processor class="solr.TrimFieldUpdateProcessorFactory">
@@ -66,7 +66,6 @@
</processor>
</updateRequestProcessorChain>
-
<updateRequestProcessorChain name="trim-most">
<!-- all fields except the exclusions should be trimmed -->
<processor class="solr.TrimFieldUpdateProcessorFactory">
@@ -241,6 +240,46 @@
<processor class="solr.IgnoreFieldUpdateProcessorFactory" />
</updateRequestProcessorChain>
+ <updateRequestProcessorChain name="ignore-not-in-schema-explicit-selector">
+ <processor class="solr.IgnoreFieldUpdateProcessorFactory">
+ <bool name="fieldNameMatchesSchemaField">false</bool>
+ </processor>
+ </updateRequestProcessorChain>
+
+ <updateRequestProcessorChain name="ignore-in-schema">
+ <processor class="solr.IgnoreFieldUpdateProcessorFactory">
+ <bool name="fieldNameMatchesSchemaField">true</bool>
+ </processor>
+ </updateRequestProcessorChain>
+
+ <updateRequestProcessorChain name="ignore-not-in-schema-and-foo-name-prefix">
+ <processor class="solr.IgnoreFieldUpdateProcessorFactory">
+ <str name="fieldRegex">foo.*</str>
+ <bool name="fieldNameMatchesSchemaField">false</bool>
+ </processor>
+ </updateRequestProcessorChain>
+
+ <updateRequestProcessorChain name="ignore-foo-name-prefix-except-not-schema">
+ <processor class="solr.IgnoreFieldUpdateProcessorFactory">
+ <str name="fieldRegex">foo.*</str>
+ <lst name="exclude">
+ <bool name="fieldNameMatchesSchemaField">false</bool>
+ </lst>
+ </processor>
+ </updateRequestProcessorChain>
+
+ <updateRequestProcessorChain name="ignore-not-in-schema-explicit-str-selector">
+ <processor class="solr.IgnoreFieldUpdateProcessorFactory">
+ <str name="fieldNameMatchesSchemaField">false</str>
+ </processor>
+ </updateRequestProcessorChain>
+
+ <updateRequestProcessorChain name="ignore-in-schema-str-selector">
+ <processor class="solr.IgnoreFieldUpdateProcessorFactory">
+ <str name="fieldNameMatchesSchemaField">true</str>
+ </processor>
+ </updateRequestProcessorChain>
+
<updateRequestProcessorChain name="ignore-some">
<processor class="solr.IgnoreFieldUpdateProcessorFactory">
<str name="fieldRegex">.*_raw</str>
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-warmer.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-warmer.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-warmer.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-warmer.xml Sun Aug 11 12:19:13 2013
@@ -26,6 +26,7 @@
<requestHandler name="standard" class="solr.StandardRequestHandler"></requestHandler>
<indexConfig>
+ <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
<mergedSegmentWarmer class="org.apache.lucene.index.SimpleMergedSegmentWarmer"/>
</indexConfig>
</config>
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-xinclude.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-xinclude.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-xinclude.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig-xinclude.xml Sun Aug 11 12:19:13 2013
@@ -19,6 +19,8 @@
<config>
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
+ <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
<xi:include href="foobar-missing.xml" xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:fallback>
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig.xml Sun Aug 11 12:19:13 2013
@@ -49,20 +49,8 @@
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
- <indexConfig>
- <mergeScheduler class="org.apache.lucene.index.ConcurrentMergeScheduler"/>
- <writeLockTimeout>1000</writeLockTimeout>
- <mergeFactor>8</mergeFactor>
+ <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
- <!-- 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">
<!-- autocommit pending docs if certain criteria are met
@@ -94,7 +82,7 @@
</listener>
-->
- <updateLog enable="${enable.update.log:false}">
+ <updateLog enable="${enable.update.log:true}">
<str name="dir">${solr.ulog.dir:}</str>
</updateLog>
@@ -104,7 +92,6 @@
</updateHandler>
-
<query>
<!-- Maximum number of clauses in a boolean query... can affect
range or wildcard queries that expand to big boolean
@@ -112,7 +99,6 @@
-->
<maxBooleanClauses>1024</maxBooleanClauses>
-
<!-- Cache specification for Filters or DocSets - unordered set of *all* documents
that match a particular query.
-->
@@ -149,7 +135,6 @@
/>
-->
-
<!--
<useFilterForSortedQuery>true</useFilterForSortedQuery>
-->
@@ -159,14 +144,12 @@
<!-- set maxSize artificially low to exercise both types of sets -->
<HashDocSet maxSize="3" loadFactor="0.75"/>
-
<!-- boolToFilterOptimizer converts boolean clauses with zero boost
into cached filters if the number of docs selected by the clause exceeds
the threshold (represented as a fraction of the total index)
-->
<boolTofilterOptimizer enabled="false" cacheSize="32" threshold=".05"/>
-
<!-- a newSearcher event is fired whenever a new searcher is being prepared
and there is a current searcher handling requests (aka registered). -->
<!-- QuerySenderListener takes an array of NamedList and executes a
@@ -191,7 +174,6 @@
</listener>
-->
-
</query>
<queryResponseWriter name="xml" default="true"
@@ -219,7 +201,6 @@
</lst>
</requestHandler>
-
<requestHandler name="dismax" class="solr.SearchHandler" >
<lst name="defaults">
<str name="defType">dismax</str>
@@ -265,7 +246,6 @@
<requestHandler name="/update" class="solr.UpdateRequestHandler" />
-
<searchComponent name="spellcheck" class="org.apache.solr.handler.component.SpellCheckComponent">
<!-- This is slightly different from the field value so we can test dealing with token offset changes -->
<str name="queryAnalyzerFieldType">lowerpunctfilt</str>
@@ -471,7 +451,6 @@
</highlighting>
</searchComponent>
-
<!-- enable streaming for testing... -->
<requestDispatcher handleSelect="true" >
<requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048" />
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig_codec.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig_codec.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig_codec.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig_codec.xml Sun Aug 11 12:19:13 2013
@@ -18,6 +18,7 @@
<config>
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
+ <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
<requestHandler name="standard" class="solr.StandardRequestHandler"></requestHandler>
<codecFactory class="solr.SchemaCodecFactory"/>
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig_perf.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig_perf.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig_perf.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/collection1/conf/solrconfig_perf.xml Sun Aug 11 12:19:13 2013
@@ -23,6 +23,8 @@
If replication is in use, this should match the replication configuration. -->
<dataDir>${solr.data.dir:}</dataDir>
+ <xi:include href="solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+
<!-- The DirectoryFactory to use for indexes.
solr.StandardDirectoryFactory, the default, is filesystem based.
solr.RAMDirectoryFactory is memory based and not persistent. -->
@@ -66,7 +68,6 @@
</httpCaching>
</requestDispatcher>
-
<requestHandler name="standard" class="solr.SearchHandler" default="true">
</requestHandler>
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/crazy-path-to-config.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/crazy-path-to-config.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/crazy-path-to-config.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/crazy-path-to-config.xml Sun Aug 11 12:19:13 2013
@@ -24,15 +24,12 @@
<config>
<luceneMatchVersion>${tests.luceneMatchVersion:LUCENE_CURRENT}</luceneMatchVersion>
- <indexConfig>
- <lockType>single</lockType>
- </indexConfig>
+ <xi:include href="collection1/conf/solrconfig.snippet.randomindexconfig.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
<updateHandler class="solr.DirectUpdateHandler2">
<commitIntervalLowerBound>0</commitIntervalLowerBound>
</updateHandler>
-
<query>
<maxBooleanClauses>1024</maxBooleanClauses>
<useFilterForSortedQuery>true</useFilterForSortedQuery>
@@ -54,12 +51,9 @@
<queryResponseWriter name="useless" class="org.apache.solr.OutputWriterTest$UselessOutputWriter" startup="lazy"/>
<queryResponseWriter name="xslt" class="solr.XSLTResponseWriter"/>
-
<admin>
<defaultQuery>solr</defaultQuery>
<gettableFiles>solrconfig.xml schema.xml</gettableFiles>
</admin>
-
-
</config>
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/solr-no-core.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/solr-no-core.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/solr-no-core.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/solr-no-core.xml Sun Aug 11 12:19:13 2013
@@ -25,6 +25,7 @@
<str name="hostContext">${hostContext:solr}</str>
<int name="hostPort">${hostPort:8983}</int>
<int name="zkClientTimeout">${solr.zkclienttimeout:30000}</int>
+ <bool name="genericCoreNodeNames">${genericCoreNodeNames:true}</bool>
<int name="distribUpdateConnTimeout">${distribUpdateConnTimeout:15000}</int>
<int name="distribUpdateSoTimeout">${distribUpdateSoTimeout:120000}</int>
</solrcloud>
@@ -35,4 +36,4 @@
<int name="connTimeout">${connTimeout:15000}</int>
</shardHandlerFactory>
-</solr>
\ No newline at end of file
+</solr>
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/solr-shardhandler.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/solr-shardhandler.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/solr-shardhandler.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/solr-shardhandler.xml Sun Aug 11 12:19:13 2013
@@ -20,10 +20,10 @@
solr.xml specifying a custom shardHandlerFactory
-->
<solr>
- <cores>
+
<shardHandlerFactory name="shardHandlerFactory"
class="org.apache.solr.core.MockShardHandlerFactory">
<str name="myMagicRequiredParameter">myMagicRequiredValue</str>
</shardHandlerFactory>
- </cores>
+
</solr>
Modified: lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/solr.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/solr.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/solr.xml (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test-files/solr/solr.xml Sun Aug 11 12:19:13 2013
@@ -30,6 +30,7 @@
-->
<cores adminPath="/admin/cores" defaultCoreName="collection1" host="127.0.0.1" hostPort="${hostPort:8983}"
hostContext="${hostContext:solr}" zkClientTimeout="${solr.zkclienttimeout:30000}" numShards="${numShards:3}" shareSchema="${shareSchema:false}"
+ genericCoreNodeNames="${genericCoreNodeNames:true}"
distribUpdateConnTimeout="${distribUpdateConnTimeout:15000}" distribUpdateSoTimeout="${distribUpdateSoTimeout:120000}">
<core name="collection1" instanceDir="collection1" shard="${shard:}" collection="${collection:collection1}" config="${solrconfig:solrconfig.xml}" schema="${schema:schema.xml}"
coreNodeName="${coreNodeName:}"/>
Modified: lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/BasicFunctionalityTest.java Sun Aug 11 12:19:13 2013
@@ -31,7 +31,6 @@ import javax.xml.parsers.DocumentBuilder
import org.apache.lucene.document.Field;
import org.apache.lucene.document.LazyDocument;
import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.index.LogMergePolicy;
import org.apache.lucene.index.StorableField;
import org.apache.lucene.index.StoredDocument;
import org.apache.lucene.store.Directory;
@@ -127,30 +126,11 @@ public class BasicFunctionalityTest exte
public void testSomeStuff() throws Exception {
clearIndex();
- // test merge factor picked up
- // and for rate limited settings
SolrCore core = h.getCore();
- RefCounted<IndexWriter> iwr = ((DirectUpdateHandler2) core
- .getUpdateHandler()).getSolrCoreState().getIndexWriter(core);
- 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 that we got the expected config, not just hardcoded defaults
+ assertNotNull(core.getRequestHandler("mock"));
+
// test stats call
NamedList stats = core.getStatistics();
assertEquals("collection1", stats.get("coreName"));
Modified: lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/ConvertedLegacyTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/ConvertedLegacyTest.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/ConvertedLegacyTest.java (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/ConvertedLegacyTest.java Sun Aug 11 12:19:13 2013
@@ -1121,7 +1121,7 @@ public class ConvertedLegacyTest extends
"standard", 0, 10, args);
assertQ(req
,"//str[.='Yonik']"
- ,"//float[.='2.9459102']"
+ ,"//float[@name='score' and . > 0]"
);
// test addition of score field
Modified: lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/SolrTestCaseJ4Test.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/SolrTestCaseJ4Test.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/SolrTestCaseJ4Test.java (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/SolrTestCaseJ4Test.java Sun Aug 11 12:19:13 2013
@@ -42,6 +42,7 @@ public class SolrTestCaseJ4Test extends
String top = SolrTestCaseJ4.TEST_HOME() + "/collection1/conf";
FileUtils.copyFile(new File(top, "schema-tiny.xml"), new File(subHome, "schema-tiny.xml"));
FileUtils.copyFile(new File(top, "solrconfig-minimal.xml"), new File(subHome, "solrconfig-minimal.xml"));
+ FileUtils.copyFile(new File(top, "solrconfig.snippet.randomindexconfig.xml"), new File(subHome, "solrconfig.snippet.randomindexconfig.xml"));
FileUtils.copyDirectory(new File(tmpSolrHome, "core0"), new File(tmpSolrHome, "core1"));
Modified: lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestDistributedSearch.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestDistributedSearch.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestDistributedSearch.java (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestDistributedSearch.java Sun Aug 11 12:19:13 2013
@@ -123,6 +123,7 @@ public class TestDistributedSearch exten
handle.clear();
handle.put("QTime", SKIPVAL);
handle.put("timestamp", SKIPVAL);
+ handle.put("_version_", SKIPVAL); // not a cloud test, but may use updateLog
// random value sort
for (String f : fieldNames) {
@@ -350,7 +351,7 @@ public class TestDistributedSearch exten
ChaosMonkey.stop(downJetty);
downJettys.add(downJetty);
}
-
+
queryPartialResults(upShards, upClients,
"q","*:*",
"facet","true",
@@ -358,7 +359,27 @@ public class TestDistributedSearch exten
"facet.limit",5,
ShardParams.SHARDS_INFO,"true",
ShardParams.SHARDS_TOLERANT,"true");
-
+
+ queryPartialResults(upShards, upClients,
+ "q", "*:*",
+ "facet", "true",
+ "facet.query", i1 + ":[1 TO 50]",
+ ShardParams.SHARDS_INFO, "true",
+ ShardParams.SHARDS_TOLERANT, "true");
+
+ // test group query
+ queryPartialResults(upShards, upClients,
+ "q", "*:*",
+ "rows", 100,
+ "fl", "id," + i1,
+ "group", "true",
+ "group.query", t1 + ":kings OR " + t1 + ":eggs",
+ "group.limit", 10,
+ "sort", i1 + " asc, id asc",
+ CommonParams.TIME_ALLOWED, 1,
+ ShardParams.SHARDS_INFO, "true",
+ ShardParams.SHARDS_TOLERANT, "true");
+
// restart the jettys
for (JettySolrRunner downJetty : downJettys) {
downJetty.start();
Modified: lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestGroupingSearch.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestGroupingSearch.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestGroupingSearch.java (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestGroupingSearch.java Sun Aug 11 12:19:13 2013
@@ -54,6 +54,7 @@ public class TestGroupingSearch extends
@BeforeClass
public static void beforeTests() throws Exception {
+ System.setProperty("enable.update.log", "false"); // schema12 doesn't support _version_
initCore("solrconfig.xml", "schema12.xml");
}
Modified: lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestJoin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestJoin.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestJoin.java (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestJoin.java Sun Aug 11 12:19:13 2013
@@ -37,6 +37,7 @@ public class TestJoin extends SolrTestCa
@BeforeClass
public static void beforeTests() throws Exception {
+ System.setProperty("enable.update.log", "false"); // schema12 doesn't support _version_
initCore("solrconfig.xml","schema12.xml");
}
Modified: lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestRandomFaceting.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestRandomFaceting.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestRandomFaceting.java (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestRandomFaceting.java Sun Aug 11 12:19:13 2013
@@ -37,6 +37,7 @@ public class TestRandomFaceting extends
@BeforeClass
public static void beforeTests() throws Exception {
+ System.setProperty("enable.update.log", "false"); // schema12 doesn't support _version_
initCore("solrconfig.xml","schema12.xml");
}
Modified: lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestSolrCoreProperties.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestSolrCoreProperties.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestSolrCoreProperties.java (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestSolrCoreProperties.java Sun Aug 11 12:19:13 2013
@@ -124,7 +124,7 @@ public class TestSolrCoreProperties exte
Properties p = new Properties();
p.setProperty("foo.foo1", "f1");
p.setProperty("foo.foo2", "f2");
- FileOutputStream fos = new FileOutputStream(confDir + File.separator + "solrcore.properties");
+ Writer fos = new OutputStreamWriter(new FileOutputStream(confDir + File.separator + "solrcore.properties"), IOUtils.CHARSET_UTF_8);
p.store(fos, null);
IOUtils.close(fos);
}
Modified: lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestTrie.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestTrie.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestTrie.java (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/TestTrie.java Sun Aug 11 12:19:13 2013
@@ -27,7 +27,6 @@ import org.junit.After;
import org.junit.BeforeClass;
import org.junit.Test;
-import java.io.StringReader;
import java.text.SimpleDateFormat;
import java.util.Locale;
import java.util.TimeZone;
@@ -57,7 +56,7 @@ public class TestTrie extends SolrTestCa
assertTrue(type instanceof TrieField);
String value = String.valueOf(random().nextInt());
- TokenStream ts = type.getAnalyzer().tokenStream("dummy", new StringReader(value));
+ TokenStream ts = type.getAnalyzer().tokenStream("dummy", value);
OffsetAttribute ofsAtt = ts.addAttribute(OffsetAttribute.class);
ts.reset();
int count = 0;
@@ -74,7 +73,7 @@ public class TestTrie extends SolrTestCa
ts.close();
// Test empty one:
- ts = type.getAnalyzer().tokenStream("dummy", new StringReader(""));
+ ts = type.getAnalyzer().tokenStream("dummy", "");
ts.reset();
assertFalse(ts.incrementToken());
ts.end();
Modified: lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/analysis/TestReversedWildcardFilterFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/analysis/TestReversedWildcardFilterFactory.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/analysis/TestReversedWildcardFilterFactory.java (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/analysis/TestReversedWildcardFilterFactory.java Sun Aug 11 12:19:13 2013
@@ -86,7 +86,7 @@ public class TestReversedWildcardFilterF
String text = "one two three si\uD834\uDD1Ex";
// field one
- TokenStream input = a.tokenStream("one", new StringReader(text));
+ TokenStream input = a.tokenStream("one", text);
assertTokenStreamContents(input,
new String[] { "\u0001eno", "one", "\u0001owt", "two",
"\u0001eerht", "three", "\u0001x\uD834\uDD1Eis", "si\uD834\uDD1Ex" },
@@ -95,7 +95,7 @@ public class TestReversedWildcardFilterF
new int[] { 1, 0, 1, 0, 1, 0, 1, 0 }
);
// field two
- input = a.tokenStream("two", new StringReader(text));
+ input = a.tokenStream("two", text);
assertTokenStreamContents(input,
new String[] { "\u0001eno", "\u0001owt",
"\u0001eerht", "\u0001x\uD834\uDD1Eis" },
@@ -104,7 +104,7 @@ public class TestReversedWildcardFilterF
new int[] { 1, 1, 1, 1 }
);
// field three
- input = a.tokenStream("three", new StringReader(text));
+ input = a.tokenStream("three", text);
assertTokenStreamContents(input,
new String[] { "one", "two", "three", "si\uD834\uDD1Ex" },
new int[] { 0, 4, 8, 14 },
Modified: lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/AliasIntegrationTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/AliasIntegrationTest.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/AliasIntegrationTest.java (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/AliasIntegrationTest.java Sun Aug 11 12:19:13 2013
@@ -152,7 +152,7 @@ public class AliasIntegrationTest extend
createAlias("testalias", "collection2,collection1");
// search with new cloud client
- CloudSolrServer cloudSolrServer = new CloudSolrServer(zkServer.getZkAddress());
+ CloudSolrServer cloudSolrServer = new CloudSolrServer(zkServer.getZkAddress(), random().nextBoolean());
query = new SolrQuery("*:*");
query.set("collection", "testalias");
res = cloudSolrServer.query(query);
Modified: lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZk2Test.java Sun Aug 11 12:19:13 2013
@@ -46,9 +46,7 @@ import org.apache.solr.common.cloud.ZkSt
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.util.NamedList;
-import org.apache.solr.core.SolrCore;
import org.apache.solr.handler.ReplicationHandler;
-import org.apache.solr.servlet.SolrDispatchFilter;
import org.apache.solr.util.AbstractSolrTestCase;
import org.junit.BeforeClass;
@@ -176,8 +174,8 @@ public class BasicDistributedZk2Test ext
createCmd.setCoreName(ONE_NODE_COLLECTION + "core");
createCmd.setCollection(ONE_NODE_COLLECTION);
createCmd.setNumShards(1);
- createCmd.setDataDir(dataDir.getAbsolutePath() + File.separator
- + ONE_NODE_COLLECTION);
+ createCmd.setDataDir(getDataDir(dataDir.getAbsolutePath() + File.separator
+ + ONE_NODE_COLLECTION));
server.request(createCmd);
} catch (Exception e) {
e.printStackTrace();
@@ -331,7 +329,7 @@ public class BasicDistributedZk2Test ext
ureq.process(cloudClient);
} catch(SolrServerException e){
// try again
- Thread.sleep(500);
+ Thread.sleep(3500);
ureq.process(cloudClient);
}
@@ -415,14 +413,16 @@ public class BasicDistributedZk2Test ext
ModifiableSolrParams params = new ModifiableSolrParams();
params.set("qt", "/replication");
params.set("command", "backup");
+ File location = new File(TEMP_DIR, BasicDistributedZk2Test.class.getName() + "-backupdir-" + System.currentTimeMillis());
+ params.set("location", location.getAbsolutePath());
QueryRequest request = new QueryRequest(params);
NamedList<Object> results = client.request(request );
- checkForBackupSuccess(client);
+ checkForBackupSuccess(client, location);
}
- private void checkForBackupSuccess(final HttpSolrServer client)
+ private void checkForBackupSuccess(final HttpSolrServer client, File location)
throws InterruptedException, IOException {
class CheckStatus extends Thread {
volatile String fail = null;
@@ -461,16 +461,6 @@ public class BasicDistributedZk2Test ext
};
}
- ;
- SolrCore core = ((SolrDispatchFilter) shardToJetty.get(SHARD2).get(0).jetty
- .getDispatchFilter().getFilter()).getCores().getCore("collection1");
- String ddir;
- try {
- ddir = core.getDataDir();
- } finally {
- core.close();
- }
- File dataDir = new File(ddir);
int waitCnt = 0;
CheckStatus checkStatus = new CheckStatus();
@@ -482,14 +472,14 @@ public class BasicDistributedZk2Test ext
if (checkStatus.success) {
break;
}
- Thread.sleep(200);
- if (waitCnt == 20) {
+ Thread.sleep(500);
+ if (waitCnt == 90) {
fail("Backup success not detected:" + checkStatus.response);
}
waitCnt++;
}
- File[] files = dataDir.listFiles(new FilenameFilter() {
+ File[] files = location.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
Modified: lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/BasicDistributedZkTest.java Sun Aug 11 12:19:13 2013
@@ -160,7 +160,26 @@ public class BasicDistributedZkTest exte
waitForRecoveriesToFinish(false);
+ handle.clear();
+ handle.put("QTime", SKIPVAL);
+ handle.put("timestamp", SKIPVAL);
+
del("*:*");
+ queryAndCompareShards(params("q", "*:*", "distrib", "false", "sanity_check", "is_empty"));
+
+ // ask every individual replica of every shard to update+commit the same doc id
+ // with an incrementing counter on each update+commit
+ int foo_i_counter = 0;
+ for (SolrServer server : clients) {
+ foo_i_counter++;
+ indexDoc(server, params("commit", "true"), // SOLR-4923
+ sdoc(id,1, i1,100, tlong,100, "foo_i", foo_i_counter));
+ // after every update+commit, check all the shards consistency
+ queryAndCompareShards(params("q", "id:1", "distrib", "false",
+ "sanity_check", "non_distrib_id_1_lookup"));
+ queryAndCompareShards(params("q", "id:1",
+ "sanity_check", "distrib_id_1_lookup"));
+ }
indexr(id,1, i1, 100, tlong, 100,t1,"now is the time for all good men"
,"foo_f", 1.414f, "foo_b", "true", "foo_d", 1.414d);
@@ -195,10 +214,10 @@ public class BasicDistributedZkTest exte
}
commit();
-
- handle.clear();
- handle.put("QTime", SKIPVAL);
- handle.put("timestamp", SKIPVAL);
+ queryAndCompareShards(params("q", "*:*",
+ "sort", "id desc",
+ "distrib", "false",
+ "sanity_check", "is_empty"));
// random value sort
for (String f : fieldNames) {
@@ -333,12 +352,44 @@ public class BasicDistributedZkTest exte
testUpdateProcessorsRunOnlyOnce("distrib-dup-test-chain-implicit");
testStopAndStartCoresInOneInstance();
+ testFailedCoreCreateCleansUp();
// Thread.sleep(10000000000L);
if (DEBUG) {
super.printLayout();
}
}
+ private void testFailedCoreCreateCleansUp() throws Exception {
+ Create createCmd = new Create();
+ createCmd.setCoreName("core1");
+ createCmd.setCollection("the_core_collection");
+ String coredataDir = dataDir.getAbsolutePath() + File.separator
+ + System.currentTimeMillis() + "the_core_collection";
+ createCmd.setDataDir(coredataDir);
+ createCmd.setNumShards(1);
+ createCmd.setSchemaName("nonexistent_schema.xml");
+
+ String url = getBaseUrl(clients.get(0));
+ final HttpSolrServer server = new HttpSolrServer(url);
+ try {
+ server.request(createCmd);
+ fail("Expected SolrCore create to fail");
+ } catch (Exception e) {
+
+ }
+
+ long timeout = System.currentTimeMillis() + 15000;
+ while (cloudClient.getZkStateReader().getZkClient().exists("/collections/the_core_collection", true)) {
+ if (timeout <= System.currentTimeMillis()) {
+ fail(cloudClient.getZkStateReader().getZkClient().getChildren("/collections", null, true).toString() + " Collection zk node still exists");
+ }
+ Thread.sleep(100);
+ }
+
+
+ assertFalse("Collection zk node still exists", cloudClient.getZkStateReader().getZkClient().exists("/collections/the_core_collection", true));
+ }
+
private void testShardParamVariations() throws Exception {
SolrQuery query = new SolrQuery("*:*");
Map<String,Long> shardCounts = new HashMap<String,Long>();
@@ -487,11 +538,13 @@ public class BasicDistributedZkTest exte
Create createCmd = new Create();
createCmd.setCoreName(collection + freezeI);
createCmd.setCollection(collection);
- String core3dataDir = dataDir.getAbsolutePath() + File.separator
- + System.currentTimeMillis() + collection + "_3n" + freezeI;
- createCmd.setDataDir(core3dataDir);
+
createCmd.setNumShards(numShards);
try {
+ String core3dataDir = dataDir.getAbsolutePath() + File.separator
+ + System.currentTimeMillis() + collection + "_3n" + freezeI;
+ createCmd.setDataDir(getDataDir(core3dataDir));
+
server.request(createCmd);
} catch (SolrServerException e) {
throw new RuntimeException(e);
@@ -523,11 +576,13 @@ public class BasicDistributedZkTest exte
params.set(OverseerCollectionProcessor.MAX_SHARDS_PER_NODE, maxShardsPerNode);
if (createNodeSetStr != null) params.set(OverseerCollectionProcessor.CREATE_NODE_SET, createNodeSetStr);
- int clientIndex = random().nextInt(2);
+ int clientIndex = clients.size() > 1 ? random().nextInt(2) : 0;
List<Integer> list = new ArrayList<Integer>();
list.add(numShards);
list.add(numReplicas);
- collectionInfos.put(collectionName, list);
+ if (collectionInfos != null) {
+ collectionInfos.put(collectionName, list);
+ }
params.set("name", collectionName);
SolrRequest request = new QueryRequest(params);
request.setPath("/admin/collections");
@@ -881,8 +936,8 @@ public class BasicDistributedZkTest exte
if (shardId == null) {
createCmd.setNumShards(2);
}
- createCmd.setDataDir(dataDir.getAbsolutePath() + File.separator
- + collection + num);
+ createCmd.setDataDir(getDataDir(dataDir.getAbsolutePath() + File.separator
+ + collection + num));
if (shardId != null) {
createCmd.setShardId(shardId);
}
@@ -1005,8 +1060,9 @@ public class BasicDistributedZkTest exte
server.setSoTimeout(30000);
Create createCmd = new Create();
createCmd.setCoreName(collection);
- createCmd.setDataDir(dataDir.getAbsolutePath() + File.separator
- + collection + frozeUnique);
+ createCmd.setDataDir(getDataDir(dataDir.getAbsolutePath() + File.separator
+ + collection + frozeUnique));
+
server.request(createCmd);
} catch (Exception e) {
@@ -1047,7 +1103,7 @@ public class BasicDistributedZkTest exte
if (commondCloudSolrServer == null) {
synchronized(this) {
try {
- commondCloudSolrServer = new CloudSolrServer(zkServer.getZkAddress());
+ commondCloudSolrServer = new CloudSolrServer(zkServer.getZkAddress(), random().nextBoolean());
commondCloudSolrServer.setDefaultCollection(DEFAULT_COLLECTION);
commondCloudSolrServer.getLbServer().setConnectionTimeout(15000);
commondCloudSolrServer.getLbServer().setSoTimeout(30000);
Modified: lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/BasicZkTest.java Sun Aug 11 12:19:13 2013
@@ -18,7 +18,6 @@ package org.apache.solr.cloud;
*/
import org.apache.lucene.index.IndexWriter;
-import org.apache.lucene.index.LogMergePolicy;
import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.SolrException;
@@ -58,16 +57,12 @@ public class BasicZkTest extends Abstrac
h.getCoreContainer().getZkController().getZkStateReader().getLeaderUrl("collection1", "shard1", 30000);
ZkController zkController = h.getCoreContainer().getZkController();
-
- // test merge factor picked up
+
SolrCore core = h.getCore();
- RefCounted<IndexWriter> iw = ((DirectUpdateHandler2)core.getUpdateHandler()).getSolrCoreState().getIndexWriter(core);
- try {
- assertEquals("Mergefactor was not picked up", 8, ((LogMergePolicy)iw.get().getConfig().getMergePolicy()).getMergeFactor());
- } finally {
- iw.decref();
- }
+ // test that we got the expected config, not just hardcoded defaults
+ assertNotNull(core.getRequestHandler("mock"));
+
lrf.args.put(CommonParams.VERSION, "2.2");
assertQ("test query on empty index", request("qlkciyopsbgzyvkylsjhchghjrdf"),
"//result[@numFound='0']");
Modified: lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeTest.java Sun Aug 11 12:19:13 2013
@@ -42,7 +42,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Slow
-@BadApple
public class ChaosMonkeyNothingIsSafeTest extends AbstractFullDistribZkTestBase {
public static Logger log = LoggerFactory.getLogger(ChaosMonkeyNothingIsSafeTest.class);
Modified: lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyShardSplitTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyShardSplitTest.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyShardSplitTest.java (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyShardSplitTest.java Sun Aug 11 12:19:13 2013
@@ -31,6 +31,7 @@ import org.apache.solr.handler.component
import org.apache.zookeeper.KeeperException;
import org.junit.After;
import org.junit.Before;
+import org.junit.Ignore;
import java.io.IOException;
import java.util.Collection;
@@ -41,6 +42,7 @@ import java.util.concurrent.atomic.Atomi
* Test split phase that occurs when a Collection API split call is made.
*/
@Slow
+@Ignore("SOLR-4944")
public class ChaosMonkeyShardSplitTest extends ShardSplitTest {
static final int TIMEOUT = 10000;
@@ -78,7 +80,7 @@ public class ChaosMonkeyShardSplitTest e
try {
del("*:*");
for (int id = 0; id < 100; id++) {
- indexAndUpdateCount(router, ranges, docCounts, String.valueOf(id));
+ indexAndUpdateCount(router, ranges, docCounts, String.valueOf(id), id);
}
commit();
@@ -88,7 +90,7 @@ public class ChaosMonkeyShardSplitTest e
int max = atLeast(401);
for (int id = 101; id < max; id++) {
try {
- indexAndUpdateCount(router, ranges, docCounts, String.valueOf(id));
+ indexAndUpdateCount(router, ranges, docCounts, String.valueOf(id), id);
Thread.sleep(atLeast(25));
} catch (Exception e) {
log.error("Exception while adding doc", e);
Modified: lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/ClusterStateUpdateTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/ClusterStateUpdateTest.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/ClusterStateUpdateTest.java (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/ClusterStateUpdateTest.java Sun Aug 11 12:19:13 2013
@@ -17,11 +17,6 @@ package org.apache.solr.cloud;
* limitations under the License.
*/
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.cloud.ClusterState;
@@ -31,7 +26,6 @@ import org.apache.solr.common.cloud.Solr
import org.apache.solr.common.cloud.ZkNodeProps;
import org.apache.solr.common.cloud.ZkStateReader;
import org.apache.solr.core.CoreContainer;
-import org.apache.solr.core.CoreContainer.Initializer;
import org.apache.solr.core.CoreDescriptor;
import org.apache.solr.core.SolrCore;
import org.apache.zookeeper.CreateMode;
@@ -41,6 +35,11 @@ import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
@Slow
public class ClusterStateUpdateTest extends SolrTestCaseJ4 {
protected static Logger log = LoggerFactory
@@ -65,17 +64,17 @@ public class ClusterStateUpdateTest exte
private File dataDir3;
private File dataDir4;
-
- private Initializer init2;
@BeforeClass
public static void beforeClass() {
System.setProperty("solrcloud.skip.autorecovery", "true");
+ System.setProperty("genericCoreNodeNames", "false");
}
@AfterClass
public static void afterClass() throws InterruptedException {
System.clearProperty("solrcloud.skip.autorecovery");
+ System.clearProperty("genericCoreNodeNames");
}
@Override
@@ -111,22 +110,21 @@ public class ClusterStateUpdateTest exte
System.setProperty("solr.solr.home", TEST_HOME());
System.setProperty("hostPort", "1661");
- CoreContainer.Initializer init1 = new CoreContainer.Initializer();
System.setProperty("solr.data.dir", ClusterStateUpdateTest.this.dataDir1.getAbsolutePath());
- container1 = init1.initialize();
+ container1 = new CoreContainer();
+ container1.load();
System.clearProperty("hostPort");
System.setProperty("hostPort", "1662");
- init2 = new CoreContainer.Initializer();
System.setProperty("solr.data.dir", ClusterStateUpdateTest.this.dataDir2.getAbsolutePath());
- container2 = init2.initialize();
+ container2 = new CoreContainer();
+ container2.load();
System.clearProperty("hostPort");
System.setProperty("hostPort", "1663");
- CoreContainer.Initializer init3 = new CoreContainer.Initializer();
-
System.setProperty("solr.data.dir", ClusterStateUpdateTest.this.dataDir3.getAbsolutePath());
- container3 = init3.initialize();
+ container3 = new CoreContainer();
+ container3.load();
System.clearProperty("hostPort");
System.clearProperty("solr.solr.home");
@@ -152,11 +150,13 @@ public class ClusterStateUpdateTest exte
CreateMode.PERSISTENT, true);
zkClient.close();
- CoreDescriptor dcore = new CoreDescriptor(container1, "testcore",
- "testcore");
-
- dcore.setDataDir(dataDir4.getAbsolutePath());
+ CoreDescriptor dcore = buildCoreDescriptor(container1, "testcore", "testcore")
+ .withDataDir(dataDir4.getAbsolutePath()).build();
+ if (container1.getZkController() != null) {
+ container1.preRegisterInZk(dcore);
+ }
+
SolrCore core = container1.create(dcore);
container1.register(core, false);
@@ -220,7 +220,11 @@ public class ClusterStateUpdateTest exte
.disconnect();
container2.shutdown();
- container2 = init2.initialize();
+ System.setProperty("hostPort", "1662");
+ System.setProperty("solr.data.dir", ClusterStateUpdateTest.this.dataDir2.getAbsolutePath());
+ container2 = new CoreContainer();
+ container2.load();
+ System.clearProperty("hostPort");
// pause for watch to trigger
for(int i = 0; i < 200; i++) {
Modified: lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/CollectionsAPIDistributedZkTest.java Sun Aug 11 12:19:13 2013
@@ -17,30 +17,6 @@ package org.apache.solr.cloud;
* limitations under the License.
*/
-import java.io.File;
-import java.io.IOException;
-import java.lang.management.ManagementFactory;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.CompletionService;
-import java.util.concurrent.ExecutorCompletionService;
-import java.util.concurrent.Future;
-import java.util.concurrent.SynchronousQueue;
-import java.util.concurrent.ThreadPoolExecutor;
-import java.util.concurrent.TimeUnit;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-
import org.apache.lucene.util.Constants;
import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.lucene.util._TestUtil;
@@ -50,8 +26,8 @@ import org.apache.solr.client.solrj.Solr
import org.apache.solr.client.solrj.impl.CloudSolrServer;
import org.apache.solr.client.solrj.impl.HttpSolrServer;
import org.apache.solr.client.solrj.request.CoreAdminRequest;
-import org.apache.solr.client.solrj.request.QueryRequest;
import org.apache.solr.client.solrj.request.CoreAdminRequest.Create;
+import org.apache.solr.client.solrj.request.QueryRequest;
import org.apache.solr.client.solrj.response.CoreAdminResponse;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.common.SolrException;
@@ -78,6 +54,31 @@ import org.apache.solr.util.DefaultSolrT
import org.junit.Before;
import org.junit.BeforeClass;
+import javax.management.MBeanServer;
+import javax.management.MBeanServerFactory;
+import javax.management.ObjectName;
+import java.io.File;
+import java.io.IOException;
+import java.lang.management.ManagementFactory;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.concurrent.CompletionService;
+import java.util.concurrent.ExecutorCompletionService;
+import java.util.concurrent.Future;
+import java.util.concurrent.SynchronousQueue;
+import java.util.concurrent.ThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
+
+import static org.apache.solr.cloud.OverseerCollectionProcessor.REPLICATION_FACTOR;
+
/**
* Tests the Cloud Collections API.
*/
@@ -260,7 +261,7 @@ public class CollectionsAPIDistributedZk
collectionName = "collection";
params.set("name", collectionName);
params.set("numShards", 2);
- params.set(OverseerCollectionProcessor.REPLICATION_FACTOR, 10);
+ params.set(REPLICATION_FACTOR, 10);
request = new QueryRequest(params);
request.setPath("/admin/collections");
gotExp = false;
@@ -277,7 +278,7 @@ public class CollectionsAPIDistributedZk
params.set("action", CollectionAction.CREATE.toString());
collectionName = "acollection";
params.set("name", collectionName);
- params.set(OverseerCollectionProcessor.REPLICATION_FACTOR, 10);
+ params.set(REPLICATION_FACTOR, 10);
request = new QueryRequest(params);
request.setPath("/admin/collections");
gotExp = false;
@@ -294,7 +295,7 @@ public class CollectionsAPIDistributedZk
params.set("action", CollectionAction.CREATE.toString());
collectionName = "acollection";
params.set("name", collectionName);
- params.set(OverseerCollectionProcessor.REPLICATION_FACTOR, 10);
+ params.set(REPLICATION_FACTOR, 10);
params.set("numShards", 0);
request = new QueryRequest(params);
request.setPath("/admin/collections");
@@ -361,7 +362,7 @@ public class CollectionsAPIDistributedZk
params.set("action", CollectionAction.CREATE.toString());
params.set("numShards", 2);
- params.set(OverseerCollectionProcessor.REPLICATION_FACTOR, 2);
+ params.set(REPLICATION_FACTOR, 2);
String collectionName = "nodes_used_collection";
params.set("name", collectionName);
@@ -373,7 +374,7 @@ public class CollectionsAPIDistributedZk
numShardsNumReplicaList.add(2);
numShardsNumReplicaList.add(2);
checkForCollection("nodes_used_collection", numShardsNumReplicaList , null);
-
+
List<String> createNodeList = new ArrayList<String>();
Set<String> liveNodes = cloudClient.getZkStateReader().getClusterState()
@@ -382,7 +383,7 @@ public class CollectionsAPIDistributedZk
for (String node : liveNodes) {
createNodeList.add(node);
}
-
+
DocCollection col = cloudClient.getZkStateReader().getClusterState().getCollection("nodes_used_collection");
Collection<Slice> slices = col.getSlices();
for (Slice slice : slices) {
@@ -394,7 +395,7 @@ public class CollectionsAPIDistributedZk
assertEquals(createNodeList.toString(), 1, createNodeList.size());
}
-
+
private void testCollectionsAPI() throws Exception {
// TODO: fragile - because we dont pass collection.confName, it will only
@@ -545,7 +546,7 @@ public class CollectionsAPIDistributedZk
params.set("action", CollectionAction.CREATE.toString());
params.set("numShards", 1);
- params.set(OverseerCollectionProcessor.REPLICATION_FACTOR, 2);
+ params.set(REPLICATION_FACTOR, 2);
collectionName = "acollectionafterbaddelete";
params.set("name", collectionName);
Modified: lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/LeaderElectionIntegrationTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/LeaderElectionIntegrationTest.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/LeaderElectionIntegrationTest.java (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/LeaderElectionIntegrationTest.java Sun Aug 11 12:19:13 2013
@@ -17,25 +17,12 @@ package org.apache.solr.cloud;
* limitations under the License.
*/
-import java.io.File;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.xml.parsers.ParserConfigurationException;
-
import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.common.cloud.SolrZkClient;
import org.apache.solr.common.cloud.ZkNodeProps;
import org.apache.solr.common.cloud.ZkStateReader;
import org.apache.solr.core.CoreContainer;
-import org.apache.solr.core.CoreContainer.Initializer;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -43,6 +30,17 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.SAXException;
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
@Slow
public class LeaderElectionIntegrationTest extends SolrTestCaseJ4 {
protected static Logger log = LoggerFactory
@@ -140,7 +138,6 @@ public class LeaderElectionIntegrationTe
System.setProperty("hostPort", Integer.toString(port));
System.setProperty("shard", shard);
- Initializer init = new CoreContainer.Initializer();
System.setProperty("solr.data.dir", data.getAbsolutePath());
System.setProperty("solr.solr.home", TEST_HOME());
Set<Integer> ports = shardPorts.get(shard);
@@ -149,7 +146,8 @@ public class LeaderElectionIntegrationTe
shardPorts.put(shard, ports);
}
ports.add(port);
- CoreContainer container = init.initialize();
+ CoreContainer container = new CoreContainer();
+ container.load();
assertTrue("Container " + port + " has no cores!", container.getCores()
.size() > 0);
containerMap.put(port, container);
Modified: lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/OverseerCollectionProcessorTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/OverseerCollectionProcessorTest.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/OverseerCollectionProcessorTest.java (original)
+++ lucene/dev/branches/lucene4956/solr/core/src/test/org/apache/solr/cloud/OverseerCollectionProcessorTest.java Sun Aug 11 12:19:13 2013
@@ -17,25 +17,6 @@ package org.apache.solr.cloud;
* limitations under the License.
*/
-import static org.easymock.EasyMock.capture;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.reset;
-import static org.easymock.EasyMock.verify;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Queue;
-import java.util.Set;
-
import org.apache.solr.SolrTestCaseJ4;
import org.apache.solr.client.solrj.SolrResponse;
import org.apache.solr.client.solrj.response.QueryResponse;
@@ -51,8 +32,8 @@ import org.apache.solr.common.util.StrUt
import org.apache.solr.handler.component.ShardHandler;
import org.apache.solr.handler.component.ShardRequest;
import org.apache.solr.handler.component.ShardResponse;
+import org.apache.zookeeper.CreateMode;
import org.easymock.Capture;
-import org.easymock.EasyMock;
import org.easymock.IAnswer;
import org.eclipse.jetty.util.BlockingArrayQueue;
import org.junit.After;
@@ -61,6 +42,27 @@ import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Queue;
+import java.util.Set;
+
+import static org.easymock.EasyMock.anyBoolean;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.capture;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.getCurrentArguments;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.reset;
+import static org.easymock.EasyMock.verify;
+
public class OverseerCollectionProcessorTest extends SolrTestCaseJ4 {
private static final String ADMIN_PATH = "/admin/cores";
@@ -72,12 +74,14 @@ public class OverseerCollectionProcessor
private static ZkStateReader zkStateReaderMock;
private static ClusterState clusterStateMock;
private static SolrZkClient solrZkClientMock;
-
+ private final Map zkMap = new HashMap();
+ private final Set collectionsSet = new HashSet();
+
private OverseerCollectionProcessorToBeTested underTest;
private Thread thread;
private Queue<QueueEvent> queue = new BlockingArrayQueue<QueueEvent>();
-
+
private class OverseerCollectionProcessorToBeTested extends
OverseerCollectionProcessor {
@@ -92,6 +96,7 @@ public class OverseerCollectionProcessor
@Override
protected SolrResponse processMessage(ZkNodeProps message, String operation) {
lastProcessMessageResult = super.processMessage(message, operation);
+ log.info("1 : "+System.currentTimeMillis());
return lastProcessMessageResult;
}
@@ -123,6 +128,7 @@ public class OverseerCollectionProcessor
@Before
public void setUp() throws Exception {
super.setUp();
+ queue.clear();
reset(workQueueMock);
reset(workQueueMock);
reset(shardHandlerMock);
@@ -131,6 +137,8 @@ public class OverseerCollectionProcessor
reset(solrZkClientMock);
underTest = new OverseerCollectionProcessorToBeTested(zkStateReaderMock,
"1234", shardHandlerMock, ADMIN_PATH, workQueueMock);
+ zkMap.clear();
+ collectionsSet.clear();
}
@After
@@ -156,7 +164,7 @@ public class OverseerCollectionProcessor
expectLastCall().andAnswer(new IAnswer<Object>() {
@Override
public Object answer() throws Throwable {
- queue.remove((QueueEvent)EasyMock.getCurrentArguments()[0]);
+ queue.remove((QueueEvent) getCurrentArguments()[0]);
return null;
}
}).anyTimes();
@@ -190,7 +198,7 @@ public class OverseerCollectionProcessor
expectLastCall().andAnswer(new IAnswer<Object>() {
@Override
public Object answer() throws Throwable {
- return new HashSet<String>();
+ return collectionsSet;
}
}).anyTimes();
final Set<String> liveNodes = new HashSet<String>();
@@ -216,10 +224,59 @@ public class OverseerCollectionProcessor
return liveNodes;
}
}).anyTimes();
+ solrZkClientMock.create(anyObject(String.class), anyObject(byte[].class), anyObject(CreateMode.class), anyBoolean());
+ expectLastCall().andAnswer(new IAnswer<String>() {
+ @Override
+ public String answer() throws Throwable {
+ String key = (String) getCurrentArguments()[0];
+ zkMap.put(key, null);
+ handleCrateCollMessage((byte[]) getCurrentArguments()[1]);
+ return key;
+ }
+ }).anyTimes();
+
+ solrZkClientMock.create(anyObject(String.class), anyObject(byte[].class), anyObject(List.class),anyObject(CreateMode.class), anyBoolean());
+ expectLastCall().andAnswer(new IAnswer<String>() {
+ @Override
+ public String answer() throws Throwable {
+ String key = (String) getCurrentArguments()[0];
+ zkMap.put(key, null);
+ handleCrateCollMessage((byte[]) getCurrentArguments()[1]);
+ return key;
+ }
+ }).anyTimes();
+
+ solrZkClientMock.makePath(anyObject(String.class), anyObject(byte[].class), anyBoolean());
+ expectLastCall().andAnswer(new IAnswer<String>() {
+ @Override
+ public String answer() throws Throwable {
+ String key = (String) getCurrentArguments()[0];
+ return key;
+ }
+ }).anyTimes();
+
+ solrZkClientMock.exists(anyObject(String.class),anyBoolean());
+ expectLastCall().andAnswer(new IAnswer<Boolean>() {
+ @Override
+ public Boolean answer() throws Throwable {
+ String key = (String) getCurrentArguments()[0];
+ return zkMap.containsKey(key);
+ }
+ }).anyTimes();
return liveNodes;
}
-
+
+ private void handleCrateCollMessage(byte[] bytes) {
+ try {
+ ZkNodeProps props = ZkNodeProps.load(bytes);
+ if("createcollection".equals(props.getStr("operation"))){
+ String collName = props.getStr("name") ;
+ if(collName != null) collectionsSet.add(collName);
+ }
+ } catch (Exception e) { }
+ }
+
protected void startComponentUnderTest() {
thread = new Thread(underTest);
thread.start();
@@ -408,8 +465,8 @@ public class OverseerCollectionProcessor
protected void waitForEmptyQueue(long maxWait) throws Exception {
long start = System.currentTimeMillis();
while (queue.peek() != null) {
- if ((System.currentTimeMillis() - start) > maxWait) fail("Queue not empty within "
- + maxWait + " ms");
+ if ((System.currentTimeMillis() - start) > maxWait) fail(" Queue not empty within "
+ + maxWait + " ms" + System.currentTimeMillis());
Thread.sleep(100);
}
}
@@ -445,10 +502,12 @@ public class OverseerCollectionProcessor
replay(zkStateReaderMock);
replay(clusterStateMock);
replay(shardHandlerMock);
+
+ log.info("clusterstate " +clusterStateMock.hashCode());
+
startComponentUnderTest();
issueCreateJob(numberOfSlices, replicationFactor, maxShardsPerNode, (createNodeListOption != CreateNodeListOptions.SEND_NULL)?createNodeList:null, (createNodeListOption != CreateNodeListOptions.DONT_SEND));
-
waitForEmptyQueue(10000);
if (collectionExceptedToBeCreated) {