You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2015/01/22 15:21:54 UTC
svn commit: r1653871 - in /lucene/dev/branches/branch_5x: ./ solr/
solr/core/ solr/core/src/java/org/apache/solr/handler/admin/
solr/core/src/test/org/apache/solr/cloud/ solr/test-framework/
solr/test-framework/src/java/org/apache/solr/cloud/
Author: noble
Date: Thu Jan 22 14:21:53 2015
New Revision: 1653871
URL: http://svn.apache.org/r1653871
Log:
SOLR-6988 Make stateformat=2 as default
Modified:
lucene/dev/branches/branch_5x/ (props changed)
lucene/dev/branches/branch_5x/solr/ (props changed)
lucene/dev/branches/branch_5x/solr/core/ (props changed)
lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java
lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/ExternalCollectionsTest.java
lucene/dev/branches/branch_5x/solr/test-framework/ (props changed)
lucene/dev/branches/branch_5x/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java
Modified: lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java?rev=1653871&r1=1653870&r2=1653871&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java Thu Jan 22 14:21:53 2015
@@ -853,6 +853,9 @@ public class CollectionsHandler extends
DocCollection.STATE_FORMAT,
AUTO_ADD_REPLICAS,
"router.");
+ if(props.get(DocCollection.STATE_FORMAT) == null){
+ props.put(DocCollection.STATE_FORMAT,"2");
+ }
if(SYSTEM_COLL.equals(name)){
//We must always create asystem collection with only a single shard
Modified: lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/ExternalCollectionsTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/ExternalCollectionsTest.java?rev=1653871&r1=1653870&r2=1653871&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/ExternalCollectionsTest.java (original)
+++ lucene/dev/branches/branch_5x/solr/core/src/test/org/apache/solr/cloud/ExternalCollectionsTest.java Thu Jan 22 14:21:53 2015
@@ -77,8 +77,8 @@ public class ExternalCollectionsTest ext
@Override
- protected int getStateFormat() {
- return 2;
+ protected String getStateFormat() {
+ return "2";
}
private void testConfNameAndCollectionNameSame() throws Exception{
Modified: lucene/dev/branches/branch_5x/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java?rev=1653871&r1=1653870&r2=1653871&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java (original)
+++ lucene/dev/branches/branch_5x/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java Thu Jan 22 14:21:53 2015
@@ -353,16 +353,12 @@ public abstract class AbstractFullDistri
return createJettys(numJettys, false);
}
- protected int defaultStateFormat = 1 + random().nextInt(2);
+ protected String defaultStateFormat = String.valueOf( 1 + random().nextInt(2));
- protected int getStateFormat() {
+ protected String getStateFormat() {
String stateFormat = System.getProperty("tests.solr.stateFormat", null);
if (stateFormat != null) {
- if ("2".equals(stateFormat)) {
- return defaultStateFormat = 2;
- } else if ("1".equals(stateFormat)) {
- return defaultStateFormat = 1;
- }
+ defaultStateFormat = stateFormat;
}
return defaultStateFormat; // random
}
@@ -378,7 +374,7 @@ public abstract class AbstractFullDistri
List<SolrClient> clients = new ArrayList<>();
StringBuilder sb = new StringBuilder();
- if (getStateFormat() == 2) {
+ if ("2".equals(getStateFormat())) {
log.info("Creating collection1 with stateFormat=2");
SolrZkClient zkClient = new SolrZkClient(zkServer.getZkAddress(),
AbstractZkTestCase.TIMEOUT, AbstractZkTestCase.TIMEOUT);
@@ -1623,9 +1619,9 @@ public abstract class AbstractFullDistri
collectionInfos.put(collectionName, list);
}
params.set("name", collectionName);
- if (getStateFormat() == 2) {
- log.info("Creating collection with stateFormat=2: " + collectionName);
- params.set(DocCollection.STATE_FORMAT, "2");
+ if ("1".equals(getStateFormat()) ) {
+ log.info("Creating collection with stateFormat=1: " + collectionName);
+ params.set(DocCollection.STATE_FORMAT, "1");
}
SolrRequest request = new QueryRequest(params);
request.setPath("/admin/collections");