You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by cp...@apache.org on 2016/02/08 18:11:39 UTC

[1/5] lucene-solr git commit: SolrIndexConfig change: legacy solrconfig.xml containing just a element without a element to remain valid-but-deprecated

Repository: lucene-solr
Updated Branches:
  refs/heads/master-solr-8621 42aa575a0 -> 1eb85487f


SolrIndexConfig change: legacy solrconfig.xml containing just a <mergeFactor> element without a <mergePolicy> element to remain valid-but-deprecated


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/7b21aa1c
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/7b21aa1c
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/7b21aa1c

Branch: refs/heads/master-solr-8621
Commit: 7b21aa1c73077622efe4f490ec4b437576776893
Parents: 42aa575
Author: Christine Poerschke <cp...@apache.org>
Authored: Mon Feb 8 16:21:16 2016 +0000
Committer: Christine Poerschke <cp...@apache.org>
Committed: Mon Feb 8 16:21:16 2016 +0000

----------------------------------------------------------------------
 .../org/apache/solr/update/SolrIndexConfig.java  | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7b21aa1c/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java b/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java
index 42a739c..51e9c2a 100644
--- a/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java
+++ b/solr/core/src/java/org/apache/solr/update/SolrIndexConfig.java
@@ -142,13 +142,15 @@ public class SolrIndexConfig implements MapSerializable {
     if (mergePolicyInfo != null && mergePolicyFactoryInfo != null) {
       throw new IllegalArgumentException("<mergePolicy> and <mergePolicyFactory> are mutually exclusive.");
     }
+    if (mergeFactor != -1 && mergePolicyFactoryInfo != null) {
+      throw new IllegalArgumentException("<mergeFactor> and <mergePolicyFactory> are mutually exclusive.");
+    }
+    if (maxMergeDocs != -1 && mergePolicyFactoryInfo != null) {
+      throw new IllegalArgumentException("<maxMergeDocs> and <mergePolicyFactory> are mutually exclusive.");
+    }
 
-    assertWarnOrFail("Beginning with Solr 5.5, <mergePolicy> is deprecated, use <mergePolicyFactory> instead.",
-        (mergePolicyInfo == null), false);
-    assertWarnOrFail("Beginning with Solr 5.5, <maxMergeDocs> is deprecated, configure it on the relevant <mergePolicyFactory> instead.",
-        (mergePolicyFactoryInfo != null && maxMergeDocs == def.maxMergeDocs), false);
-    assertWarnOrFail("Beginning with Solr 5.5, <mergeFactor> is deprecated, configure it on the relevant <mergePolicyFactory> instead.",
-        (mergePolicyFactoryInfo != null && mergeFactor == def.mergeFactor), false);
+    assertWarnOrFail("Beginning with Solr 5.5, <mergePolicy> and <mergeFactor> and <maxMergeDocs> are deprecated, use <mergePolicyFactory> instead.",
+        useMergePolicyInfo(), false);
 
     String val = solrConfig.get(prefix + "/termIndexInterval", null);
     if (val != null) {
@@ -239,13 +241,16 @@ public class SolrIndexConfig implements MapSerializable {
 
   private static final String NO_SUB_PACKAGES[] = new String[0];
 
+  private boolean useMergePolicyInfo() {
+    return (mergePolicyInfo != null || maxMergeDocs != -1 || mergeFactor != -1);
+  }
   /**
    * Builds a MergePolicy using the configured MergePolicyFactory
    * or if no factory is configured uses the configured mergePolicy PluginInfo.
    */
   @SuppressWarnings("unchecked")
   private MergePolicy buildMergePolicy(final IndexSchema schema) {
-    if (mergePolicyInfo != null) {
+    if (useMergePolicyInfo()) {
       return buildMergePolicyFromInfo(schema);
     }
 


[3/5] lucene-solr git commit: temporarily change solrconfig.snippet.randomindexconfig.xml back to using RandomMergePolicy (instead of RandomMergePolicyFactory)

Posted by cp...@apache.org.
temporarily change solrconfig.snippet.randomindexconfig.xml back to using RandomMergePolicy (instead of RandomMergePolicyFactory)


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/18986122
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/18986122
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/18986122

Branch: refs/heads/master-solr-8621
Commit: 189861221e9638f010b1369bd958ae2627cb11ee
Parents: 83ffada
Author: Christine Poerschke <cp...@apache.org>
Authored: Mon Feb 8 16:32:50 2016 +0000
Committer: Christine Poerschke <cp...@apache.org>
Committed: Mon Feb 8 16:32:50 2016 +0000

----------------------------------------------------------------------
 .../solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/18986122/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml
index a23bf0a..069ccb8 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml
@@ -26,7 +26,7 @@ A solrconfig.xml snippet containing indexConfig settings for randomized testing.
        the RandomMergePolicy in all tests - but some tests expect very specific
        Merge behavior, so those tests can set it as needed.
   -->
-  <mergePolicyFactory class="org.apache.solr.util.RandomMergePolicyFactory" />
+  <mergePolicy class="${solr.tests.mergePolicy:org.apache.solr.util.RandomMergePolicy}" />
   
   <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
 


[5/5] lucene-solr git commit: * test-files changes:

Posted by cp...@apache.org.
* test-files changes:

** added bad-mpf-solrconfig.xml as MergePolicyFactory equivalent of bad-mp-solrconfig.xml

** added solrconfig-logmergepolicyfactory.xml as MergePolicyFactory equivalent of solrconfig-logmergepolicy.xml

** added solrconfig-mergepolicyfactory-nocfs.xml as MergePolicyFactory equivalent of solrconfig-mergepolicy-nocfs.xml

** renamed solrconfig-indexconfig.xml to solrconfig-indexconfig-mergepolicy.xml and added solrconfig-indexconfig-mergepolicyfactory.xml as MergePolicyFactory equivalent

** renamed solrconfig-warmer.xml to solrconfig-warmer-randommergepolicy.xml and added solrconfig-warmer-randommergepolicyfactory.xml as MergePolicyFactory equivalent

* test code changes

** DummyMergePolicyFactory added (as equivalent to DummyMergePolicy)

** changes to: TestBadConfig.java TestMergePolicyConfig.java TestSolrIndexConfig.java SolrIndexConfigTest.java

* why the solrconfig-something-mergepolicy.xml and solrconfig-something-mergepolicyfactory.xml pairs?

** whilst <mergePolicy> elements are deprecated but still supported this provides test coverage for both mergePolicy and mergePolicyFactory support
** when <mergePolicy> element support is removed any solrconfig-*-mergepolicy.xml elements will simply go away as well


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/1eb85487
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/1eb85487
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/1eb85487

Branch: refs/heads/master-solr-8621
Commit: 1eb85487f5d28bf2a2aa4b2c82014b0dbdae31a4
Parents: 28d0793
Author: Christine Poerschke <cp...@apache.org>
Authored: Mon Feb 8 17:04:47 2016 +0000
Committer: Christine Poerschke <cp...@apache.org>
Committed: Mon Feb 8 17:04:47 2016 +0000

----------------------------------------------------------------------
 .../collection1/conf/bad-mpf-solrconfig.xml     | 37 ++++++++++++++++
 .../conf/solrconfig-indexconfig-mergepolicy.xml | 31 +++++++++++++
 ...olrconfig-indexconfig-mergepolicyfactory.xml | 31 +++++++++++++
 .../collection1/conf/solrconfig-indexconfig.xml | 31 -------------
 .../conf/solrconfig-logmergepolicyfactory.xml   | 37 ++++++++++++++++
 .../solrconfig-mergepolicyfactory-nocfs.xml     | 34 +++++++++++++++
 .../solrconfig-warmer-randommergepolicy.xml     | 46 ++++++++++++++++++++
 ...lrconfig-warmer-randommergepolicyfactory.xml | 46 ++++++++++++++++++++
 .../solr/collection1/conf/solrconfig-warmer.xml | 46 --------------------
 .../org/apache/solr/core/TestBadConfig.java     |  3 ++
 .../apache/solr/core/TestMergePolicyConfig.java | 37 +++++++++++++++-
 .../apache/solr/core/TestSolrIndexConfig.java   |  4 +-
 .../solr/index/DummyMergePolicyFactory.java     | 32 ++++++++++++++
 .../apache/solr/update/SolrIndexConfigTest.java | 21 ++++++---
 14 files changed, 348 insertions(+), 88 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1eb85487/solr/core/src/test-files/solr/collection1/conf/bad-mpf-solrconfig.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/bad-mpf-solrconfig.xml b/solr/core/src/test-files/solr/collection1/conf/bad-mpf-solrconfig.xml
new file mode 100644
index 0000000..0adf321
--- /dev/null
+++ b/solr/core/src/test-files/solr/collection1/conf/bad-mpf-solrconfig.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" ?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<config>
+
+  <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
+
+  <luceneMatchVersion>${tests.luceneMatchVersion:LATEST}</luceneMatchVersion>
+
+  <indexConfig>
+    <mergePolicyFactory class="org.apache.solr.update.DummyMergePolicyFactory">
+      <int name="mergeFactor">8</int>
+    </mergePolicyFactory>
+  </indexConfig>
+
+  <updateHandler class="solr.DirectUpdateHandler2"/>
+  <requestHandler name="standard" class="solr.StandardRequestHandler"></requestHandler>
+
+  <schemaFactory class="ClassicIndexSchemaFactory"/>
+
+</config>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1eb85487/solr/core/src/test-files/solr/collection1/conf/solrconfig-indexconfig-mergepolicy.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-indexconfig-mergepolicy.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-indexconfig-mergepolicy.xml
new file mode 100644
index 0000000..52fb28e
--- /dev/null
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-indexconfig-mergepolicy.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" ?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<config>
+  <dataDir>${solr.data.dir:}</dataDir>
+
+  <luceneMatchVersion>${tests.luceneMatchVersion:LATEST}</luceneMatchVersion>
+
+  <indexConfig>
+    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
+    <infoStream>true</infoStream>
+    <mergePolicy class="org.apache.solr.util.RandomMergePolicy" />
+  </indexConfig>
+
+  <schemaFactory class="ClassicIndexSchemaFactory"/>
+</config>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1eb85487/solr/core/src/test-files/solr/collection1/conf/solrconfig-indexconfig-mergepolicyfactory.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-indexconfig-mergepolicyfactory.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-indexconfig-mergepolicyfactory.xml
new file mode 100644
index 0000000..efdd7ff
--- /dev/null
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-indexconfig-mergepolicyfactory.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" ?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<config>
+  <dataDir>${solr.data.dir:}</dataDir>
+
+  <luceneMatchVersion>${tests.luceneMatchVersion:LATEST}</luceneMatchVersion>
+
+  <indexConfig>
+    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
+    <infoStream>true</infoStream>
+    <mergePolicyFactory class="org.apache.solr.util.RandomMergePolicyFactory" />
+  </indexConfig>
+
+  <schemaFactory class="ClassicIndexSchemaFactory"/>
+</config>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1eb85487/solr/core/src/test-files/solr/collection1/conf/solrconfig-indexconfig.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-indexconfig.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-indexconfig.xml
deleted file mode 100644
index 52fb28e..0000000
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-indexconfig.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" ?>
-
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<config>
-  <dataDir>${solr.data.dir:}</dataDir>
-
-  <luceneMatchVersion>${tests.luceneMatchVersion:LATEST}</luceneMatchVersion>
-
-  <indexConfig>
-    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
-    <infoStream>true</infoStream>
-    <mergePolicy class="org.apache.solr.util.RandomMergePolicy" />
-  </indexConfig>
-
-  <schemaFactory class="ClassicIndexSchemaFactory"/>
-</config>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1eb85487/solr/core/src/test-files/solr/collection1/conf/solrconfig-logmergepolicyfactory.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-logmergepolicyfactory.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-logmergepolicyfactory.xml
new file mode 100644
index 0000000..27a1867
--- /dev/null
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-logmergepolicyfactory.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" ?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<config>
+  <luceneMatchVersion>${tests.luceneMatchVersion:LATEST}</luceneMatchVersion>
+  <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
+  <schemaFactory class="ClassicIndexSchemaFactory"/>
+  <indexConfig>
+    <!-- set some values to -1 to force the use of internal lucene defaults -->
+    <maxBufferedDocs>-1</maxBufferedDocs>
+    <ramBufferSizeMB>-1</ramBufferSizeMB>
+
+    <mergePolicyFactory class="${solr.test.log.merge.policy.factory}">
+      <int name="mergeFactor">11</int>
+      <int name="maxMergeDocs">456</int>
+    </mergePolicyFactory>
+  </indexConfig>
+
+  <requestHandler name="standard" class="solr.StandardRequestHandler"></requestHandler>
+
+</config>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1eb85487/solr/core/src/test-files/solr/collection1/conf/solrconfig-mergepolicyfactory-nocfs.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-mergepolicyfactory-nocfs.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-mergepolicyfactory-nocfs.xml
new file mode 100644
index 0000000..4dd82d7
--- /dev/null
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-mergepolicyfactory-nocfs.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" ?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<config>
+  <luceneMatchVersion>${tests.luceneMatchVersion:LATEST}</luceneMatchVersion>
+  <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
+  <schemaFactory class="ClassicIndexSchemaFactory"/>
+
+  <indexConfig>
+    <useCompoundFile>${testSetNoCFSMergePolicyConfig.useCompoundFile:false}</useCompoundFile>
+    <mergePolicyFactory class="org.apache.solr.index.TieredMergePolicyFactory">
+      <double name="noCFSRatio">0.5</double>
+    </mergePolicyFactory>
+  </indexConfig>
+
+  <requestHandler name="standard" class="solr.StandardRequestHandler"></requestHandler>
+
+</config>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1eb85487/solr/core/src/test-files/solr/collection1/conf/solrconfig-warmer-randommergepolicy.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-warmer-randommergepolicy.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-warmer-randommergepolicy.xml
new file mode 100644
index 0000000..691c94b
--- /dev/null
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-warmer-randommergepolicy.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" ?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- a basic solrconfig that tests can use when they want simple minimal solrconfig/schema
+     DO NOT ADD THINGS TO THIS CONFIG! -->
+<config>
+  <luceneMatchVersion>${tests.luceneMatchVersion:LATEST}</luceneMatchVersion>
+  <dataDir>${solr.data.dir:}</dataDir>
+  <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
+  <schemaFactory class="ClassicIndexSchemaFactory"/>
+  <requestHandler name="standard" class="solr.StandardRequestHandler"></requestHandler>
+  
+  <indexConfig>
+    <!-- we don't use solrconfig.snippet.randomindexconfig.xml here
+         because we explicitly test that a mergedSegmentWarmer works, 
+         but we can still test some of the other randomized indexConfig 
+         settings
+    -->
+    <mergedSegmentWarmer class="org.apache.lucene.index.SimpleMergedSegmentWarmer"/>
+    <mergePolicy class="org.apache.solr.util.RandomMergePolicy" />
+  
+    <useCompoundFile>${useCompoundFile}</useCompoundFile>
+    <maxBufferedDocs>${solr.tests.maxBufferedDocs}</maxBufferedDocs>
+    <ramBufferSizeMB>${solr.tests.ramBufferSizeMB}</ramBufferSizeMB>
+    <mergeScheduler class="${solr.tests.mergeScheduler}" />
+    <writeLockTimeout>1000</writeLockTimeout>
+    <commitLockTimeout>10000</commitLockTimeout>
+    <lockType>single</lockType>
+  </indexConfig>
+</config>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1eb85487/solr/core/src/test-files/solr/collection1/conf/solrconfig-warmer-randommergepolicyfactory.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-warmer-randommergepolicyfactory.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-warmer-randommergepolicyfactory.xml
new file mode 100644
index 0000000..1e1936b
--- /dev/null
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-warmer-randommergepolicyfactory.xml
@@ -0,0 +1,46 @@
+<?xml version="1.0" ?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<!-- a basic solrconfig that tests can use when they want simple minimal solrconfig/schema
+     DO NOT ADD THINGS TO THIS CONFIG! -->
+<config>
+  <luceneMatchVersion>${tests.luceneMatchVersion:LATEST}</luceneMatchVersion>
+  <dataDir>${solr.data.dir:}</dataDir>
+  <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
+  <schemaFactory class="ClassicIndexSchemaFactory"/>
+  <requestHandler name="standard" class="solr.StandardRequestHandler"></requestHandler>
+  
+  <indexConfig>
+    <!-- we don't use solrconfig.snippet.randomindexconfig.xml here
+         because we explicitly test that a mergedSegmentWarmer works, 
+         but we can still test some of the other randomized indexConfig 
+         settings
+    -->
+    <mergedSegmentWarmer class="org.apache.lucene.index.SimpleMergedSegmentWarmer"/>
+    <mergePolicyFactory class="org.apache.solr.util.RandomMergePolicyFactory" />
+  
+    <useCompoundFile>${useCompoundFile}</useCompoundFile>
+    <maxBufferedDocs>${solr.tests.maxBufferedDocs}</maxBufferedDocs>
+    <ramBufferSizeMB>${solr.tests.ramBufferSizeMB}</ramBufferSizeMB>
+    <mergeScheduler class="${solr.tests.mergeScheduler}" />
+    <writeLockTimeout>1000</writeLockTimeout>
+    <commitLockTimeout>10000</commitLockTimeout>
+    <lockType>single</lockType>
+  </indexConfig>
+</config>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1eb85487/solr/core/src/test-files/solr/collection1/conf/solrconfig-warmer.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-warmer.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-warmer.xml
deleted file mode 100644
index 691c94b..0000000
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-warmer.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" ?>
-
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements.  See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License.  You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<!-- a basic solrconfig that tests can use when they want simple minimal solrconfig/schema
-     DO NOT ADD THINGS TO THIS CONFIG! -->
-<config>
-  <luceneMatchVersion>${tests.luceneMatchVersion:LATEST}</luceneMatchVersion>
-  <dataDir>${solr.data.dir:}</dataDir>
-  <directoryFactory name="DirectoryFactory" class="${solr.directoryFactory:solr.RAMDirectoryFactory}"/>
-  <schemaFactory class="ClassicIndexSchemaFactory"/>
-  <requestHandler name="standard" class="solr.StandardRequestHandler"></requestHandler>
-  
-  <indexConfig>
-    <!-- we don't use solrconfig.snippet.randomindexconfig.xml here
-         because we explicitly test that a mergedSegmentWarmer works, 
-         but we can still test some of the other randomized indexConfig 
-         settings
-    -->
-    <mergedSegmentWarmer class="org.apache.lucene.index.SimpleMergedSegmentWarmer"/>
-    <mergePolicy class="org.apache.solr.util.RandomMergePolicy" />
-  
-    <useCompoundFile>${useCompoundFile}</useCompoundFile>
-    <maxBufferedDocs>${solr.tests.maxBufferedDocs}</maxBufferedDocs>
-    <ramBufferSizeMB>${solr.tests.ramBufferSizeMB}</ramBufferSizeMB>
-    <mergeScheduler class="${solr.tests.mergeScheduler}" />
-    <writeLockTimeout>1000</writeLockTimeout>
-    <commitLockTimeout>10000</commitLockTimeout>
-    <lockType>single</lockType>
-  </indexConfig>
-</config>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1eb85487/solr/core/src/test/org/apache/solr/core/TestBadConfig.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/TestBadConfig.java b/solr/core/src/test/org/apache/solr/core/TestBadConfig.java
index 07d2e69..d436bc4 100644
--- a/solr/core/src/test/org/apache/solr/core/TestBadConfig.java
+++ b/solr/core/src/test/org/apache/solr/core/TestBadConfig.java
@@ -20,6 +20,7 @@ package org.apache.solr.core;
 import javax.script.ScriptEngineManager;
 
 import org.junit.Assume;
+import org.junit.Test;
 
 public class TestBadConfig extends AbstractBadConfigTestBase {
 
@@ -79,6 +80,8 @@ public class TestBadConfig extends AbstractBadConfigTestBase {
   public void testBogusMergePolicy() throws Exception {
     assertConfigs("bad-mp-solrconfig.xml", "schema-minimal.xml",
                   "DummyMergePolicy");
+    assertConfigs("bad-mpf-solrconfig.xml", "schema-minimal.xml",
+                  "DummyMergePolicyFactory");
   }
 
   public void testSchemaMutableButNotManaged() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1eb85487/solr/core/src/test/org/apache/solr/core/TestMergePolicyConfig.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/TestMergePolicyConfig.java b/solr/core/src/test/org/apache/solr/core/TestMergePolicyConfig.java
index 7ab1e9f..4ecbab4 100644
--- a/solr/core/src/test/org/apache/solr/core/TestMergePolicyConfig.java
+++ b/solr/core/src/test/org/apache/solr/core/TestMergePolicyConfig.java
@@ -28,10 +28,14 @@ import org.apache.lucene.index.LogMergePolicy;
 import org.apache.lucene.index.SegmentReader;
 import org.apache.lucene.index.TieredMergePolicy;
 import org.apache.solr.SolrTestCaseJ4;
+import org.apache.solr.index.LogByteSizeMergePolicyFactory;
+import org.apache.solr.index.LogDocMergePolicyFactory;
+import org.apache.solr.index.MergePolicyFactory;
 import org.apache.solr.search.SolrIndexSearcher;
 import org.apache.solr.update.SolrIndexConfigTest;
 import org.apache.solr.util.RefCounted;
 import org.junit.After;
+import org.junit.Test;
 
 /** @see SolrIndexConfigTest */
 public class TestMergePolicyConfig extends SolrTestCaseJ4 {
@@ -47,7 +51,7 @@ public class TestMergePolicyConfig extends SolrTestCaseJ4 {
     final boolean useCompoundFile = random().nextBoolean();
     System.setProperty("testSetNoCFSMergePolicyConfig.useCompoundFile", String.valueOf(useCompoundFile));
     try {
-      initCore("solrconfig-mergepolicy-nocfs.xml","schema-minimal.xml");
+      initCore(random().nextBoolean() ? "solrconfig-mergepolicy-nocfs.xml" : "solrconfig-mergepolicyfactory-nocfs.xml","schema-minimal.xml");
       IndexWriterConfig iwc = solrConfig.indexConfig.toIndexWriterConfig(h.getCore());
       assertEquals(useCompoundFile, iwc.getUseCompoundFile());
 
@@ -95,7 +99,7 @@ public class TestMergePolicyConfig extends SolrTestCaseJ4 {
     final boolean expectCFS 
       = Boolean.parseBoolean(System.getProperty("useCompoundFile"));
 
-    initCore("solrconfig-tieredmergepolicy.xml","schema-minimal.xml");
+    initCore(random().nextBoolean() ? "solrconfig-tieredmergepolicy.xml" : "solrconfig-tieredmergepolicyfactory.xml","schema-minimal.xml");
     IndexWriterConfig iwc = solrConfig.indexConfig.toIndexWriterConfig(h.getCore());
     assertEquals(expectCFS, iwc.getUseCompoundFile());
 
@@ -157,6 +161,35 @@ public class TestMergePolicyConfig extends SolrTestCaseJ4 {
 
   }
 
+  public void testLogMergePolicyFactoryConfig() throws Exception {
+
+    final boolean byteSizeMP = random().nextBoolean();
+    final Class<? extends LogMergePolicy> mpClass = byteSizeMP
+        ? LogByteSizeMergePolicy.class : LogDocMergePolicy.class;
+    final Class<? extends MergePolicyFactory> mpfClass = byteSizeMP
+        ? LogByteSizeMergePolicyFactory.class : LogDocMergePolicyFactory.class;
+
+    System.setProperty("solr.test.log.merge.policy.factory", mpfClass.getName());
+
+    initCore("solrconfig-logmergepolicyfactory.xml","schema-minimal.xml");
+    IndexWriterConfig iwc = solrConfig.indexConfig.toIndexWriterConfig(h.getCore());
+
+    // verify some props set to -1 get lucene internal defaults
+    assertEquals(-1, solrConfig.indexConfig.maxBufferedDocs);
+    assertEquals(IndexWriterConfig.DISABLE_AUTO_FLUSH,
+                 iwc.getMaxBufferedDocs());
+    assertEquals(-1, solrConfig.indexConfig.ramBufferSizeMB, 0.0D);
+    assertEquals(IndexWriterConfig.DEFAULT_RAM_BUFFER_SIZE_MB,
+                 iwc.getRAMBufferSizeMB(), 0.0D);
+
+
+    LogMergePolicy logMP = assertAndCast(mpClass, iwc.getMergePolicy());
+
+    assertEquals(11, logMP.getMergeFactor());
+    assertEquals(456, logMP.getMaxMergeDocs());
+
+  }
+
   /**
    * Given a Type and an object asserts that the object is non-null and an 
    * instance of the specified Type.  The object is then cast to that type and 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1eb85487/solr/core/src/test/org/apache/solr/core/TestSolrIndexConfig.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/core/TestSolrIndexConfig.java b/solr/core/src/test/org/apache/solr/core/TestSolrIndexConfig.java
index 0d2613f..cd78f01 100644
--- a/solr/core/src/test/org/apache/solr/core/TestSolrIndexConfig.java
+++ b/solr/core/src/test/org/apache/solr/core/TestSolrIndexConfig.java
@@ -20,7 +20,6 @@ package org.apache.solr.core;
 import org.apache.lucene.index.IndexWriter;
 import org.apache.lucene.index.IndexWriterConfig;
 import org.apache.lucene.index.LiveIndexWriterConfig;
-
 import org.apache.solr.SolrTestCaseJ4;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.util.RefCounted;
@@ -32,7 +31,8 @@ public class TestSolrIndexConfig extends SolrTestCaseJ4 {
 
   @BeforeClass
   public static void beforeClass() throws Exception {
-    initCore("solrconfig-indexconfig.xml","schema.xml");
+    final String solrConfigFileName = random().nextBoolean() ? "solrconfig-indexconfig-mergepolicy.xml" : "solrconfig-indexconfig-mergepolicyfactory.xml";
+    initCore(solrConfigFileName,"schema.xml");
   }
 
   public void testLiveWriter() throws Exception {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1eb85487/solr/core/src/test/org/apache/solr/index/DummyMergePolicyFactory.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/index/DummyMergePolicyFactory.java b/solr/core/src/test/org/apache/solr/index/DummyMergePolicyFactory.java
new file mode 100644
index 0000000..e8b3d43
--- /dev/null
+++ b/solr/core/src/test/org/apache/solr/index/DummyMergePolicyFactory.java
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.solr.index;
+
+import org.apache.solr.core.SolrResourceLoader;
+
+/**
+ * Dummy implementation of {@link org.apache.solr.index.MergePolicyFactory}
+ * which doesn't have a suitable public constructor and thus is expected to
+ * fail if used within Solr.
+ */
+class DummyMergePolicyFactory extends LogByteSizeMergePolicyFactory {
+
+  private DummyMergePolicyFactory(SolrResourceLoader resourceLoader, MergePolicyFactoryArgs args) {
+    super(resourceLoader, args);
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1eb85487/solr/core/src/test/org/apache/solr/update/SolrIndexConfigTest.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/update/SolrIndexConfigTest.java b/solr/core/src/test/org/apache/solr/update/SolrIndexConfigTest.java
index 1d144cb..ed1a445 100644
--- a/solr/core/src/test/org/apache/solr/update/SolrIndexConfigTest.java
+++ b/solr/core/src/test/org/apache/solr/update/SolrIndexConfigTest.java
@@ -41,7 +41,8 @@ import org.junit.Test;
 public class SolrIndexConfigTest extends SolrTestCaseJ4 {
 
   private static final String solrConfigFileName = "solrconfig.xml";
-  private static final String solrConfigFileNameWarmer = "solrconfig-warmer.xml";
+  private static final String solrConfigFileNameWarmerRandomMergePolicy = "solrconfig-warmer-randommergepolicy.xml";
+  private static final String solrConfigFileNameWarmerRandomMergePolicyFactory = "solrconfig-warmer-randommergepolicyfactory.xml";
   private static final String solrConfigFileNameTieredMergePolicy = "solrconfig-tieredmergepolicy.xml";
   private static final String solrConfigFileNameTieredMergePolicyFactory = "solrconfig-tieredmergepolicyfactory.xml";
   private static final String schemaFileName = "schema.xml";
@@ -56,7 +57,8 @@ public class SolrIndexConfigTest extends SolrTestCaseJ4 {
   @Test
   public void testFailingSolrIndexConfigCreation() {
     try {
-      SolrConfig solrConfig = new SolrConfig("bad-mp-solrconfig.xml");
+      String solrConfigFileName = random().nextBoolean() ? "bad-mp-solrconfig.xml" : "bad-mpf-solrconfig.xml";
+      SolrConfig solrConfig = new SolrConfig(solrConfigFileName);
       SolrIndexConfig solrIndexConfig = new SolrIndexConfig(solrConfig, null, null);
       IndexSchema indexSchema = IndexSchemaFactory.buildIndexSchema(schemaFileName, solrConfig);
       h.getCore().setLatestSchema(indexSchema);
@@ -92,7 +94,8 @@ public class SolrIndexConfigTest extends SolrTestCaseJ4 {
   }
 
   public void testMergedSegmentWarmerIndexConfigCreation() throws Exception {
-    SolrConfig solrConfig = new SolrConfig(instanceDir, solrConfigFileNameWarmer, null);
+    String solrConfigFileName = random().nextBoolean() ? solrConfigFileNameWarmerRandomMergePolicy : solrConfigFileNameWarmerRandomMergePolicyFactory;
+    SolrConfig solrConfig = new SolrConfig(instanceDir, solrConfigFileName, null);
     SolrIndexConfig solrIndexConfig = new SolrIndexConfig(solrConfig, null, null);
     assertNotNull(solrIndexConfig);
     assertNotNull(solrIndexConfig.mergedSegmentWarmerInfo);
@@ -105,17 +108,20 @@ public class SolrIndexConfigTest extends SolrTestCaseJ4 {
   }
 
   public void testToMap() throws Exception {
+    final String solrConfigFileNameRMP = random().nextBoolean() ? solrConfigFileNameWarmerRandomMergePolicy : solrConfigFileNameWarmerRandomMergePolicyFactory;
     final String solrConfigFileNameTMP = random().nextBoolean() ? solrConfigFileNameTieredMergePolicy : solrConfigFileNameTieredMergePolicyFactory;
-    final String solrConfigFileName = (random().nextBoolean() ? solrConfigFileNameWarmer : solrConfigFileNameTMP);
+    final String solrConfigFileName = (random().nextBoolean() ? solrConfigFileNameRMP : solrConfigFileNameTMP);
     SolrConfig solrConfig = new SolrConfig(instanceDir, solrConfigFileName, null);
     SolrIndexConfig solrIndexConfig = new SolrIndexConfig(solrConfig, null, null);
     assertNotNull(solrIndexConfig);
-    if (solrConfigFileName.equals(solrConfigFileNameTieredMergePolicyFactory)) {
+    if (solrConfigFileName.equals(solrConfigFileNameTieredMergePolicyFactory) ||
+        solrConfigFileName.equals(solrConfigFileNameWarmerRandomMergePolicyFactory)) {
       assertNotNull(solrIndexConfig.mergePolicyFactoryInfo);
     } else {
       assertNotNull(solrIndexConfig.mergePolicyInfo);
     }
-    if (solrConfigFileName.equals(solrConfigFileNameWarmer)) {
+    if (solrConfigFileName.equals(solrConfigFileNameWarmerRandomMergePolicy) ||
+        solrConfigFileName.equals(solrConfigFileNameWarmerRandomMergePolicyFactory)) {
       assertNotNull(solrIndexConfig.mergedSegmentWarmerInfo);
     } else {
       assertNull(solrIndexConfig.mergedSegmentWarmerInfo);
@@ -152,7 +158,8 @@ public class SolrIndexConfigTest extends SolrTestCaseJ4 {
     
     ++mSizeExpected; assertTrue(m.get("mergeScheduler") instanceof Map);
     ++mSizeExpected; assertTrue(m.get("mergePolicy") instanceof Map);
-    if (solrConfigFileName.equals(solrConfigFileNameWarmer)) {
+    if (solrConfigFileName.equals(solrConfigFileNameWarmerRandomMergePolicy) ||
+        solrConfigFileName.equals(solrConfigFileNameWarmerRandomMergePolicyFactory)) {
       ++mSizeExpected; assertTrue(m.get("mergedSegmentWarmer") instanceof Map);
     } else {
       assertNull(m.get("mergedSegmentWarmer"));


[2/5] lucene-solr git commit: solrconfig-tieredmergepolicyfactory.xml based on test case failure (it now is equivalent to solrconfig-tieredmergepolicy.xml)

Posted by cp...@apache.org.
solrconfig-tieredmergepolicyfactory.xml based on test case failure (it now is equivalent to solrconfig-tieredmergepolicy.xml)


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/83ffada8
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/83ffada8
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/83ffada8

Branch: refs/heads/master-solr-8621
Commit: 83ffada893d7343c1933409082ac961e2f0ef2b0
Parents: 7b21aa1
Author: Christine Poerschke <cp...@apache.org>
Authored: Mon Feb 8 16:28:34 2016 +0000
Committer: Christine Poerschke <cp...@apache.org>
Committed: Mon Feb 8 16:28:34 2016 +0000

----------------------------------------------------------------------
 .../solr/collection1/conf/solrconfig-tieredmergepolicyfactory.xml  | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/83ffada8/solr/core/src/test-files/solr/collection1/conf/solrconfig-tieredmergepolicyfactory.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-tieredmergepolicyfactory.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-tieredmergepolicyfactory.xml
index ebf360d..af5d208 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-tieredmergepolicyfactory.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-tieredmergepolicyfactory.xml
@@ -23,8 +23,10 @@
   <schemaFactory class="ClassicIndexSchemaFactory"/>
 
   <indexConfig>
+    <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
     <mergePolicyFactory class="org.apache.solr.index.TieredMergePolicyFactory">
       <int name="maxMergeAtOnceExplicit">19</int>
+      <int name="maxMergeAtOnce">7</int>
       <int name="segmentsPerTier">9</int>
       <double name="noCFSRatio">0.1</double>
     </mergePolicyFactory>


[4/5] lucene-solr git commit: factor out a solrconfig.snippet.randommergepolicy.xml (next: change solrconfig.snippet.randommergepolicy.xml to use RandomMergePolicyFactory instead of RandomMergePolicy and change tests using solr.tests.mergePolicy to use s

Posted by cp...@apache.org.
factor out a solrconfig.snippet.randommergepolicy.xml (next: change solrconfig.snippet.randommergepolicy.xml to use RandomMergePolicyFactory instead of RandomMergePolicy and change tests using solr.tests.mergePolicy to use solr.tests.mergePolicyFactory instead)


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/28d07935
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/28d07935
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/28d07935

Branch: refs/heads/master-solr-8621
Commit: 28d07935bca0227adeb3001982c9028ac33cce50
Parents: 1898612
Author: Christine Poerschke <cp...@apache.org>
Authored: Mon Feb 8 16:42:13 2016 +0000
Committer: Christine Poerschke <cp...@apache.org>
Committed: Mon Feb 8 16:42:13 2016 +0000

----------------------------------------------------------------------
 .../collection1/conf/solrconfig-delpolicy1.xml  |  2 +-
 .../collection1/conf/solrconfig-delpolicy2.xml  |  2 +-
 .../conf/solrconfig-spellcheckcomponent.xml     |  2 +-
 .../solrconfig.snippet.randomindexconfig.xml    |  2 +-
 .../solrconfig.snippet.randommergepolicy.xml    | 28 ++++++++++++++++++++
 5 files changed, 32 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/28d07935/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy1.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy1.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy1.xml
index 250fc06..798b895 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy1.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy1.xml
@@ -30,7 +30,7 @@
          to configure an explicit deletion policy, but we still wnat to randomize as much 
          as possible. 
     -->
-    <mergePolicy class="${solr.tests.mergePolicy:org.apache.solr.util.RandomMergePolicy}" />
+    <xi:include href="solrconfig.snippet.randommergepolicy.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
     <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
 
     <maxBufferedDocs>${solr.tests.maxBufferedDocs}</maxBufferedDocs>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/28d07935/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy2.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy2.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy2.xml
index 61391fd..4ef7e82 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy2.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-delpolicy2.xml
@@ -27,7 +27,7 @@
          to configure an explicit deletion policy, but we still wnat to randomize as much 
          as possible. 
     -->
-    <mergePolicy class="${solr.tests.mergePolicy:org.apache.solr.util.RandomMergePolicy}" />
+    <xi:include href="solrconfig.snippet.randommergepolicy.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
     <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
 
     <maxBufferedDocs>${solr.tests.maxBufferedDocs}</maxBufferedDocs>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/28d07935/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml
index faa886b..82fac89 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig-spellcheckcomponent.xml
@@ -20,7 +20,7 @@
 <config>
   <luceneMatchVersion>${tests.luceneMatchVersion:LATEST}</luceneMatchVersion>
   <indexConfig>
-    <mergePolicy class="${solr.tests.mergePolicy:org.apache.solr.util.RandomMergePolicy}" />  
+    <xi:include href="solrconfig.snippet.randommergepolicy.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
     <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
     <maxBufferedDocs>${solr.tests.maxBufferedDocs}</maxBufferedDocs>
     <ramBufferSizeMB>${solr.tests.ramBufferSizeMB}</ramBufferSizeMB>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/28d07935/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml
index 069ccb8..b40a333 100644
--- a/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randomindexconfig.xml
@@ -26,7 +26,7 @@ A solrconfig.xml snippet containing indexConfig settings for randomized testing.
        the RandomMergePolicy in all tests - but some tests expect very specific
        Merge behavior, so those tests can set it as needed.
   -->
-  <mergePolicy class="${solr.tests.mergePolicy:org.apache.solr.util.RandomMergePolicy}" />
+  <xi:include href="solrconfig.snippet.randommergepolicy.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
   
   <useCompoundFile>${useCompoundFile:false}</useCompoundFile>
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/28d07935/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randommergepolicy.xml
----------------------------------------------------------------------
diff --git a/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randommergepolicy.xml b/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randommergepolicy.xml
new file mode 100644
index 0000000..41ad1aa
--- /dev/null
+++ b/solr/core/src/test-files/solr/collection1/conf/solrconfig.snippet.randommergepolicy.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" ?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!-- 
+
+A solrconfig.xml snippet containing mergePolicy settings for randomized testing.
+
+-->
+  <!-- this sys property is not set by SolrTestCaseJ4 because we ideally want to use
+       the RandomMergePolicy in all tests - but some tests expect very specific
+       Merge behavior, so those tests can set it as needed.
+  -->
+  <mergePolicy class="${solr.tests.mergePolicy:org.apache.solr.util.RandomMergePolicy}" />