From 21f410687364ad1567afb7ab49dda9846d909aac Mon Sep 17 00:00:00 2001 From: Gregory Chanan Date: Mon, 30 Mar 2015 19:07:41 +0000 Subject: [PATCH] SOLR-7272: Use OverseerCollectionProcessor.ROUTER and DocCollection.DOC_ROUTER consistently git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1670178 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/solr/handler/admin/CollectionsHandler.java | 4 ++-- .../src/test/org/apache/solr/cloud/CustomCollectionTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java index 5ad3fe6cfcc..f859bf228b2 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java @@ -80,9 +80,9 @@ import static org.apache.solr.cloud.OverseerCollectionProcessor.ONLY_ACTIVE_NODE import static org.apache.solr.cloud.OverseerCollectionProcessor.ONLY_IF_DOWN; import static org.apache.solr.cloud.OverseerCollectionProcessor.REPLICATION_FACTOR; import static org.apache.solr.cloud.OverseerCollectionProcessor.REQUESTID; -import static org.apache.solr.cloud.OverseerCollectionProcessor.ROUTER; import static org.apache.solr.cloud.OverseerCollectionProcessor.SHARDS_PROP; import static org.apache.solr.cloud.OverseerCollectionProcessor.SHARD_UNIQUE; +import static org.apache.solr.common.cloud.DocCollection.DOC_ROUTER; import static org.apache.solr.common.cloud.ZkNodeProps.makeMap; import static org.apache.solr.common.cloud.ZkStateReader.ACTIVE; import static org.apache.solr.common.cloud.ZkStateReader.AUTO_ADD_REPLICAS; @@ -901,7 +901,7 @@ public class CollectionsHandler extends RequestHandlerBase { log.info("Create shard: " + req.getParamString()); req.getParams().required().check(COLLECTION_PROP, SHARD_ID_PROP); ClusterState clusterState = coreContainer.getZkController().getClusterState(); - if(!ImplicitDocRouter.NAME.equals( ((Map) clusterState.getCollection(req.getParams().get(COLLECTION_PROP)).get(ROUTER)).get("name") ) ) + if(!ImplicitDocRouter.NAME.equals( ((Map) clusterState.getCollection(req.getParams().get(COLLECTION_PROP)).get(DOC_ROUTER)).get("name") ) ) throw new SolrException(ErrorCode.BAD_REQUEST, "shards can be added only to 'implicit' collections" ); Map map = makeMap(QUEUE_OPERATION, CREATESHARD.toLower()); diff --git a/solr/core/src/test/org/apache/solr/cloud/CustomCollectionTest.java b/solr/core/src/test/org/apache/solr/cloud/CustomCollectionTest.java index 8f7cbf701cb..e59fca9685f 100644 --- a/solr/core/src/test/org/apache/solr/cloud/CustomCollectionTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/CustomCollectionTest.java @@ -58,8 +58,8 @@ import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import static org.apache.solr.cloud.OverseerCollectionProcessor.NUM_SLICES; -import static org.apache.solr.cloud.OverseerCollectionProcessor.ROUTER; import static org.apache.solr.cloud.OverseerCollectionProcessor.SHARDS_PROP; +import static org.apache.solr.common.cloud.DocCollection.DOC_ROUTER; import static org.apache.solr.common.cloud.ZkStateReader.MAX_SHARDS_PER_NODE; import static org.apache.solr.common.cloud.ZkStateReader.REPLICATION_FACTOR; import static org.apache.solr.common.params.ShardParams._ROUTE_; @@ -209,7 +209,7 @@ public class CustomCollectionTest extends AbstractFullDistribZkTestBase { ClusterState clusterState = zkStateReader.getClusterState(); DocCollection coll = clusterState.getCollection(COLL_PREFIX + 0); - assertEquals("implicit", ((Map)coll.get(ROUTER)).get("name") ); + assertEquals("implicit", ((Map)coll.get(DOC_ROUTER)).get("name") ); assertNotNull(coll.getStr(REPLICATION_FACTOR)); assertNotNull(coll.getStr(MAX_SHARDS_PER_NODE)); assertNull("A shard of a Collection configured with implicit router must have null range",